# Webhooks ## List webhooks **get** `/v2/webhooks/{teamId}` Lists the team's webhooks. Signing secrets are never included. ### Path Parameters - `teamId: optional string` ### Returns - `data: array of Webhook` - `id: string` - `created_at: string` - `enabled: boolean` Disabled webhooks are skipped at delivery time. - `name: string` - `team_id: string` - `url: string` Endpoint events are delivered to. - `verified: boolean` True once the endpoint has completed the verification handshake. - `description: optional string` - `updated_at: optional string` - `verification_token: optional string` Stable token replayed to the endpoint (as the `micro_hook_token` query param) during the verification handshake. The endpoint may check it to confirm the request originated from Micro. - `verified_at: optional string` ### Example ```http curl https://developers.micro.so/v2/webhooks/$TEAM_ID \ -H "x-api-key: $MICRO_API_KEY" ``` #### Response ```json { "data": [ { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "created_at": "2019-12-27T18:11:19.117Z", "enabled": true, "name": "name", "team_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "url": "https://example.com", "verified": true, "description": "description", "updated_at": "2019-12-27T18:11:19.117Z", "verification_token": "verification_token", "verified_at": "2019-12-27T18:11:19.117Z" } ] } ``` ## Create a webhook **post** `/v2/webhooks/{teamId}` Registers a webhook and enqueues an asynchronous verification handshake (run by the dispatcher). The response includes the signing `secret`, shown only this once; `verified` is false until the handshake passes. ### Path Parameters - `teamId: optional string` ### Body Parameters - `name: string` - `url: string` HTTP(S) endpoint. Rejected if it resolves to a private/internal address. - `description: optional string` - `enabled: optional boolean` ### Returns - `WebhookWithSecret = Webhook` Returned ONLY on creation. Includes the signing secret (shown once) and the pending verification status. - `secret: string` HMAC signing secret (prefix `whsec_`). Store it now — it is never returned again. The dispatcher signs each delivered payload with it so your endpoint can verify authenticity. - `verification: optional object { status }` Status of the verification handshake enqueued by this request. The handshake runs asynchronously in the dispatcher; poll the webhook (its `verified` flag flips to true on success) to observe the outcome. - `status: "pending"` Always `pending` at the moment of the response — the dispatcher has been asked to run the handshake but has not reported back yet. - `"pending"` ### Example ```http curl https://developers.micro.so/v2/webhooks/$TEAM_ID \ -H 'Content-Type: application/json' \ -H "x-api-key: $MICRO_API_KEY" \ -d '{ "name": "x", "url": "https://example.com" }' ``` #### Response ```json { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "created_at": "2019-12-27T18:11:19.117Z", "enabled": true, "name": "name", "team_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "url": "https://example.com", "verified": true, "description": "description", "updated_at": "2019-12-27T18:11:19.117Z", "verification_token": "verification_token", "verified_at": "2019-12-27T18:11:19.117Z", "secret": "secret", "verification": { "status": "pending" } } ``` ## Get a webhook **get** `/v2/webhooks/{teamId}/{webhookId}` Get a webhook ### Path Parameters - `teamId: optional string` - `webhookId: string` ### Returns - `Webhook object { id, created_at, enabled, 8 more }` A registered webhook endpoint. - `id: string` - `created_at: string` - `enabled: boolean` Disabled webhooks are skipped at delivery time. - `name: string` - `team_id: string` - `url: string` Endpoint events are delivered to. - `verified: boolean` True once the endpoint has completed the verification handshake. - `description: optional string` - `updated_at: optional string` - `verification_token: optional string` Stable token replayed to the endpoint (as the `micro_hook_token` query param) during the verification handshake. The endpoint may check it to confirm the request originated from Micro. - `verified_at: optional string` ### Example ```http curl https://developers.micro.so/v2/webhooks/$TEAM_ID/$WEBHOOK_ID \ -H "x-api-key: $MICRO_API_KEY" ``` #### Response ```json { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "created_at": "2019-12-27T18:11:19.117Z", "enabled": true, "name": "name", "team_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "url": "https://example.com", "verified": true, "description": "description", "updated_at": "2019-12-27T18:11:19.117Z", "verification_token": "verification_token", "verified_at": "2019-12-27T18:11:19.117Z" } ``` ## Update a webhook **patch** `/v2/webhooks/{teamId}/{webhookId}` Updates mutable fields. Changing `url` resets verification and re-runs the handshake. ### Path Parameters - `teamId: optional string` - `webhookId: string` ### Body Parameters - `description: optional string` - `enabled: optional boolean` - `name: optional string` - `url: optional string` ### Returns - `verification: optional object { status }` Status of the verification handshake enqueued by this request. The handshake runs asynchronously in the dispatcher; poll the webhook (its `verified` flag flips to true on success) to observe the outcome. - `status: "pending"` Always `pending` at the moment of the response — the dispatcher has been asked to run the handshake but has not reported back yet. - `"pending"` ### Example ```http curl https://developers.micro.so/v2/webhooks/$TEAM_ID/$WEBHOOK_ID \ -X PATCH \ -H 'Content-Type: application/json' \ -H "x-api-key: $MICRO_API_KEY" \ -d '{}' ``` #### Response ```json { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "created_at": "2019-12-27T18:11:19.117Z", "enabled": true, "name": "name", "team_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "url": "https://example.com", "verified": true, "description": "description", "updated_at": "2019-12-27T18:11:19.117Z", "verification_token": "verification_token", "verified_at": "2019-12-27T18:11:19.117Z", "verification": { "status": "pending" } } ``` ## Delete a webhook **delete** `/v2/webhooks/{teamId}/{webhookId}` Delete a webhook ### Path Parameters - `teamId: optional string` - `webhookId: string` ### Example ```http curl https://developers.micro.so/v2/webhooks/$TEAM_ID/$WEBHOOK_ID \ -X DELETE \ -H "x-api-key: $MICRO_API_KEY" ``` ## Re-run verification **post** `/v2/webhooks/{teamId}/{webhookId}/verify` Re-runs the GET challenge/echo handshake against the webhook's url and updates its verified state. ### Path Parameters - `teamId: optional string` - `webhookId: string` ### Returns - `verification: optional object { status }` Status of the verification handshake enqueued by this request. The handshake runs asynchronously in the dispatcher; poll the webhook (its `verified` flag flips to true on success) to observe the outcome. - `status: "pending"` Always `pending` at the moment of the response — the dispatcher has been asked to run the handshake but has not reported back yet. - `"pending"` ### Example ```http curl https://developers.micro.so/v2/webhooks/$TEAM_ID/$WEBHOOK_ID/verify \ -X POST \ -H "x-api-key: $MICRO_API_KEY" ``` #### Response ```json { "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "created_at": "2019-12-27T18:11:19.117Z", "enabled": true, "name": "name", "team_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "url": "https://example.com", "verified": true, "description": "description", "updated_at": "2019-12-27T18:11:19.117Z", "verification_token": "verification_token", "verified_at": "2019-12-27T18:11:19.117Z", "verification": { "status": "pending" } } ``` ## Send a test event **post** `/v2/webhooks/{teamId}/{webhookId}/ping` Fire-and-forget test delivery through the async dispatcher. The webhook must be enabled and verified. ### Path Parameters - `teamId: optional string` - `webhookId: string` ### Body Parameters - `data: optional map[unknown]` Arbitrary JSON payload body. - `event: optional string` Event name to send. ### Returns - `dispatched: boolean` - `event: string` - `webhook_id: string` ### Example ```http curl https://developers.micro.so/v2/webhooks/$TEAM_ID/$WEBHOOK_ID/ping \ -X POST \ -H "x-api-key: $MICRO_API_KEY" ``` #### Response ```json { "dispatched": true, "event": "event", "webhook_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" } ``` ## List team deliveries **get** `/v2/webhooks/{teamId}/deliveries` Account-wide delivery feed across all of the team's webhooks, newest first. ### Path Parameters - `teamId: optional string` ### Query Parameters - `cursor: optional string` Opaque cursor from a previous response's `next_cursor`. - `limit: optional number` Page size (1–100, default 25). - `status: optional "success" or "failed"` Filter by outcome. - `"success"` - `"failed"` - `type: optional "delivery" or "verification" or "all"` Filter by run type. Defaults to `delivery` (event deliveries). Pass `all` to include verification handshakes. - `"delivery"` - `"verification"` - `"all"` ### Returns - `data: array of WebhookDelivery` - `created_at: string` - `delivery_id: string` - `status: "success" or "failed"` - `"success"` - `"failed"` - `type: "delivery" or "verification"` - `"delivery"` - `"verification"` - `webhook_id: string` - `attempts: optional number` Number of attempts made so far (including async retries). - `event: optional string` Event name (e.g. `webhook.test`); `verification` for handshake runs. - `status_code: optional number` HTTP status of the latest attempt; null on a transport error. - `team_id: optional string` - `updated_at: optional string` - `url: optional string` - `next_cursor: optional string` Pass as `cursor` to fetch the next page; null when there are no more. ### Example ```http curl https://developers.micro.so/v2/webhooks/$TEAM_ID/deliveries \ -H "x-api-key: $MICRO_API_KEY" ``` #### Response ```json { "data": [ { "created_at": "2019-12-27T18:11:19.117Z", "delivery_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "status": "success", "type": "delivery", "webhook_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "attempts": 0, "event": "event", "status_code": 0, "team_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "updated_at": "2019-12-27T18:11:19.117Z", "url": "url" } ], "next_cursor": "next_cursor" } ``` ## Domain Types ### Webhook - `Webhook object { id, created_at, enabled, 8 more }` A registered webhook endpoint. - `id: string` - `created_at: string` - `enabled: boolean` Disabled webhooks are skipped at delivery time. - `name: string` - `team_id: string` - `url: string` Endpoint events are delivered to. - `verified: boolean` True once the endpoint has completed the verification handshake. - `description: optional string` - `updated_at: optional string` - `verification_token: optional string` Stable token replayed to the endpoint (as the `micro_hook_token` query param) during the verification handshake. The endpoint may check it to confirm the request originated from Micro. - `verified_at: optional string` ### Webhook Create - `WebhookCreate object { name, url, description, enabled }` On create, the dispatcher asynchronously runs a verification handshake: it sends a GET to `url` with `micro_hook_mode=subscribe`, a one-time `micro_hook_challenge`, and the webhook's `micro_hook_token`. The endpoint must respond 200 and echo the challenge value verbatim in the body; on success the webhook's `verified` flag flips to true. A failed handshake does not fail creation — re-run it later via the verify endpoint. - `name: string` - `url: string` HTTP(S) endpoint. Rejected if it resolves to a private/internal address. - `description: optional string` - `enabled: optional boolean` ### Webhook Delivery - `WebhookDelivery object { created_at, delivery_id, status, 8 more }` A webhook delivery — one logical event delivery to an endpoint, grouping its attempts. Status and status_code reflect the latest attempt. - `created_at: string` - `delivery_id: string` - `status: "success" or "failed"` - `"success"` - `"failed"` - `type: "delivery" or "verification"` - `"delivery"` - `"verification"` - `webhook_id: string` - `attempts: optional number` Number of attempts made so far (including async retries). - `event: optional string` Event name (e.g. `webhook.test`); `verification` for handshake runs. - `status_code: optional number` HTTP status of the latest attempt; null on a transport error. - `team_id: optional string` - `updated_at: optional string` - `url: optional string` ### Webhook Delivery Detail - `WebhookDeliveryDetail = WebhookDelivery` A delivery plus its full attempt timeline. - `attempt_history: optional array of object { attempt, created_at, status, 4 more }` - `attempt: number` 1-based attempt number. - `created_at: string` - `status: "success" or "failed"` - `"success"` - `"failed"` - `error: optional string` Failure reason, when status is failed. - `request_body: optional string` Body sent to the endpoint (delivery only); may be truncated. - `response_body: optional string` Body returned by the endpoint; may be truncated. - `status_code: optional number` ### Webhook Update - `WebhookUpdate object { description, enabled, name, url }` Partial update. Changing `url` resets verification and re-runs the handshake. - `description: optional string` - `enabled: optional boolean` - `name: optional string` - `url: optional string` ### Webhook With Secret - `WebhookWithSecret = Webhook` Returned ONLY on creation. Includes the signing secret (shown once) and the pending verification status. - `secret: string` HMAC signing secret (prefix `whsec_`). Store it now — it is never returned again. The dispatcher signs each delivered payload with it so your endpoint can verify authenticity. - `verification: optional object { status }` Status of the verification handshake enqueued by this request. The handshake runs asynchronously in the dispatcher; poll the webhook (its `verified` flag flips to true on success) to observe the outcome. - `status: "pending"` Always `pending` at the moment of the response — the dispatcher has been asked to run the handshake but has not reported back yet. - `"pending"` ### Webhook List Response - `WebhookListResponse object { data }` - `data: array of Webhook` - `id: string` - `created_at: string` - `enabled: boolean` Disabled webhooks are skipped at delivery time. - `name: string` - `team_id: string` - `url: string` Endpoint events are delivered to. - `verified: boolean` True once the endpoint has completed the verification handshake. - `description: optional string` - `updated_at: optional string` - `verification_token: optional string` Stable token replayed to the endpoint (as the `micro_hook_token` query param) during the verification handshake. The endpoint may check it to confirm the request originated from Micro. - `verified_at: optional string` ### Webhook Update Response - `WebhookUpdateResponse = Webhook` A webhook plus the status of a verification handshake enqueued by this request. - `verification: optional object { status }` Status of the verification handshake enqueued by this request. The handshake runs asynchronously in the dispatcher; poll the webhook (its `verified` flag flips to true on success) to observe the outcome. - `status: "pending"` Always `pending` at the moment of the response — the dispatcher has been asked to run the handshake but has not reported back yet. - `"pending"` ### Webhook Verify Response - `WebhookVerifyResponse = Webhook` A webhook plus the status of a verification handshake enqueued by this request. - `verification: optional object { status }` Status of the verification handshake enqueued by this request. The handshake runs asynchronously in the dispatcher; poll the webhook (its `verified` flag flips to true on success) to observe the outcome. - `status: "pending"` Always `pending` at the moment of the response — the dispatcher has been asked to run the handshake but has not reported back yet. - `"pending"` ### Webhook Ping Response - `WebhookPingResponse object { dispatched, event, webhook_id }` - `dispatched: boolean` - `event: string` - `webhook_id: string` ### Webhook List Deliveries Response - `WebhookListDeliveriesResponse object { data, next_cursor }` - `data: array of WebhookDelivery` - `created_at: string` - `delivery_id: string` - `status: "success" or "failed"` - `"success"` - `"failed"` - `type: "delivery" or "verification"` - `"delivery"` - `"verification"` - `webhook_id: string` - `attempts: optional number` Number of attempts made so far (including async retries). - `event: optional string` Event name (e.g. `webhook.test`); `verification` for handshake runs. - `status_code: optional number` HTTP status of the latest attempt; null on a transport error. - `team_id: optional string` - `updated_at: optional string` - `url: optional string` - `next_cursor: optional string` Pass as `cursor` to fetch the next page; null when there are no more. # Deliveries ## List webhook deliveries **get** `/v2/webhooks/{teamId}/{webhookId}/deliveries` An endpoint's deliveries, newest first, with optional status / type / time-range filters and cursor pagination. ### Path Parameters - `teamId: optional string` - `webhookId: string` ### Query Parameters - `after: optional string` Only deliveries at or after this ISO-8601 timestamp. - `before: optional string` Only deliveries at or before this ISO-8601 timestamp. - `cursor: optional string` Opaque cursor from a previous response's `next_cursor`. - `limit: optional number` Page size (1–100, default 25). - `status: optional "success" or "failed"` Filter by outcome. - `"success"` - `"failed"` - `type: optional "delivery" or "verification" or "all"` Filter by run type. Defaults to `delivery` (event deliveries). Pass `all` to include verification handshakes. - `"delivery"` - `"verification"` - `"all"` ### Returns - `data: array of WebhookDelivery` - `created_at: string` - `delivery_id: string` - `status: "success" or "failed"` - `"success"` - `"failed"` - `type: "delivery" or "verification"` - `"delivery"` - `"verification"` - `webhook_id: string` - `attempts: optional number` Number of attempts made so far (including async retries). - `event: optional string` Event name (e.g. `webhook.test`); `verification` for handshake runs. - `status_code: optional number` HTTP status of the latest attempt; null on a transport error. - `team_id: optional string` - `updated_at: optional string` - `url: optional string` - `next_cursor: optional string` Pass as `cursor` to fetch the next page; null when there are no more. ### Example ```http curl https://developers.micro.so/v2/webhooks/$TEAM_ID/$WEBHOOK_ID/deliveries \ -H "x-api-key: $MICRO_API_KEY" ``` #### Response ```json { "data": [ { "created_at": "2019-12-27T18:11:19.117Z", "delivery_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "status": "success", "type": "delivery", "webhook_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "attempts": 0, "event": "event", "status_code": 0, "team_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "updated_at": "2019-12-27T18:11:19.117Z", "url": "url" } ], "next_cursor": "next_cursor" } ``` ## Get a delivery **get** `/v2/webhooks/{teamId}/{webhookId}/deliveries/{deliveryId}` A single delivery plus its full attempt timeline (including async retries). ### Path Parameters - `teamId: optional string` - `webhookId: string` - `deliveryId: string` ### Returns - `WebhookDeliveryDetail = WebhookDelivery` A delivery plus its full attempt timeline. - `attempt_history: optional array of object { attempt, created_at, status, 4 more }` - `attempt: number` 1-based attempt number. - `created_at: string` - `status: "success" or "failed"` - `"success"` - `"failed"` - `error: optional string` Failure reason, when status is failed. - `request_body: optional string` Body sent to the endpoint (delivery only); may be truncated. - `response_body: optional string` Body returned by the endpoint; may be truncated. - `status_code: optional number` ### Example ```http curl https://developers.micro.so/v2/webhooks/$TEAM_ID/$WEBHOOK_ID/deliveries/$DELIVERY_ID \ -H "x-api-key: $MICRO_API_KEY" ``` #### Response ```json { "created_at": "2019-12-27T18:11:19.117Z", "delivery_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "status": "success", "type": "delivery", "webhook_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "attempts": 0, "event": "event", "status_code": 0, "team_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "updated_at": "2019-12-27T18:11:19.117Z", "url": "url", "attempt_history": [ { "attempt": 0, "created_at": "2019-12-27T18:11:19.117Z", "status": "success", "error": "error", "request_body": "request_body", "response_body": "response_body", "status_code": 0 } ] } ``` ## Domain Types ### Delivery List Response - `DeliveryListResponse object { data, next_cursor }` - `data: array of WebhookDelivery` - `created_at: string` - `delivery_id: string` - `status: "success" or "failed"` - `"success"` - `"failed"` - `type: "delivery" or "verification"` - `"delivery"` - `"verification"` - `webhook_id: string` - `attempts: optional number` Number of attempts made so far (including async retries). - `event: optional string` Event name (e.g. `webhook.test`); `verification` for handshake runs. - `status_code: optional number` HTTP status of the latest attempt; null on a transport error. - `team_id: optional string` - `updated_at: optional string` - `url: optional string` - `next_cursor: optional string` Pass as `cursor` to fetch the next page; null when there are no more.