Skip to content

Authentication

The Teradek REST API uses OAuth 2.0 with the Resource Owner Password Credentials grant (RFC 6749) for authentication.


Get an Access Token

Request an access token using your device admin password:

POST /oauth/token
curl -X POST https://<device-ip>/oauth/token \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "grant_type=password&password=<admin-password>"
ParameterTypeRequiredDescription
grant_typestringYesMust be password
passwordstringYesDevice admin password
Response
{
  "expires_in": 3600,
  "token_type": "Bearer",
  "refresh_token": "bNLzvBOEqwDNYApV9jduhjlVXIoOp9kB",
  "access_token": "rYDVtxfHdH7Igk5qdMEWMJZAJpg1Gjvy"
}

Refresh an Access Token

Use a refresh token to obtain a new access token without re-authenticating:

POST /oauth/token
curl -X POST https://<device-ip>/oauth/token \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "grant_type=refresh_token&refresh_token=<your-refresh-token>"
ParameterTypeRequiredDescription
grant_typestringYesMust be refresh_token
refresh_tokenstringYesThe refresh token from initial auth

Using the Token

Include the access token in the Authorization header for all API requests:

Authorization Header
Authorization: Bearer <access_token>

Token Expiration

Tokens have a limited lifetime. Use the refresh token to obtain new access tokens before they expire. All tokens are invalidated if the device password is changed.

Token TypeExpiration
Access Token1 hour
Refresh Token1 week

Rate Limiting

The API enforces rate limits to protect device resources. Exceeding the limit returns a 429 status code.

Endpoint TypeLimitWindow
API endpoints60 requests60 seconds
OAuth endpoints30 requests60 seconds

Rate Limit Headers

Rate limit information is included in response headers:

HeaderDescription
X-RateLimit-LimitMaximum requests allowed
X-RateLimit-RemainingRequests remaining in window
X-RateLimit-ResetUnix timestamp when window resets

HTTP Status Codes

CodeDescription
200Success
400Bad Request -- Invalid input
401Unauthorized -- Missing or invalid token
429Too Many Requests -- Rate limit exceeded
500Internal Server Error