Errors and Support

The Platica API uses standard HTTP status codes to indicate whether a request succeeded or failed. This section describes the error formats, common codes, and how to get help.


Error Format

Every error response follows a consistent JSON format:

{
  "code": 404,
  "error": "Not Found - El recurso no existe",
  "details": "Agent not found"
}
FieldTypeDescription
codenumberHTTP status code
errorstringDescriptive error message
detailsstring | object | arrayAdditional context. Validation errors identify rejected fields here

Common Error Codes

CodeStatusDescription
400Bad RequestThe request has validation errors or an incorrect format
401UnauthorizedAPI key invalid, expired, or not provided
402Payment RequiredThe workspace reached its credit limit
403ForbiddenYou do not have permission to access this resource
404Not FoundThe requested resource does not exist
409ConflictThe resource changed or is busy, such as a conversation processing another turn
410GoneThe resource is no longer available
422Unprocessable EntityThe request is valid but could not be processed
429Too Many RequestsYou have exceeded the request limit
500Internal Server ErrorInternal server error
502Bad GatewayAn internal service or provider could not complete the request
503Service UnavailableService temporarily unavailable
504Gateway TimeoutAn internal service did not finish before the time limit

400 - Bad Request:

{
  "code": 400,
  "error": "Bad Request - Validation error",
  "details": "El campo 'name' es requerido"
}

401 - Unauthorized:

{
  "code": 401,
  "error": "Unauthorized - Invalid API key",
  "details": "La API key proporcionada no es válida"
}

403 - Forbidden:

{
  "code": 403,
  "error": "Forbidden - Access denied",
  "details": "No tienes permisos para acceder a este workspace"
}

404 - Not Found:

{
  "code": 404,
  "error": "Not Found - Resource not found",
  "details": "Agent not found"
}

429 - Too Many Requests:

{
  "code": 429,
  "error": "Too Many Requests - Rate limit exceeded",
  "details": "Has excedido el límite de 30 peticiones por segundo"
}

Validation Errors

When several fields fail validation, details is an array. Each item identifies the path and failed rule:

{
  "code": 400,
  "error": "Bad Request - The request has validation errors",
  "details": [
    {
      "path": ["attachments"],
      "message": "Array must contain at most 10 element(s)"
    }
  ]
}

In POST /v1/chat, delay and scheduleAt are mutually exclusive. Sending both returns 400 and identifies the fields in details.

Correct every item in details before retrying the request.


Rate Limiting

The API enforces request limits to guarantee a stable service for everyone.

LimitValue
Requests per second30 per API key

Rate Limiting Headers

Responses include headers that help you monitor your usage:

HeaderDescription
X-RateLimit-LimitMaximum number of requests allowed
X-RateLimit-RemainingRemaining requests in the current window
X-RateLimit-ResetTimestamp when the limit resets

Best Practices

To handle errors effectively:

  1. Always check the status code before processing the response
  2. Implement retries with exponential backoff for 502, 503, and 504
  3. Do not retry 4xx errors without correcting the request
  4. Monitor the rate limiting headers to avoid exceeding limits
  5. Log errors with the details field for debugging

Technical Support

If you need help with your integration or have questions:

ChannelContact
Integrations and APIintegraciones@platica.mx
General Supportsoporte@platica.mx