Authentication
The Partner API uses the OAuth 2.0 client credentials grant.
Getting a token
POST /v1/oauth/token with a form body:
| Field | Value |
|---|---|
grant_type |
client_credentials |
client_id |
Your client id, ss_cli_live_... or ss_cli_test_... |
client_secret |
Your client secret |
scope |
Optional. Space-separated subset of your credential's scopes. Omit it to get all of them. |
{ "access_token": "eyJ...", "token_type": "Bearer", "expires_in": 900, "scope": "products:read quotes:read quotes:write" }
Send the token on every other call:
Authorization: Bearer <access_token>
Tokens last 15 minutes. Cache the token and fetch a new one shortly before it expires; do not
request a token per call. Ten failed secret attempts in 10 minutes lock that client_id
for 15 minutes.
Scopes
| Scope | Allows |
|---|---|
products:read |
List products and read question schemas. |
quotes:read |
Read quotes, their documents and their binds. |
quotes:write |
Create quotes. |
binds:write |
Bind quotes. Reading a bind needs quotes:read. |
documents:write |
Upload documents. |
policies:read |
Read policies. |
policies:write |
Request endorsements and cancellations. |
enrichment:read |
Read enrichment jobs. |
enrichment:write |
Start enrichment jobs. |
A token without the scope a route needs gets 403 insufficient_scope. Scopes are checked
against your credential on every request: if a scope is removed from your credential, tokens
already issued stop working for it straight away, without waiting for them to expire.
Errors
| Status | code / error |
Meaning |
|---|---|---|
| 400 | invalid_request |
A required field is missing or malformed. |
| 400 | unsupported_grant_type |
grant_type is not client_credentials. |
| 400 | invalid_scope |
You asked for a scope your credential does not hold. |
| 401 | invalid_client |
Unknown, revoked or expired credential, or the wrong secret. |
| 401 | (any route) | Missing, expired, revoked or wrong-environment token. |
Token errors carry both the Partner API problem fields and the OAuth error /
error_description fields, so standard OAuth client libraries read them.
The production token URL is
https://api.secondsight.ai/functions/v1/partner-api/v1/oauth/token; elsewhere it is your
base URL followed by /v1/oauth/token.
Rotating credentials
You can hold two active credentials at once. Ask SecondSight for a new one, switch your systems to it, then ask for the old one to be revoked. A revoked credential's tokens stop working within 60 seconds.