Documentation Index
Fetch the complete documentation index at: https://docs.myaza.co/llms.txt
Use this file to discover all available pages before exploring further.
The Myaza API uses standard HTTP status codes. Error responses always include a message field and sometimes an error field with more detail.
Error Response Shape
{
"statusCode": 400,
"message": "Validation failed: amount must be a positive number",
"error": "Bad Request"
}
HTTP Status Codes
| Code | Meaning | Common Causes |
|---|
200 | OK | Request succeeded |
201 | Created | Resource created successfully |
204 | No Content | Deleted successfully |
400 | Bad Request | Invalid input, missing required fields, validation errors |
401 | Unauthorized | Missing or invalid API key / JWT |
403 | Forbidden | Valid auth but insufficient permissions |
404 | Not Found | Resource doesn’t exist or you don’t have access |
409 | Conflict | Resource already exists |
422 | Unprocessable Entity | Request understood but business logic rejected it |
429 | Too Many Requests | Rate limit exceeded |
500 | Internal Server Error | Unexpected server error |
Common Errors
401 Unauthorized
{
"statusCode": 401,
"message": "Unauthorized"
}
Fix: Check that you are sending the correct X-API-Key header or a valid Authorization: Bearer <token> header.
403 Forbidden
{
"statusCode": 403,
"message": "Insufficient permissions: crypto:write required"
}
Fix: Your API key or user account does not have the required permission. Either regenerate the key with the correct scope or contact your admin.
400 Validation Error
{
"statusCode": 400,
"message": [
"chain must be a valid chain identifier",
"amount must be a number string"
],
"error": "Bad Request"
}
Fix: Check the request body against the API reference. All required fields must be present and correctly typed.
404 Not Found
{
"statusCode": 404,
"message": "Webhook with id '123e4567-...' not found"
}
Fix: Verify the resource ID. Note that you can only access resources belonging to your own business.
429 Rate Limited
{
"statusCode": 429,
"message": "Too many requests, please try again later"
}
Fix: Implement exponential backoff. Default rate limits are:
- 100 requests/minute per API key
- Configurable lower limits when creating a key
Handling Errors in Code
const response = await fetch(
"https://secureapi.gridlog.io/api/v1/crypto/wallets/generate",
{
method: "POST",
headers: {
"X-API-Key": process.env.MYAZA_API_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify({ chain: "polygon" }),
},
);
if (!response.ok) {
const error = await response.json();
console.error(`API Error ${response.status}:`, error.message);
throw new Error(error.message);
}
const wallet = await response.json();
Retry Strategy
For 5xx errors and 429 rate limits, use exponential backoff:
async function withRetry(fn, maxRetries = 3) {
for (let attempt = 0; attempt <= maxRetries; attempt++) {
try {
return await fn();
} catch (err) {
if (attempt === maxRetries) throw err;
const isRetryable = [429, 500, 502, 503, 504].includes(err.status);
if (!isRetryable) throw err;
const delay = Math.pow(2, attempt) * 1000; // 1s, 2s, 4s
await new Promise((resolve) => setTimeout(resolve, delay));
}
}
}