Create a webhook bin that captures incoming requests
POST
https://api.testingapis.com/api/webhooks/binsPoint a webhook sender at the returned url, then read what arrived at inspectUrl. Up to 100 bins are kept; when the limit is reached, the oldest bin is evicted.
Request body
Optional. application/json, text/json, application/*+json, application/xml, text/xml, application/*+xml. Model: WebhooksControllerCreateBinRequest. Optional name for the bin.
Example body
{"name": "orders"}Responses
- 200
- OK
- 201
- Bin created; the response includes its capture URL and inspect URL.
- 400
- Name too long.
Example
Request
curl -X POST "https://api.testingapis.com/api/webhooks/bins" \
-H "Content-Type: application/json" \
-d '{"name": "orders"}'Response201 Created
{
"message": "Webhook bin created",
"data": {
"id": "0c772c6736ed",
"name": "orders",
"createdAt": "2026-09-30T18:26:45Z",
"requestCount": 0,
"url": "https://api.testingapis.com/api/webhooks/0c772c6736ed",
"inspectUrl": "https://api.testingapis.com/api/webhooks/bins/0c772c6736ed"
}
}Code examples
JavaScript (fetch)
const response = await fetch("https://api.testingapis.com/api/webhooks/bins", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: "{\"name\": \"orders\"}",
});
console.log(response.status, await response.text());Python (requests)
import requests
response = requests.request(
"POST",
"https://api.testingapis.com/api/webhooks/bins",
headers={
"Content-Type": "application/json",
},
data="{\"name\": \"orders\"}".encode("utf-8"),
allow_redirects=False,
)
print(response.status_code, response.text)Java (HttpClient)
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Main {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newBuilder()
.followRedirects(HttpClient.Redirect.NEVER)
.build();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.testingapis.com/api/webhooks/bins"))
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\"name\": \"orders\"}"))
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode() + " " + response.body());
}
}