Skip to content

List webhooks

GET
/webhooks
curl --request GET \
--url 'https://api.sendtruss.com/v1/webhooks?state=pending&type=message.delivered' \
--header 'Authorization: Bearer <token>'

Every webhook of the last 30 days, newest first, 50 to a page, with its delivery state, attempts and last error: the place to look when one didn’t arrive.

endpoint
string

Only the webhooks for this endpoint, by its id.

state
WebhookState
string
Allowed values: pending delivered failed
type
WebhookType

Every webhook type an endpoint can ask for. Any other type is refused with unknown_type.

string
Allowed values: message.delivered message.bounced message.complained message.suppressed message.failed message.expired contact.left_marketing contact.rejoined_marketing contact.suppressed workspace.health_changed sending_domain.changed
workspace
string
/^([0-9A-Za-z]{26}|ref:[A-Za-z0-9._-]{1,128})$/

Only the webhooks about this workspace, by our id or as ref: plus your reference.

Paginated set of WebhookResource

Media typeapplication/json
object
data
required
Array<object>
WebhookResource
object
id
required
string
type
required
string
source
required

Where the change came from: recipient when the person did it, such as leaving marketing or marking an email as spam; sendtruss when our sending or our own rules recorded it.

string
endpoint_id
required
string
workspace
required
object
id
required
string | null
reference
required
string | null
state
required

pending until your endpoint answers 2xx (delivered) or we give up (failed).

string
attempts
required
integer
last_attempt_at
required
string | null
last_status
required

The HTTP status your endpoint last answered with, or null when it gave none.

integer | null
last_error
required

What went wrong on the last attempt, or null.

string | null
delivered_at
required
string | null
created_at
required
string
body
string
links
required
object
first
required
string | null
last
required
string | null
prev
required
string | null
next
required
string | null
meta
required
object
path
required

Base path for paginator generated URLs.

string | null
per_page
required

Number of items shown per page.

integer
next_cursor
required

The “cursor” that points to the next set of items.

string | null
prev_cursor
required

The “cursor” that points to the previous set of items.

string | null
Examplegenerated
{
"data": [
{
"id": "example",
"type": "example",
"source": "example",
"endpoint_id": "example",
"workspace": {
"id": "example",
"reference": "example"
},
"state": "example",
"attempts": 1,
"last_attempt_at": "example",
"last_status": 1,
"last_error": "example",
"delivered_at": "example",
"created_at": "example",
"body": "example"
}
],
"links": {
"first": "example",
"last": "example",
"prev": "example",
"next": "example"
},
"meta": {
"path": "example",
"per_page": 1,
"next_cursor": "example",
"prev_cursor": "example"
}
}
Request-Id
required
string format: uuid

This request’s id. Quote it when you ask us about the request.

The API key is missing, malformed, revoked or expired.

Media typeapplication/json
object
message
required

What went wrong, for a person to read. It may change, so branch on code.

string
code
required

What went wrong, for your code to branch on. A new code is not a breaking change.

string
Allowed values: unauthenticated
doc_url
required

The entry on our errors page that explains this code.

string format: uri
request_id
required

This request’s id, the same as its Request-Id header. Quote it when you ask us about the request.

string format: uuid
Example
{
"code": "unauthenticated"
}
Request-Id
required
string format: uuid

This request’s id. Quote it when you ask us about the request.

The request is invalid. The code says why, and errors names each field at fault.

Media typeapplication/json
object
message
required

What went wrong, for a person to read. It may change, so branch on code.

string
code
required

What went wrong, for your code to branch on. A new code is not a breaking change.

string
Allowed values: validation_failed
errors
required

Each field that failed validation, by its path in the request, with its messages.

object
key
additional properties
Array<string>
doc_url
required

The entry on our errors page that explains this code.

string format: uri
request_id
required

This request’s id, the same as its Request-Id header. Quote it when you ask us about the request.

string format: uuid
Example
{
"code": "validation_failed"
}
Request-Id
required
string format: uuid

This request’s id. Quote it when you ask us about the request.

Too many requests. Wait for the seconds in Retry-After.

Media typeapplication/json
object
message
required

What went wrong, for a person to read. It may change, so branch on code.

string
code
required

What went wrong, for your code to branch on. A new code is not a breaking change.

string
Allowed values: rate_limited
doc_url
required

The entry on our errors page that explains this code.

string format: uri
request_id
required

This request’s id, the same as its Request-Id header. Quote it when you ask us about the request.

string format: uuid
Example
{
"code": "rate_limited"
}
Request-Id
required
string format: uuid

This request’s id. Quote it when you ask us about the request.

Retry-After
integer

Seconds to wait before trying again.