Add a webhook endpoint
const url = 'https://deeperesearch.com/v1/webhooks';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"url":"https://example.com/hooks/deeper","events":["research.completed","research.failed"]}'};
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://deeperesearch.com/v1/webhooks \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "url": "https://example.com/hooks/deeper", "events": [ "research.completed", "research.failed" ] }'Registers a public https URL for events. The signing secret is returned only here, so store it.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
A public https URL.
Event types to send. Defaults to all of them.
Example
{ "url": "https://example.com/hooks/deeper", "events": [ "research.completed", "research.failed" ]}Responses
Section titled “Responses”The endpoint and its signing secret
object
Example
{ "object": "webhook_endpoint", "events": [ "research.completed" ]}The body isn’t valid JSON (invalid_json)
object
object
Stable, machine-readable error code. See Errors in the docs.
What went wrong, written for people
Example generated
{ "error": { "code": "example", "message": "example" }}Missing or invalid API key (unauthorized)
object
object
Stable, machine-readable error code. See Errors in the docs.
What went wrong, written for people
Example generated
{ "error": { "code": "example", "message": "example" }}The key lacks the scope this needs (forbidden)
object
object
Stable, machine-readable error code. See Errors in the docs.
What went wrong, written for people
Example generated
{ "error": { "code": "example", "message": "example" }}The body is over 128 KB (body_too_large)
object
object
Stable, machine-readable error code. See Errors in the docs.
What went wrong, written for people
Example generated
{ "error": { "code": "example", "message": "example" }}Invalid request; the message names the field (invalid_request, exceeds_max_cost, vendor_unavailable, …)
object
object
Stable, machine-readable error code. See Errors in the docs.
What went wrong, written for people
Example generated
{ "error": { "code": "example", "message": "example" }}Rate limit, spending limit or quota reached (rate_limited, limit_reached, quota_exceeded). See Retry-After.
object
object
Stable, machine-readable error code. See Errors in the docs.
What went wrong, written for people
Example generated
{ "error": { "code": "example", "message": "example" }}