curl --request POST \
--url https://api.contractorscloud.com/api/v1/webhooks/{webhookId}/sends \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.contractorscloud.com/api/v1/webhooks/{webhookId}/sends"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.contractorscloud.com/api/v1/webhooks/{webhookId}/sends', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.contractorscloud.com/api/v1/webhooks/{webhookId}/sends",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.contractorscloud.com/api/v1/webhooks/{webhookId}/sends"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.contractorscloud.com/api/v1/webhooks/{webhookId}/sends")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.contractorscloud.com/api/v1/webhooks/{webhookId}/sends")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "1a6c9e3b-7d2f-4a5c-9e1b-6d3f8a2c7e50",
"webhook_id": "a3d8f2e6-1c4b-4a9d-8e3f-2b5a7c9d4f60",
"retry_parent_id": null,
"event": "webhooks.test",
"status": "successful",
"request_sent_at": "2025-02-11 09:10:00",
"request_body": {
"event": "webhooks.test",
"description": "A test event sent on demand to verify your endpoint.",
"webhook_id": "a3d8f2e6-1c4b-4a9d-8e3f-2b5a7c9d4f60",
"data": {
"id": "foo",
"value": "bar"
}
},
"response_status": 200,
"response_body": "OK",
"response_received_at": "2025-02-11 09:10:01"
}{
"message": "Unauthenticated."
}{
"message": "The requested resource could not be found."
}Send test webhook
Synchronously delivers a webhooks.test event to this webhook’s endpoint and returns the resulting send record. Takes no request body, and works even when the webhook is disabled or has no event subscriptions — a convenient way to verify your endpoint and signature verification before subscribing to real events.
curl --request POST \
--url https://api.contractorscloud.com/api/v1/webhooks/{webhookId}/sends \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.contractorscloud.com/api/v1/webhooks/{webhookId}/sends"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.contractorscloud.com/api/v1/webhooks/{webhookId}/sends', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.contractorscloud.com/api/v1/webhooks/{webhookId}/sends",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.contractorscloud.com/api/v1/webhooks/{webhookId}/sends"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.contractorscloud.com/api/v1/webhooks/{webhookId}/sends")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.contractorscloud.com/api/v1/webhooks/{webhookId}/sends")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "1a6c9e3b-7d2f-4a5c-9e1b-6d3f8a2c7e50",
"webhook_id": "a3d8f2e6-1c4b-4a9d-8e3f-2b5a7c9d4f60",
"retry_parent_id": null,
"event": "webhooks.test",
"status": "successful",
"request_sent_at": "2025-02-11 09:10:00",
"request_body": {
"event": "webhooks.test",
"description": "A test event sent on demand to verify your endpoint.",
"webhook_id": "a3d8f2e6-1c4b-4a9d-8e3f-2b5a7c9d4f60",
"data": {
"id": "foo",
"value": "bar"
}
},
"response_status": 200,
"response_body": "OK",
"response_received_at": "2025-02-11 09:10:01"
}{
"message": "Unauthenticated."
}{
"message": "The requested resource could not be found."
}Authorizations
Authenticate with an API access token in the Authorization header: Authorization: Bearer <token>. Create a token from the API Access Tokens page in Contractors Cloud, under Integrations.
Path Parameters
The id of the webhook.
Response
The resulting send record.
The send's unique identifier.
"c2f9b3d7-6e4a-4c8f-8b1d-7a3e9c5f2d80"
The id of the webhook this delivery attempt belongs to.
"a3d8f2e6-1c4b-4a9d-8e3f-2b5a7c9d4f60"
The id of the earlier send this record is an automatic retry of. Null if this send wasn't a retry (the original attempt).
null
The name of the event this delivery was for.
"projects.created"
The delivery's outcome. pending — not yet attempted; successful — your endpoint returned a 2xx response; error — your endpoint returned a non-2xx response; timeout — your endpoint didn't respond within the time limit.
pending, successful, error, timeout "successful"
Timestamp when this delivery attempt was sent, formatted as YYYY-MM-DD HH:MM:SS. Null if not yet sent.
"2025-02-10 09:16:03"
The exact JSON payload delivered to your endpoint for this attempt, in the {event, description, webhook_id, data} envelope described in the Webhooks guide.
The HTTP status code your endpoint returned. Null if the delivery hasn't completed or your endpoint never responded (status is timeout).
200
The raw response body your endpoint returned. Null if the delivery hasn't completed or your endpoint never responded.
"OK"
Timestamp when your endpoint's response was received, formatted as YYYY-MM-DD HH:MM:SS. Null if the delivery hasn't completed or your endpoint never responded.
"2025-02-10 09:16:04"