Songlist API

Version: 2.0.0

Export

Download

Download JSONDownload YAML

Copy URL

get/oauth2/validate

Validate an access token

Reports what the credential in the Authorization header is and what it reaches. Accepts all three Songlist schemes: `Bearer` (OAuth2), `Streamer` and `User`. This deviates from RFC 7662 in one way: an invalid, unknown or expired credential is answered with **401**, not with `200 {"active": false}`. A 200 therefore always carries `active: true`.

Authorization

Requires a valid access token (no specific scope)

Responses

200OK

application/json

Schema

ValidateTokenBody

$schemastring

A URL to the JSON Schema for this object.

activebooleanrequired

Always true — an invalid credential is answered with 401, not with active: false

auth_typestringrequired

scopes, client-credentials, streamer-token or user-token

client_idstring

OAuth2 client the token was issued to; absent for streamer and user tokens

expinteger

Expiry as a Unix timestamp; absent when the token does not expire

scopestring

Space-separated granted scopes. Absent — not empty — for streamer and user tokens, which carry no scopes and are not limited by any

streamer_idinteger

Channel this credential reaches, when there is one

substring

Identity id of the user behind the token; absent for a client_credentials token

token_usestringrequired

Always access_token

usernamestring

Songlist username of that user, when it is known

Example

{
  "$schema": "https://example.com",
  "active": true,
  "auth_type": "string",
  "client_id": "string",
  "exp": 0,
  "scope": "string",
  "streamer_id": 0,
  "sub": "string",
  "token_use": "string",
  "username": "string"
}
401Unauthorized

application/problem+json

Schema

ErrorModel

$schemastring

A URL to the JSON Schema for this object.

detailstring

A human-readable explanation specific to this occurrence of the problem.

errorsErrorDetail[]

Optional list of individual error details

Array items:

ErrorDetail

locationstring

Where the error occurred, e.g. 'body.items[3].tags' or 'path.thing-id'

messagestring

Error message text

valueunknown

The value at the given location

instancestring

A URI reference that identifies the specific occurrence of the problem.

statusinteger

HTTP status code

titlestring

A short, human-readable summary of the problem type. This value should not change between occurrences of the error.

typestring

A URI reference to human-readable documentation for the error.

Example

{
  "$schema": "https://example.com",
  "detail": "string",
  "errors": [
    {
      "location": "string",
      "message": "string",
      "value": null
    }
  ],
  "instance": "https://example.com",
  "status": 0,
  "title": "string",
  "type": "about:blank"
}
500Internal Server Error

application/problem+json

Schema

ErrorModel

$schemastring

A URL to the JSON Schema for this object.

detailstring

A human-readable explanation specific to this occurrence of the problem.

errorsErrorDetail[]

Optional list of individual error details

Array items:

ErrorDetail

locationstring

Where the error occurred, e.g. 'body.items[3].tags' or 'path.thing-id'

messagestring

Error message text

valueunknown

The value at the given location

instancestring

A URI reference that identifies the specific occurrence of the problem.

statusinteger

HTTP status code

titlestring

A short, human-readable summary of the problem type. This value should not change between occurrences of the error.

typestring

A URI reference to human-readable documentation for the error.

Example

{
  "$schema": "https://example.com",
  "detail": "string",
  "errors": [
    {
      "location": "string",
      "message": "string",
      "value": null
    }
  ],
  "instance": "https://example.com",
  "status": 0,
  "title": "string",
  "type": "about:blank"
}