Base URL
/v1/ path prefix. There is one host for every kind of key. Calls use HTTPS: a plain HTTP request is not served and returns 301 to the HTTPS URL. Call the API from a server: iSnap does not grant cross-origin browser access to other websites.
Operations
These tables are the canonical list of the operations. Their columns:- Credential.
API keyis anisnap_live_orisnap_test_key: both do the same thing.Trial keyis the key of one trial.Nonemeans that the operation needs no credential. See Authentication. - Account. “Wholesale partners only” marks an operation that a direct account cannot use. An empty cell means any account. See Accounts.
Idempotency-Key. “Yes” means that the operation reads the header and recognizes a repeated request. “No” means that it ignores the header: a repeated request acts again. See Idempotency.
Messages
Chats
Attachments
Recipient lookup
Lines
Webhooks
Trials
BYOD
Pre-orders
Hosted macOS sessions
Service
Conventions
Requests
- A request body is JSON. Send
Content-Type: application/jsonwith every body. A+jsonsubtype, and parameters such ascharset, are accepted. - JSON fields and query parameters are in
snake_case. - A body field that the operation does not define is ignored. Nine operations refuse it instead, with
400 validation_failedand the issue codeunrecognized_keys:PATCH /v1/lines/{id}/config,POST /v1/pre-orders,PATCH /v1/pre-orders/{id},POST /v1/byod/pair,POST /v1/trial/init,POST /v1/trial/{trial_id}/revoke,PATCH /v1/trial/{trial_id},POST /v1/macos-sessions/rentandPATCH /v1/macos-sessions/{id}. On the other operations, a misspelled optional field is dropped without an error: check the response. - A query parameter that the operation does not define is ignored, without an error: a misspelled filter returns the list unfiltered.
- A path or a method that the API does not define returns
404 not_found. Without an API key, aPOST,PATCH,PUTorDELETEoutside/v1/webhooksreturns403 forbiddenfirst: see How a request is checked. - Timestamps in requests are ISO 8601 with a
Zsuffix: see Timestamps.
Responses
A success with a body has this shape, here the response ofDELETE /v1/chats/{chat_id}/typing. It has no error key.
Other rules of a response:
- Timestamps are ISO 8601 in UTC with milliseconds: see Timestamps.
- Ids have a prefix that names the resource: see Identifiers.
- A list returns its items one page at a time: see Pagination.
- Every response carries the
X-RateLimit-Limit,X-RateLimit-RemainingandX-RateLimit-Resetheaders: see Rate limits. - The responses of the operations that can return a secret carry
Cache-Control: no-store, whatever their status:POST /v1/byod/pair,POSTandGET /v1/pre-orders,GET /v1/pre-orders/{id}, itsconfirmandcancel,POSTandGET /v1/webhooks,GETandPATCH /v1/webhooks/{id},POST /v1/webhooks/{id}/rotate-secret,POST /v1/trial/initandGET /v1/trial/status.
Request and trace ids
Every response carries two ids in its headers. A response in the standard envelope, success or error, carries them in its body too.
Log both with every call: you need them to report a problem. Write to support@isnap.ai with the
trace_id and request_id of the response.
Two request headers are optional:
X-Request-Id: your own request id. iSnap keeps it only when it has the formreq_followed by 25 letters and digits, and replaces any other value.traceparent: a W3C trace context,00-<32 hex>-<16 hex>-<2 hex>in lowercase. Its trace id becomes thetrace_idof the response, and the header is returned. A malformed value is ignored.
Versioning and compatibility
The version of the API is aMAJOR.MINOR.PATCH number. It is the info.version of the OpenAPI document, and GET /v1/version returns it in data.version. These pages describe version 2.45.0.
The path prefix stays
/v1 whatever the major version.
Build your client so that a minor version does not break it:
- Ignore response fields, enum values and event types you do not know.
- Record an event of an unknown type as processed, and skip it.
Deprecation
Before iSnap removes an operation or a field, it marks it deprecated for at least 30 days. A deprecation shows in three places:
No operation is deprecated at this version. One field is:
monthly_price on a line. No removal date is set for it.
A removed operation returns 410. Its body is not the error format: error is the string endpoint_removed, and message, removed_at, successor and reason say when it was removed and what replaces it.
Webhook payloads carry api_version: "v1", which is not the API version number.
The changelog lists the versions, newest first.
OpenAPI document
GET https://api.isnap.ai/openapi.json returns the OpenAPI 3.0 document of the /v1 surface. It needs no credential.
/v1/api-keys and /v1/billing. They accept only a dashboard session and return 401 to an API key: they are not part of this reference. API keys are created and revoked in the iSnap dashboard, where a direct account also pays: see Accounts. The document does not list a server: send its operations to https://api.isnap.ai.