Skip to content

Sources

Where webhooks come in. Authentication, errors and limits are on the overview.

List sources

GET /api/v1/projects/{project_id}/environments/{environment_id}/sources

Parameters

NameInTypeDescription
project_id requiredpathstringprj_ ID
environment_id requiredpathstringenv_ ID

Responses

StatusDescriptionBody
200Oldest firstSource[]
401No API key, or it is invalid or revokedProblem
404No such environment, or no accessProblem
429Over the key's rate limit; Retry-After says when to try againProblem

Create source

POST /api/v1/projects/{project_id}/environments/{environment_id}/sources

A new source, which accepts any request unless verification says otherwise.

Parameters

NameInTypeDescription
project_id requiredpathstringprj_ ID
environment_id requiredpathstringenv_ ID

Request body

JSON, CreateSource.

FieldTypeDescription
deduplicationDeduplication | null
handshakeHandshake | nullDefaults to none.
methodsMethod[] | nullDefaults to ["POST"].
name requiredstring
responseSourceResponse | nullDefaults to 200 with an empty body.
search_fieldsstring[] | nullUp to 5 fields its events can be searched by; none by default.
verificationVerification | nullDefaults to {"method": "none"}: every request is accepted.

Responses

StatusDescriptionBody
201CreatedSource
401No API key, or it is invalid or revokedProblem
404No such environment, or no accessProblem
422Invalid name, methods, response, verification or deduplicationProblem
429Over the key's rate limit; Retry-After says when to try againProblem

Delete source

DELETE /api/v1/projects/{project_id}/environments/{environment_id}/sources/{source_id}

Deletes it with its connections; its URL stops accepting requests. Stored events stay until retention removes them.

Parameters

NameInTypeDescription
project_id requiredpathstringprj_ ID
environment_id requiredpathstringenv_ ID
source_id requiredpathstringsrc_ ID

Responses

StatusDescriptionBody
204Deleted
401No API key, or it is invalid or revokedProblem
404No such source, or no accessProblem
429Over the key's rate limit; Retry-After says when to try againProblem

Get source

GET /api/v1/projects/{project_id}/environments/{environment_id}/sources/{source_id}

Parameters

NameInTypeDescription
project_id requiredpathstringprj_ ID
environment_id requiredpathstringenv_ ID
source_id requiredpathstringsrc_ ID

Responses

StatusDescriptionBody
200The sourceSource
401No API key, or it is invalid or revokedProblem
404No such source, or no accessProblem
429Over the key's rate limit; Retry-After says when to try againProblem

Update source

PATCH /api/v1/projects/{project_id}/environments/{environment_id}/sources/{source_id}

Its URL never changes.

Parameters

NameInTypeDescription
project_id requiredpathstringprj_ ID
environment_id requiredpathstringenv_ ID
source_id requiredpathstringsrc_ ID

Request body

JSON, UpdateSource.

FieldTypeDescription
deduplicationDeduplication | null
handshakeHandshake | nullDefaults to none.
methodsMethod[] | null
namestring | null
responseSourceResponse | null
search_fieldsstring[] | nullReplaces the list; events already stored keep what they had.
verificationVerification | null

Responses

StatusDescriptionBody
200UpdatedSource
401No API key, or it is invalid or revokedProblem
404No such source, or no accessProblem
422Invalid name, methods, response, verification or deduplicationProblem
429Over the key's rate limit; Retry-After says when to try againProblem

List source secrets

GET /api/v1/projects/{project_id}/environments/{environment_id}/sources/{source_id}/secrets

Newest first, expired ones too.

Parameters

NameInTypeDescription
project_id requiredpathstringprj_ ID
environment_id requiredpathstringenv_ ID
source_id requiredpathstringsrc_ ID

Responses

StatusDescriptionBody
200Newest first, without their valuesSourceSecret[]
401No API key, or it is invalid or revokedProblem
404No such source, or no accessProblem
429Over the key's rate limit; Retry-After says when to try againProblem

Add source secret

POST /api/v1/projects/{project_id}/environments/{environment_id}/sources/{source_id}/secrets

Adds the current secret. The one before it keeps verifying for overlap_seconds; older ones stop now.

Parameters

NameInTypeDescription
project_id requiredpathstringprj_ ID
environment_id requiredpathstringenv_ ID
source_id requiredpathstringsrc_ ID

Request body

JSON, AddSourceSecret.

FieldTypeDescription
overlap_secondsinteger (int32) | nullHow long the previous secret keeps working, 0 to 2592000 seconds; a day when left out.
value requiredstringThe secret as the provider shows it, such as Stripe's whsec_....

Responses

StatusDescriptionBody
201Stored; its value is not returnedSourceSecret
401No API key, or it is invalid or revokedProblem
404No such source, or no accessProblem
422Invalid value or overlapProblem
429Over the key's rate limit; Retry-After says when to try againProblem
503The API has no MASTER_KEYS to seal it withProblem

Delete source secret

DELETE /api/v1/projects/{project_id}/environments/{environment_id}/sources/{source_id}/secrets/{secret_id}

It stops verifying now, e.g. to end an overlap early.

Parameters

NameInTypeDescription
project_id requiredpathstringprj_ ID
environment_id requiredpathstringenv_ ID
source_id requiredpathstringsrc_ ID
secret_id requiredpathstringsec_ ID

Responses

StatusDescriptionBody
204Deleted
401No API key, or it is invalid or revokedProblem
404No such secret, or no accessProblem
429Over the key's rate limit; Retry-After says when to try againProblem

Send test event

POST /api/v1/projects/{project_id}/environments/{environment_id}/sources/{source_id}/test-events

Parameters

NameInTypeDescription
project_id requiredpathstringprj_ ID
environment_id requiredpathstringenv_ ID
source_id requiredpathstringsrc_ ID

Request body

JSON, SendTestEvent.

FieldTypeDescription
body requiredstringThe raw body, as the provider would send it; at most 60,000 bytes.
headersstring[][] | null[name, value] pairs, in order; at most 100. Ricochet adds the signature unless sign is false.
methodstring | nullOne the source accepts. Default POST.
signboolean | nullSign it with the source's newest secret, as its verification method expects. Default true; false sends it exactly as given.

Responses

StatusDescriptionBody
201Stored, and routed unless it was heldTestEvent
401No API key, or it is invalid or revokedProblem
404No such source, or no accessProblem
422An invalid request, a method the source refuses, or nothing to sign withProblem
429Over the key's rate limit; Retry-After says when to try againProblem
503The gateway is not answeringProblem