MessageOS
APIWhoami

Identify the caller

GET
/whoami

Returns the client id, name, key prefix, scopes, environment, time zone, quiet hours and whether they hold your sends, allowed message classes, whether rich messages, the RCS extras, and bounded workflows are on, the reply window, and any limit MessageOS has set on requests and sends. Any valid key can call it.

Authorization

bearer
headerAuthorizationBearer <mosc_...>

A client key (mosc_).

Response Body

The caller.

application/json
  1. response
clientId*string
name*string
keyPrefix*|

The first characters of the client key.

scopes*array<string>
environment*string
timezone*|

The client IANA time zone.

quietHours*

Local times, in the contact time zone. They hold a send through the API only where quietHoursEnforced is true, or when the request sets onQuiet to reject or defer.

quietHoursEnforced*boolean

false: you keep your own quiet hours, and a send through the API is not held for the time of day or for a contact with no time zone unless the request asks with onQuiet. It is false for an agent set up as API only, whose own system and people decide when to send: a message sent from the dashboard is not held for it either. true: a send you start during quiet hours, or to a contact with no time zone, is blocked.

richMessages*boolean

true when POST /messages accepts suggestions, card, carousel, and file. false: it sends text and templates only, and a body with one of those fields returns 422.

rcsExtras*boolean

true when POST /messages accepts expiresAt, ttlSeconds, and trafficType, and GET /capabilities, POST /typing, and DELETE /messages/{id} answer. false: a body with one of those fields returns 422, and those three return 404.

allowedClasses*array<string>

Message classes this client may send.

workflowsEnabled*boolean
replyWindowSeconds*|

How recent the message named in inReplyTo must be for a send to count as a reply. null when replies are not turned on.

limits*

Any limit MessageOS has set on requests and sends. MessageOS does not cap either, so each limit is null unless one has been set. Read them here instead of keeping a figure of your own, because they can change.

Example request

curl 'https://api.messageos.ai/v1/whoami' \  -H 'Authorization: Bearer mosc_...'

Example response

{  "clientId": "example",  "name": "Example Dental",  "keyPrefix": "mosc_AbC123",  "scopes": [    "contacts:read",    "contacts:write",    "messages:write"  ],  "environment": "production",  "timezone": "America/New_York",  "quietHours": {    "start": "21:00",    "end": "08:00"  },  "quietHoursEnforced": true,  "richMessages": true,  "rcsExtras": true,  "allowedClasses": [    "service",    "transactional"  ],  "workflowsEnabled": true,  "replyWindowSeconds": 3600,  "limits": {    "requestsPerMinute": null,    "sendsPerAgent": null,    "sendsPerAgentWindowSeconds": 3600,    "sendsPerContact": null,    "sendsPerContactWindowSeconds": 3600  }}