Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Shashank-H/gaiter-gaurd/llms.txt
Use this file to discover all available pages before exploring further.
Error Response Format
All error responses from the GaiterGuard API follow a consistent JSON structure:Content-Type header is always set to application/json for error responses.
Common HTTP Status Codes
| Status Code | Meaning | Common Causes |
|---|---|---|
400 | Bad Request | Invalid request format, missing required fields, validation errors |
401 | Unauthorized | Missing or invalid authentication credentials |
403 | Forbidden | Valid credentials but insufficient permissions, SSRF prevention |
404 | Not Found | Resource doesn’t exist or agent doesn’t have access |
409 | Conflict | Duplicate idempotency key currently processing |
410 | Gone | Approval expired or service no longer exists |
413 | Payload Too Large | Response exceeds 10MB size limit |
428 | Precondition Required | Request requires human approval due to risk assessment |
500 | Internal Server Error | Unexpected server error |
502 | Bad Gateway | Failed to connect to target service |
504 | Gateway Timeout | Request to target service exceeded 30 second timeout |
Error Types
Authentication Errors
Returned when authentication fails or credentials are invalid. Missing Authorization HeaderValidation Errors
Returned when request data fails schema validation. Invalid JSONValidation errors include the field path and specific validation message in the format:
field.path: Error messageProxy Errors
Errors that occur during request proxying to target services. SSRF Prevention - Hostname MismatchIdempotency Errors
Errors related to idempotency key processing. Duplicate Request ProcessingRisk Assessment Errors
Returned when a request is flagged as risky and requires human approval. Approval Required428 Precondition Required
Use the
action_id to poll for approval status at the provided status_url endpoint, then execute the request using POST /proxy/execute/:actionId once approved.Approval Queue Errors
Action Not FoundError Handling Best Practices
Retry Logic
- 401 Unauthorized: Do not retry. Check your authentication credentials.
- 403 Forbidden: Do not retry. Request is blocked by security policy.
- 409 Conflict: Wait and poll for idempotency key completion, then use cached response.
- 428 Precondition Required: Poll for approval status, then execute with
/proxy/execute/:actionId. - 429 Rate Limited: Implement exponential backoff (not currently returned but reserved).
- 500/502/504: Retry with exponential backoff up to 3 attempts.
Handling Idempotency Conflicts
When you receive a 409 error:- The original request is still processing
- Wait 1-2 seconds
- Retry the request with the same idempotency key
- The gateway will return the cached response once available
Handling Approval Required (428)
When you receive a 428 error:- Extract the
action_idfrom the response - Poll
GET /status/:actionIduntil status isAPPROVED - Execute the approved request with
POST /proxy/execute/:actionId - If status becomes
EXPIRED, resubmit the original request viaPOST /proxy
Error Response Headers
All error responses include:Implementation Details
Error responses are generated using theerrorResponse() utility function from utils/responses.ts:26: