Early access: these pages are being written and reviewed. Facts in the header boxes come straight from the product.
Create a webhook subscription
POST
/api/v1/webhooks
const url = 'https://api.pitch2sale.com/api/v1/webhooks';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"name":"example","url":"https://example.com","events":["lead.created"],"secret":"example","headers":{"additionalProperty":"example"},"is_active":true,"description":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.pitch2sale.com/api/v1/webhooks \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "name": "example", "url": "https://example.com", "events": [ "lead.created" ], "secret": "example", "headers": { "additionalProperty": "example" }, "is_active": true, "description": "example" }'Subscribes an HTTPS URL to one or more events. Deliveries are signed with HMAC-SHA256 of the body in X-CRM-Signature using secret (stored encrypted, never returned in plain text). Always pass a random secret of at least 16 characters: if omitted, the URL itself becomes the secret.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
name
required
string
url
required
string format: uri
events
required
Array<string>
secret
string
headers
object
key
additional properties
string
is_active
boolean
description
string
Responses
Section titled “Responses”The new subscription
Media typeapplication/json
object
webhook
required
Example
{ "webhook": { "last_delivery_status": "pending" }}Validation failed
Media typeapplication/json
object
error
required
string
code
string
message
string
details
Array<object>
object
field
required
string
message
required
string
code
required
string
Examplegenerated
{ "error": "example", "code": "example", "message": "example", "details": [ { "field": "example", "message": "example", "code": "example" } ]}Authentication required or token invalid
Media typeapplication/json
object
error
required
string
code
string
message
string
details
Array<object>
object
field
required
string
message
required
string
code
required
string
Examplegenerated
{ "error": "example", "code": "example", "message": "example", "details": [ { "field": "example", "message": "example", "code": "example" } ]}Feature not available on the organization plan
Media typeapplication/json
object
error
required
string
code
string
message
string
details
Array<object>
object
field
required
string
message
required
string
code
required
string
Examplegenerated
{ "error": "example", "code": "example", "message": "example", "details": [ { "field": "example", "message": "example", "code": "example" } ]}Role permission or token scope missing
Media typeapplication/json
object
error
required
string
code
string
message
string
details
Array<object>
object
field
required
string
message
required
string
code
required
string
Examplegenerated
{ "error": "example", "code": "example", "message": "example", "details": [ { "field": "example", "message": "example", "code": "example" } ]}Rate limit exceeded
Media typeapplication/json
object
error
required
string
code
string
message
string
details
Array<object>
object
field
required
string
message
required
string
code
required
string
Examplegenerated
{ "error": "example", "code": "example", "message": "example", "details": [ { "field": "example", "message": "example", "code": "example" } ]}