Skip to main content

API Keys

All requests to the Guayaba API must be authenticated using an API key passed in the X-API-Key header.
curl https://api.guayaba.ai/contacts \
  -H "X-API-Key: gua_a1b2c3d4_your-api-key-here"
You can generate and manage API keys from the API Keys page in your Guayaba AI dashboard.
API keys follow the format gua_xxxxxxxx_.... Keep your key secret — treat it like a password and never expose it in client-side code or public repositories.

Rate Limiting

API requests are rate-limited per key to ensure fair usage and platform stability.
Endpoint TypeLimitWindow
Read (GET)100 requests1 minute
Write (POST)30 requests1 minute

Rate Limit Headers

Every API response includes these headers so you can monitor your usage:
HeaderDescription
X-RateLimit-LimitMaximum requests allowed in the current window
X-RateLimit-RemainingRequests remaining in the current window
X-RateLimit-ResetUnix timestamp (seconds) when the window resets

Handling 429 Errors

When you exceed the rate limit, the API returns a 429 Too Many Requests response. The Retry-After header tells you exactly how many seconds to wait.
{
  "error": "Too many requests",
  "message": "Rate limit exceeded. Try again in 45 seconds.",
  "retryAfter": 45
}
Check X-RateLimit-Remaining proactively in your integration. If it drops to 0, pause requests and wait until X-RateLimit-Reset before retrying.

Error Responses

All errors follow a consistent format:
{
  "error": "Error description",
  "message": "Detailed error message"
}
Status CodeMeaning
400Bad Request — Validation error, missing required fields, or invalid data
401Unauthorized — Invalid or missing API key
404Not Found — Contact or campaign not found
429Too Many Requests — Rate limit exceeded
500Internal Server Error — Something went wrong on our end
503Service Unavailable — Temporary system issue; retry after a short wait