1MSG
ReferenceInbox API

Rotate the inbox webhook signing secret

POST
/api/v1/inbox/webhook/secret

Returns the new secret once. The previous secret stops verifying deliveries immediately. 404 when no URL is saved.

Authorization

bearer
headerAuthorizationBearer <token>

Key issued in Settings → Developer → API key. Inbox methods need the Inbox scope. Campaigns methods need the Campaigns scope.

Response Body

application/json
  1. response
url?|

HTTPS URL that receives POST deliveries. Null when no webhook is saved.

secretPrefix?|

First 12 characters of the signing secret. The full secret is not returned here.

createdAt?|
Formatdate-time
updatedAt?|
Formatdate-time
lastDeliveryAt?|

When the last delivery attempt finished.

Formatdate-time
lastDeliveryStatus?|

HTTP status from the last delivery. Null when the request did not get a response.

lastDeliveryError?|

Short error from the last failed delivery.

events*array<>

Every event this webhook can send. Message and delivery-status events stay on the channel webhook.

envelope*

Example of the JSON body 1MSG POSTs. data matches events[].example for the type in the body.

secret?|

Full signing secret. Present only when the webhook is created or the secret is rotated. Store it. Later reads return secretPrefix only.

created*boolean

True when this call created the webhook. False when it updated the URL or rotated the secret.

curl -X POST 'https://api.1msg.io/api/v1/inbox/webhook/secret'
{  "url": "https://example.com/1msg/inbox",  "secretPrefix": "whsec_abc123",  "createdAt": "2019-08-24T14:15:22Z",  "updatedAt": "2019-08-24T14:15:22Z",  "lastDeliveryAt": "2019-08-24T14:15:22Z",  "lastDeliveryStatus": 200,  "lastDeliveryError": "string",  "events": [    {      "type": "inbox.conversation.status_changed",      "description": "Conversation opened or closed. status is OPEN or CLOSED.",      "example": {        "conversationId": "d94a047f-5984-42af-9f89-0f26c7e70ef1",        "channelId": "QAF261225002",        "status": "CLOSED",        "previousStatus": "OPEN",        "actorUserId": "b2bb82f0-2253-4e05-b955-a21f3d699caa"      }    }  ],  "envelope": {    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "type": "inbox.conversation.status_changed",    "createdAt": "2019-08-24T14:15:22Z",    "data": {}  },  "secret": "whsec_example_secret",  "created": true}