EncoraStream Auth API (2.0.0)

Download OpenAPI specification:

EncoraStream API Team: api-support@encorastream.com License: Proprietary

Authentication and session management endpoints for the EncoraStream OTT Platform.

Covers:

  • JWT RS256 token issuance (access token) and rotation (refresh token)
  • User registration and email verification
  • Password reset
  • Multi-factor authentication (TOTP MFA setup, verification, recovery)
  • Session listing and revocation
  • Token revocation (logout)

Auth

JWT RS256 token issuance, refresh, revocation, password reset, email verification

Login

Authenticate with email and password. Returns a JWT access token. Sets the refresh token as an HttpOnly cookie.

Request Body schema: application/json
required
email
required
string <email>
password
required
string <password>

Responses

Request samples

Content type
application/json
{
  • "email": "user@example.com",
  • "password": "pa$$word"
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Refresh Access Token

Obtain a new access token using the refresh token stored in the HttpOnly cookie. Refresh tokens are single-use and rotated on every call. The previous refresh token is immediately invalidated. The new refresh token is set as an HttpOnly cookie in the response.

Responses

Response samples

Content type
application/json
{
  • "data": {
    }
}

Revoke Token (Logout)

Revokes the current access token and clears the refresh token cookie. The session is immediately terminated server-side. Clients must discard all stored tokens on receipt of 200.

Authorizations:
BearerAuth

Responses

Response samples

Content type
application/json
{
  • "code": "RATE_LIMITED",
  • "message": "Too many requests. Retry after the indicated period.",
  • "request_id": "018fde1a-9b2c-7f3e-8d4a-2b5c6e7f8a9b"
}

Request Password Reset Email

Sends a password-reset link to the registered email address.

Security: Always returns 200 regardless of whether the email exists, preventing account enumeration. The reset token is single-use, expires in 15 minutes, and is invalidated on first use or on next login.

Request Body schema: application/json
required
email
required
string <email> <= 254 characters

Responses

Request samples

Content type
application/json
{
  • "email": "user@example.com"
}

Response samples

Content type
application/json
{
  • "code": "VALIDATION_ERROR",
  • "message": "One or more fields failed validation.",
  • "errors": [
    ],
  • "request_id": "018fde1a-9b2c-7f3e-8d4a-2b5c6e7f8a9b"
}

Confirm Password Reset

Completes the reset using the token from the email link. All existing sessions are revoked on success.

Request Body schema: application/json
required
token
required
string

Opaque reset token from the emailed link. Never store or log.

new_password
required
string <password> [ 10 .. 128 ] characters

Responses

Request samples

Content type
application/json
{
  • "token": "string",
  • "new_password": "pa$$word_q"
}

Response samples

Content type
application/json
{
  • "access_token": "string",
  • "token_type": "Bearer",
  • "expires_in": 900
}

Verify Email Address

Verifies the user's email using the token from the verification email. Moves account from pending_verification to active.

Request Body schema: application/json
required
token
required
string

Opaque verification token from the emailed link.

Responses

Request samples

Content type
application/json
{
  • "token": "string"
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Resend Email Verification

Resends the verification email. Rate-limited to 3 requests per hour per account. Always returns 200 to prevent email enumeration.

Request Body schema: application/json
required
email
required
string <email> <= 254 characters

Responses

Request samples

Content type
application/json
{
  • "email": "user@example.com"
}

Response samples

Content type
application/json
{
  • "code": "RATE_LIMITED",
  • "message": "Too many requests. Retry after the indicated period.",
  • "request_id": "018fde1a-9b2c-7f3e-8d4a-2b5c6e7f8a9b"
}

Register a New User

Creates a new user account. Sends an email-verification message. Rate-limited strictly to prevent account enumeration: identical error responses are returned for existing and new email addresses.

Request Body schema: application/json
required
email
required
string <email> <= 254 characters
password
required
string <password> [ 10 .. 128 ] characters

Must contain uppercase, lowercase, digit, and special character.

display_name
string <= 100 characters
phone
string <= 20 characters ^\+[1-9]\d{1,14}$
locale
string

BCP-47 language tag. Defaults to Accept-Language header if omitted.

country_code
string = 2 characters

ISO 3166-1 alpha-2. Used for tax calculation and geo-gating.

accept_terms
required
boolean
Value: true

Must be true — user confirms acceptance of Terms of Service and Privacy Policy. Stored with timestamp for audit.

Responses

Request samples

Content type
application/json
{
  • "email": "user@example.com",
  • "password": "pa$$word_q",
  • "display_name": "string",
  • "phone": "string",
  • "locale": "en-US",
  • "country_code": "US",
  • "accept_terms": true
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

List Active Sessions

Returns all active login sessions for the current account.

Authorizations:
BearerAuth

Responses

Response samples

Content type
application/json
{
  • "data": [
    ]
}

Revoke a Specific Session

Terminates a single session. Use current as the session_id to revoke the active session (logout).

Authorizations:
BearerAuth
path Parameters
session_id
required
string

Responses

Response samples

Content type
application/json
{
  • "code": "UNAUTHORIZED",
  • "message": "Access token is missing or invalid.",
  • "request_id": "018fde1a-9b2c-7f3e-8d4a-2b5c6e7f8a9b"
}

Setup MFA (TOTP)

Initiates TOTP MFA enrollment. Returns a provisioning_uri and QR code data URL. MFA is not active until confirmed via POST /me/auth/mfa/verify.

Authorizations:
BearerAuth

Responses

Response samples

Content type
application/json
{}

Verify TOTP Code (Complete MFA Setup or Step-Up Auth)

Verifies a TOTP code. Used to:

  1. Complete MFA enrollment after /me/auth/mfa/setup.
  2. Satisfy MFA challenge during login (step-up authentication). Returns a short-lived step-up token on success.
Authorizations:
BearerAuth
Request Body schema: application/json
required
totp_code
required
string [ 6 .. 8 ] characters ^\d+$

Responses

Request samples

Content type
application/json
{
  • "totp_code": "string"
}

Response samples

Content type
application/json
{
  • "step_up_token": "string",
  • "expires_in": 300
}

Disable MFA

Removes MFA from the account. Requires a valid TOTP code for confirmation. All sessions are revoked.

Authorizations:
BearerAuth
Request Body schema: application/json
required
totp_code
required
string [ 6 .. 8 ] characters ^\d+$

Responses

Request samples

Content type
application/json
{
  • "totp_code": "string"
}

Response samples

Content type
application/json
{
  • "code": "NOT_FOUND",
  • "message": "Resource not found.",
  • "request_id": "266ea41d-adf5-480b-af50-15b940c2b846",
  • "documentation_url": "http://example.com"
}

Get MFA Recovery Codes

Returns one-time backup codes for MFA recovery. Codes are hashed server-side and shown only once — the full plaintext codes are displayed on first generation or after regeneration. Requires a valid step-up token.

Authorizations:
BearerAuth

Responses

Response samples

Content type
application/json
{
  • "codes": [
    ],
  • "generated_at": "2019-08-24T14:15:22Z"
}

Regenerate MFA Recovery Codes

Invalidates all existing recovery codes and issues a new set. Requires TOTP confirmation.

Authorizations:
BearerAuth
Request Body schema: application/json
required
totp_code
required
string [ 6 .. 8 ] characters ^\d+$

Responses

Request samples

Content type
application/json
{
  • "totp_code": "string"
}

Response samples

Content type
application/json
{
  • "codes": [
    ],
  • "generated_at": "2019-08-24T14:15:22Z"
}

Registration

New user account creation

Sessions

Active session listing and revocation

MFA

Multi-factor authentication setup, verification, and recovery