NeccessoryNeccessory
REST API

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.com

Every 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:

PrefixObject
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

LimitScopeDefault
Requests per minutePer key, all signed endpointsOff. Set it per key in the console, up to 6,000
Usage log readsPer key, GET /sdk/v1/logs60 per minute
Report creationPer key30 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

MethodPathPurposeReference
POST/sdk/v1/auth/testCheck your signing and read the key's settingsAuthentication

Cloud sessions

MethodPathPurposeReference
POST/sdk/v1/cloud/sessionsStart a live cloud measurement and get a session token for the SDKCloud sessions
GET/sdk/v1/cloud/jobs/{jobId}Status and result of a session; jobId is the sessionIdCloud sessions

Video processing

MethodPathPurposeReference
POST/sdk/v1/cloud/uploads/presignGet an upload URL for a video fileVideo processing
POST/sdk/v1/cloud/jobsQueue a processing job for the uploaded videoVideo processing
GET/sdk/v1/cloud/jobs/{jobId}Job status and, once completed, the measurementVideo processing

Measurements

MethodPathPurposeReference
POST/sdk/v1/measurementsStore a result computed on the deviceMeasurements
GET/sdk/v1/measurements/{id}Read a measurement your key ownsMeasurements

End users

MethodPathPurposeReference
GET/sdk/v1/usersList your end users with measurement countsEnd users
GET/sdk/v1/users/{ref}/measurementsOne user's measurement historyEnd users
GET/sdk/v1/users/{ref}/baselineOne user's personal baselineEnd users

Reports

MethodPathPurposeReference
POST/sdk/v1/measurements/{id}/reportCreate an encrypted link to a measurementShareable reports

Usage log

MethodPathPurposeReference
GET/sdk/v1/logsRead your key's call logUsage log

On-device models

MethodPathPurposeReference
POST/sdk/v1/models/grantMint a short-lived model grant for the Web SDKBelow

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.

HTTPerror.codeCause
403on_device_not_authorizedThe key is not an on_device key, or your organization's on-device access is not approved. Test keys always get this response
403forbiddenWeb 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.

MethodPathReturns
GET/openapi.jsonOpenAPI 3.1 description of the API. Import it into Postman, Insomnia or a client generator
GET/.well-known/agent.jsonMachine-readable manifest for AI agents: authentication scheme, capabilities, links
GET/api/v1/pricingToken rates, metric set prices and token packs. See Pricing
GET/api/v1/limitsPlatform limits, such as the maximum per-key rate and cloud duration bounds
GET/api/v1/statusAvailability of cloud processing
GET/healthLiveness: { "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.