Error Codes
When a request fails, the API returns a JSON response with an error message and an appropriate HTTP status code.
Error Response Format
All error responses follow the same envelope as success responses. The data field is null, and the error field contains a human-readable message.
Error Response
{
"data": null,
"error": "Meeting not found",
"meta": null
}HTTP Status Codes
| Code | Meaning | Common Cause |
|---|---|---|
200 | OK | Request succeeded. Response body contains the result. |
400 | Bad Request | Invalid JSON body, missing required fields, or malformed query parameters. |
401 | Unauthorized | Missing or invalid API key in the Authorization header. |
403 | Forbidden | API key lacks the required permission (e.g. 'write') for this operation. |
404 | Not Found | The requested resource does not exist or does not belong to your organization. |
429 | Too Many Requests | Rate limit exceeded. Wait before retrying. |
500 | Internal Server Error | Unexpected server error. If persistent, contact support. |
Handling Errors
We recommend implementing error handling in your API client. Check the HTTP status code first, then parse the error message from the response body.
Error Handling Example
async function miraRequest(path, options = {}) {
const response = await fetch(`https://your-domain.com/api/v1${path}`, {
...options,
headers: {
"Authorization": "Bearer " + process.env.MIRA_API_KEY,
"Content-Type": "application/json",
...options.headers,
},
});
const body = await response.json();
if (!response.ok) {
throw new Error(`Mira API error (${response.status}): ${body.error}`);
}
return body;
}Python Error Handling
import requests
def mira_request(path, **kwargs):
response = requests.get(
f"https://your-domain.com/api/v1{path}",
headers={"Authorization": f"Bearer {MIRA_API_KEY}"},
**kwargs,
)
if response.status_code == 429:
raise Exception("Rate limit exceeded, retry later")
data = response.json()
if response.status_code != 200:
raise Exception(f"Mira API error ({response.status_code}): {data['error']}")
return data