REST API Overview
Getting started with the Mostly REST API: authentication, base URLs, rate limits, and error handling.
The Mostly REST API provides programmatic access to your creative intelligence database, brand monitoring pipelines, and video generation workflows.
Base URLs
All API requests should be made to:
Production: https://mostly.so/api/v1
Staging: https://staging.mostly.so/api/v1
Local: http://localhost:3000/api/v1Authentication
Every request to the Mostly API must include your secret API key in the Authorization header as a Bearer token:
Authorization: Bearer mst_live_...Alternatively, you can pass the key in the x-api-key header:
x-api-key: mst_live_...Obtaining an API Key
- Navigate to Settings → API & MCP.
- Click Create API Key.
- Provide a descriptive name (e.g.
Zapier Integration,Cursor IDE) and optional expiration. - Copy the raw key immediately. For security, the key is hashed with SHA-256 and will never be shown again.
Response Formats
All API responses are returned in JSON format. Successful requests return standard 2xx HTTP status codes.
{
"totalAvailable": 1500,
"breakdown": {
"SUBSCRIPTION": 1000,
"GRANT": 500
}
}Error Handling
When an error occurs, the API returns standard HTTP error codes accompanied by an error response object:
{
"error": "UNAUTHORIZED",
"message": "Invalid, expired, or revoked API key."
}Common HTTP Status Codes
| Status Code | Description |
|---|---|
200 OK | Request succeeded. |
201 Created | Resource created successfully. |
400 Bad Request | Invalid parameters or malformed JSON payload. |
401 Unauthorized | Missing, invalid, or expired API key. |
404 Not Found | Requested resource (e.g. Brand profile, Creative) does not exist. |
429 Too Many Requests | Rate limit or credit allocation exceeded. |
500 Internal Server Error | Unexpected server error. |