Songlist API

Version: 2.0.0

Export

Download

Download JSONDownload YAML

Copy URL

post/tokens/credit

Add request tokens to a viewer's balance

Authorization

Required scopes

  • streamer.token.writeAdjust streamer request token balances

Request Bodyrequired

application/json

Schema

AdjustTokensInputBody

$schemastring

A URL to the JSON Schema for this object.

amountintegerrequired

Number of tokens to add or remove

idempotencyKeystring

Optional key making retries safe: the same key never applies twice

messagestring

Optional note shown alongside the transaction

platformstring

Viewer platform (twitch, youtube, kick) when identifying by username

streamerIdintegerrequired

Streamer whose viewer balance is adjusted

userIdinteger

Songlist user id of the viewer

usernamestring

Viewer username on the platform

Example

{
  "$schema": "https://example.com",
  "amount": 1,
  "idempotencyKey": "string",
  "message": "string",
  "platform": "string",
  "streamerId": 1,
  "userId": 0,
  "username": "string"
}

Responses

200OK

application/json

Schema

AdjustTokensResponseBody

$schemastring

A URL to the JSON Schema for this object.

balanceintegerrequired
replayedbooleanrequired

True when this request repeated a previously applied idempotency key

transactionIdintegerrequired
userIdintegerrequired

Example

{
  "$schema": "https://example.com",
  "balance": 0,
  "replayed": true,
  "transactionId": 0,
  "userId": 0
}
400Bad Request

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"
}
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"
}
403Forbidden

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"
}
404Not Found

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"
}
422Unprocessable Entity

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"
}