Read the account inbox webhook
One HTTPS URL per account. The owner sets it here or in Settings → Developer → API Settings. A user key cannot. When inbox state changes, 1MSG POSTs InboxWebhookEnvelope to that URL.
This is not the channel webhook. Incoming messages and delivery statuses stay on the channel URL.
Delivery
Content-Type:application/jsonX-1msg-Event: the typeX-1msg-Delivery: the idX-1msg-Signature:sha256=<hex HMAC of the raw body>
Compare the signature with HMAC-SHA256 over the exact request body with the signing secret. Reject a mismatch.
Delivery does not change the API response. A failed POST is stored as lastDeliveryStatus and lastDeliveryError.
Events
| Event | When | data fields |
|---|---|---|
inbox.conversation.status_changed | Conversation opened or closed. status is OPEN or CLOSED. | conversationId, channelId, status, previousStatus, actorUserId |
inbox.conversation.assigned | An assignee was set. assigneeUserId is the new assignee. | conversationId, channelId, assigneeUserId, previousAssigneeUserId, actorUserId |
inbox.conversation.unassigned | The assignee was cleared. assigneeUserId is null. | conversationId, channelId, assigneeUserId, previousAssigneeUserId, actorUserId |
inbox.conversation.blocked | The contact was blocked. Incoming messages are rejected. | conversationId, channelId, actorUserId |
inbox.conversation.unblocked | The contact was unblocked. | conversationId, channelId, actorUserId |
inbox.conversation.title_changed | The conversation title was renamed. | conversationId, channelId, title, previousTitle, actorUserId |
inbox.user.invited | The owner invited a user. They are not a member until they accept. | inviteId, email, channelIds, actorUserId |
inbox.user.added | The invited person accepted and is now an operator. | memberId, userId, email, channelIds |
inbox.user.removed | An operator was removed from the account. | memberId, userId, actorUserId |
inbox.user.channels_changed | The channels an operator can open were replaced. | memberId, userId, channelIds, actorUserId |
inbox.user.invite_revoked | A pending invite was cancelled before it was accepted. | inviteId, email, actorUserId |
bearerAuthorizationBearer <token>Key issued in Settings → Developer → API key. Inbox methods need the Inbox scope. Campaigns methods need the Campaigns scope.
application/json- 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?|date-timeupdatedAt?|date-timelastDeliveryAt?|When the last delivery attempt finished.
date-timelastDeliveryStatus?|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.
curl -X GET 'https://api.1msg.io/api/v1/inbox/webhook'{ "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": {} }}