For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
contact@agentmail.ccDiscord
DocumentationAPI ReferenceKnowledge BaseChangelog
DocumentationAPI ReferenceKnowledge BaseChangelog
  • API Reference
      • GETList Webhooks
      • GETGet Webhook
      • POSTCreate Webhook
      • PATCHUpdate Webhook
      • DELDelete Webhook
LogoLogo
contact@agentmail.ccDiscord
API ReferenceWebhooks

Create Webhook

POST
/v0/webhooks
POST
/v0/webhooks
1from agentmail import AgentMail
2
3client = AgentMail(
4 api_key="YOUR_TOKEN_HERE",
5)
6
7client.webhooks.create(
8 url="url",
9 event_types=[
10 "message.received",
11 "message.received"
12 ],
13)
1{
2 "webhook_id": "webhook_id",
3 "url": "url",
4 "secret": "secret",
5 "enabled": true,
6 "updated_at": "2024-01-15T09:30:00Z",
7 "created_at": "2024-01-15T09:30:00Z",
8 "event_types": [
9 "message.received",
10 "message.received"
11 ],
12 "pod_ids": [
13 "pod_ids",
14 "pod_ids"
15 ],
16 "inbox_ids": [
17 "inbox_ids",
18 "inbox_ids"
19 ],
20 "client_id": "client_id"
21}
**CLI:** ```bash agentmail webhooks create --url https://example.com/webhook --event-type message.received ```
Was this page helpful?
Previous

Update Webhook

Next
Built with

CLI:

$agentmail webhooks create --url https://example.com/webhook --event-type message.received

Authentication

AuthorizationBearer

Bearer authentication of the form Bearer <token>, where token is your auth token.

Request

This endpoint expects an object.
urlstringRequired
URL of webhook endpoint.
event_typeslist of enumsRequired

Full list of event types this webhook should receive. At least one type is required. Send every type you want in this array (not incremental). See Webhooks overview for spam, blocked, and unauthenticated events and required permissions.

pod_idslist of stringsOptional
Pods for which to send events. Maximum 10 per webhook.
inbox_idslist of stringsOptional
Inboxes for which to send events. Maximum 10 per webhook.
client_idstringOptional
Client ID of webhook.

Response

This endpoint returns an object.
webhook_idstring
ID of webhook.
urlstring
URL of webhook endpoint.
secretstring
Secret for webhook signature verification.
enabledboolean
Webhook is enabled.
updated_atdatetime
Time at which webhook was last updated.
created_atdatetime
Time at which webhook was created.
event_typeslist of enums
Event types for which to send events.
pod_idslist of strings
Pods for which to send events. Maximum 10 per webhook.
inbox_idslist of strings
Inboxes for which to send events. Maximum 10 per webhook.
client_idstring
Client ID of webhook.

Errors

400
Validation Error