Skip to content
Go to Micro

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 ParametersExpand Collapse
teamId: optional string
formatuuid
Body ParametersJSONExpand Collapse
name: string
minLength1
maxLength255
url: string

HTTP(S) endpoint. Rejected if it resolves to a private/internal address.

formaturi
description: optional string
maxLength1000
enabled: optional boolean
ReturnsExpand Collapse
WebhookWithSecret = Webhook { id, created_at, enabled, 8 more }

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.

Create a webhook

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"
        }'
{
  "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"
  }
}
Returns Examples
{
  "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"
  }
}