Overview
Base URL, request conventions, rate limits and an index of every REST endpoint.
The REST API lets your backend start cloud measurements, process recorded video, store on-device results, and read measurements, end-user history and your usage log.
Base URL
https://neccessory.comEvery customer endpoint lives under /sdk/v1.
Authentication
Every /sdk/v1 request carries your key ID and an HMAC-SHA256 signature computed with your
secret. Sign on your server and never send the secret to a browser or app. See
Authentication.
Requests and responses
JSON. Request and response bodies are JSON. Send Content-Type: application/json with
every request that has a body: the signature covers the body only when it arrives as JSON.
Bodies are limited to 256 KB (413 payload_too_large).
Envelope. Every response wraps its payload:
{ "ok": true, "data": { "id": "meas_9c1f4b7ae2d05138b6a37f42" } }{ "ok": false, "error": { "code": "validation_error", "message": "source must be web, ios or playground" } }Branch on ok, then on error.code. The message is for people and may change. All codes
are listed in Errors.
Timestamps are Unix epoch milliseconds. Two exceptions count seconds: the x-timestamp
signing header and the RateLimit-Reset header.
IDs are opaque strings with a type prefix:
| Prefix | Object |
|---|---|
nk_live_, nk_test_ | Key ID and secret of a live or test key |
meas_ | Measurement |
cj_ | Cloud session or video processing job |
up_ | Uploaded video (objectKey) |
rpt_ | Shareable report |
wh_ | Webhook endpoint |
whd_ | Webhook delivery |
req_ | API request |
Pagination. List endpoints take page (from 1) and perPage (1–100, default 20) and
return items with a total. The usage log pages with a cursor instead; see
Usage log.
New fields. Responses gain fields over time. Ignore fields you do not recognize.
Request ID
Every response carries an X-Request-Id header, for example req_9a1c4e77b0d2358fc6e4. Log
it with every failed call and include it when you contact support. The same ID appears on the
matching row of the usage log and on a measurement stored by that call.
CORS
/sdk/v1 accepts requests from any origin and exposes the X-Request-Id and RateLimit-*
headers to browsers. Access is controlled by the signature, not by origin: anyone holding the
secret can call the API. Keep the secret on your server. The browser receives a session token
(cloud mode) or a model grant (on-device mode), never the secret.
Rate limits
| Limit | Scope | Default |
|---|---|---|
| Requests per minute | Per key, all signed endpoints | Off. Set it per key in the console, up to 6,000 |
| Usage log reads | Per key, GET /sdk/v1/logs | 60 per minute |
| Report creation | Per key | 30 per hour |
A limited request returns 429 rate_limited. Responses from a limited endpoint carry
RateLimit-Limit, RateLimit-Remaining and RateLimit-Reset (seconds until the window
resets). Monthly cloud quotas and spend caps are described in
Limits & quotas.
Endpoints
Keys
| Method | Path | Purpose | Reference |
|---|---|---|---|
POST | /sdk/v1/auth/test | Check your signing and read the key's settings | Authentication |
Cloud sessions
| Method | Path | Purpose | Reference |
|---|---|---|---|
POST | /sdk/v1/cloud/sessions | Start a live cloud measurement and get a session token for the SDK | Cloud sessions |
GET | /sdk/v1/cloud/jobs/{jobId} | Status and result of a session; jobId is the sessionId | Cloud sessions |
Video processing
| Method | Path | Purpose | Reference |
|---|---|---|---|
POST | /sdk/v1/cloud/uploads/presign | Get an upload URL for a video file | Video processing |
POST | /sdk/v1/cloud/jobs | Queue a processing job for the uploaded video | Video processing |
GET | /sdk/v1/cloud/jobs/{jobId} | Job status and, once completed, the measurement | Video processing |
Measurements
| Method | Path | Purpose | Reference |
|---|---|---|---|
POST | /sdk/v1/measurements | Store a result computed on the device | Measurements |
GET | /sdk/v1/measurements/{id} | Read a measurement your key owns | Measurements |
End users
| Method | Path | Purpose | Reference |
|---|---|---|---|
GET | /sdk/v1/users | List your end users with measurement counts | End users |
GET | /sdk/v1/users/{ref}/measurements | One user's measurement history | End users |
GET | /sdk/v1/users/{ref}/baseline | One user's personal baseline | End users |
Reports
| Method | Path | Purpose | Reference |
|---|---|---|---|
POST | /sdk/v1/measurements/{id}/report | Create an encrypted link to a measurement | Shareable reports |
Usage log
| Method | Path | Purpose | Reference |
|---|---|---|---|
GET | /sdk/v1/logs | Read your key's call log | Usage log |
On-device models
| Method | Path | Purpose | Reference |
|---|---|---|---|
POST | /sdk/v1/models/grant | Mint a short-lived model grant for the Web SDK | Below |
Organization webhooks are configured in the console; see Webhooks.
On-device model grant
POST /sdk/v1/models/grant issues a grant that lets the Web SDK load the on-device models on
your domain. Call it from your backend with an empty body, then pass grant to the page and on
to the SDK as modelGrant (see Configuration).
{
"ok": true,
"data": {
"grant": "bmtfbGl2ZV9zUndHOXoyaEsyaGRWNElsODNKN0N3.1790000900000.3yZ1b7Qx0mV4k2P9sT6wR8nA5cE1fH0jL3oU7iY2gDk",
"expiresAt": 1790000900000
}
}A grant is valid for 15 minutes. Mint a fresh one for each page load or measurement.
| HTTP | error.code | Cause |
|---|---|---|
| 403 | on_device_not_authorized | The key is not an on_device key, or your organization's on-device access is not approved. Test keys always get this response |
| 403 | forbidden | Web model access is not enabled for this key or was revoked |
On-device access is requested in the console; see API keys.
Public endpoints
These need no authentication.
| Method | Path | Returns |
|---|---|---|
GET | /openapi.json | OpenAPI 3.1 description of the API. Import it into Postman, Insomnia or a client generator |
GET | /.well-known/agent.json | Machine-readable manifest for AI agents: authentication scheme, capabilities, links |
GET | /api/v1/pricing | Token rates, metric set prices and token packs. See Pricing |
GET | /api/v1/limits | Platform limits, such as the maximum per-key rate and cloud duration bounds |
GET | /api/v1/status | Availability of cloud processing |
GET | /health | Liveness: { "ok": true, "version": "…" } |
/api/v1/pricing, /api/v1/limits and /api/v1/status send no CORS headers. Call them from
your server.
{ "ok": true, "data": { "api": "ok", "cloud": { "status": "ok", "checkedAt": 1790000000000 } } }cloud.status is "ok" while cloud processing accepts work. Any other value means new cloud
sessions and jobs can fail with 503 cloud_unavailable until it recovers.