import { createClient } from "@mailsai/sdk";
const client = createClient(); // reads MAILS_API_KEY
const result = await client.webhooks.get(
"whe_01JZX8K3M9Q4P7VN2YB6RTDC0E",
);
console.log(result);from mailsai import create_client
client = create_client() # reads MAILS_API_KEY
result = client.get_webhook(
"whe_01JZX8K3M9Q4P7VN2YB6RTDC0E",
)
print(result)curl 'https://api.mails.ai/v1/webhooks/whe_01JZX8K3M9Q4P7VN2YB6RTDC0E' \
-H "Authorization: Bearer $MAILS_API_KEY"mails webhooks get whe_01JABC{
"name": "mails_webhooks_get",
"arguments": {
"webhook_id": "whe_01JZX8K3M9Q4P7VN2YB6RTDC0E"
}
}{
"id": "whe_01JZX8K3M9Q4P7VN2YB6RTDC0E",
"url": "https://example.com",
"event_types": ["<event_types>"],
"description": "<description>",
"active": false,
"secret_rotated_at": "2026-10-04T12:00:00.000Z",
"previous_secret_expires_at": "2026-10-04T12:00:00.000Z",
"created_at": "<created_at>"
}200 The endpoint. The signing secret is never returned
here.
401 Missing or invalid API key.
403 The API key lacks the required scope
(insufficient_scope), or the token belongs to an
app connected by sign-in and this operation is
closed to connected apps
(connected_app_not_allowed).
404 Resource not found in this workspace, or the agent
a send names is archived (agent_archived).
500 Internal server error.Retrieve a webhook endpoint
import { createClient } from "@mailsai/sdk";
const client = createClient(); // reads MAILS_API_KEY
const result = await client.webhooks.get(
"whe_01JZX8K3M9Q4P7VN2YB6RTDC0E",
);
console.log(result);from mailsai import create_client
client = create_client() # reads MAILS_API_KEY
result = client.get_webhook(
"whe_01JZX8K3M9Q4P7VN2YB6RTDC0E",
)
print(result)curl 'https://api.mails.ai/v1/webhooks/whe_01JZX8K3M9Q4P7VN2YB6RTDC0E' \
-H "Authorization: Bearer $MAILS_API_KEY"mails webhooks get whe_01JABC{
"name": "mails_webhooks_get",
"arguments": {
"webhook_id": "whe_01JZX8K3M9Q4P7VN2YB6RTDC0E"
}
}{
"id": "whe_01JZX8K3M9Q4P7VN2YB6RTDC0E",
"url": "https://example.com",
"event_types": ["<event_types>"],
"description": "<description>",
"active": false,
"secret_rotated_at": "2026-10-04T12:00:00.000Z",
"previous_secret_expires_at": "2026-10-04T12:00:00.000Z",
"created_at": "<created_at>"
}200 The endpoint. The signing secret is never returned
here.
401 Missing or invalid API key.
403 The API key lacks the required scope
(insufficient_scope), or the token belongs to an
app connected by sign-in and this operation is
closed to connected apps
(connected_app_not_allowed).
404 Resource not found in this workspace, or the agent
a send names is archived (agent_archived).
500 Internal server error.Path Parameters
Webhook endpoint id (whe_…).
Response
Webhook endpoint id (whe_…).
The URL events are POSTed to.
The event types this endpoint receives. * is every type except thread.created, thread.updated, thread.deleted, thread.assigned, thread.unassigned, thread.note_added, message.delayed, agent.created, agent.updated, agent.deleted, draft.created, draft.updated and draft.deleted, which reach an endpoint only when it lists them by name.
Your note about the endpoint, or null when it has none.
false while the endpoint is paused: nothing is delivered to it until PATCH /v1/webhooks/{id} sets it back to true.
When the signing secret was last rotated.
While set, deliveries are signed with both the new and the previous secret; null once the previous one stops signing.
When the endpoint was created (ISO 8601, UTC).
Was this page helpful?