Livepush Developers

Authentication

Submit the consent decision

POST https://tokens.livepush.io/oauth2/authorize

Base URL https://tokens.livepush.io — Authentication & OAuth 2.0

Records the user's decision and redirects back to your app.

On approval the redirect carries code (valid for 10 minutes, single use) and your state. On refusal or any validation failure it carries error and error_description instead, and no code.

Authorization

Send a valid access token in the Authorization header.

  • sessionCookie — apiKey — srid Browser session cookie set by POST /auth/signin. HttpOnly, 48-hour lifetime, scoped to the Livepush cookie domain. Used only by the auth service — the resource APIs accept bearer tokens and nothing else.
headers.txt
Authorization: Bearer YOUR_API_TOKEN

Try it

POST https://tokens.livepush.io/oauth2/authorize — This call changes live data on your account.

Parameters

Query parameters

  • client_id string required
    Client ID issued by the developer console.
  • redirect_uri string required
    Must match the value used on the consent request.
    example: https://yourapp.example.com/callback
  • scope string required
    The scopes the user was shown.
    example: streams.read,streams.videos.read
  • state string
    Echoed back on the redirect.

Request body

application/json required

  • session_id string required
    The sessionID from the consent screen.
  • is_rejected boolean
    true when the user refused. Accepted as a boolean or the string "true". A refusal redirects back with error=access_denied.
Example request body response.json
{
  "session_id": "Bk93jd0Ba",
  "is_rejected": false
}

Code samples

request.sh
curl -X POST 'https://tokens.livepush.io/oauth2/authorize?client_id=%3Cclient_id%3E&redirect_uri=https%3A%2F%2Fyourapp.example.com%2Fcallback&scope=streams.read%2Cstreams.videos.read' \
  -H 'Authorization: Bearer YOUR_API_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
    "session_id": "Bk93jd0Ba",
    "is_rejected": false
  }'
const response = await fetch('https://tokens.livepush.io/oauth2/authorize?client_id=%3Cclient_id%3E&redirect_uri=https%3A%2F%2Fyourapp.example.com%2Fcallback&scope=streams.read%2Cstreams.videos.read', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_API_TOKEN',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "session_id": "Bk93jd0Ba",
    "is_rejected": false
  }),
});

if (!response.ok) {
  throw new Error(`Livepush API error ${response.status}`);
}

const data = await response.json();
import requests

headers = {
    'Authorization': 'Bearer YOUR_API_TOKEN',
    'Content-Type': 'application/json',
}

payload = {
    "session_id": "Bk93jd0Ba",
    "is_rejected": False
}

response = requests.post('https://tokens.livepush.io/oauth2/authorize?client_id=%3Cclient_id%3E&redirect_uri=https%3A%2F%2Fyourapp.example.com%2Fcallback&scope=streams.read%2Cstreams.videos.read', headers=headers, json=payload, timeout=30)
response.raise_for_status()
data = response.json()

Responses

Redirect to redirect_uri carrying either code or error.

Headers

  • Location string
    Your redirect URI with code and state, or error and error_description, appended.

No response body.