Skip to main content

Reference

Complete technical reference for constants, enumerations, error codes, and configuration options.


Overview​

This section provides comprehensive reference documentation for:

  • Response Structure - Standard API response format
  • HTTP Status Codes - Status codes and meanings
  • Pagination - Paginated response format
  • Rate Limiting - Rate limits and headers
  • Error Codes - Complete error code reference
  • Language Codes - Supported language codes for STT/TTS

Response Structure​

All WIIL API responses follow a standardized structure:

interface ApiResponse<T> {
success: boolean; // true if request succeeded, false otherwise
data: T | null; // Response data (null on error)
error: string | null; // Error message (null on success)
timestamp: string; // ISO 8601 timestamp
}

Success Response​

{
"success": true,
"data": { ... },
"error": null,
"timestamp": "2024-01-15T10:30:00Z"
}

Error Response​

{
"success": false,
"data": null,
"error": "Detailed error message describing what went wrong",
"timestamp": "2024-01-15T10:30:00Z"
}

HTTP Status Codes​

Success Codes (2xx)​

CodeStatusDescription
200OKRequest succeeded
201CreatedResource created successfully
204No ContentRequest succeeded with no response body

Client Error Codes (4xx)​

CodeStatusDescription
400Bad RequestInvalid request data or malformed JSON
401UnauthorizedMissing or invalid API key
403ForbiddenInsufficient permissions
404Not FoundResource not found
409ConflictResource conflict or duplicate
422Unprocessable EntityValidation failed
429Too Many RequestsRate limit exceeded

Server Error Codes (5xx)​

CodeStatusDescription
500Internal Server ErrorServer error
502Bad GatewayGateway error
503Service UnavailableService temporarily unavailable
504Gateway TimeoutRequest timeout

Pagination​

List endpoints return paginated responses:

interface PaginatedResponse<T> {
success: true;
data: {
items: T[]; // Array of items for current page
total: number; // Total number of items
page: number; // Current page (1-indexed)
pageSize: number; // Items per page
totalPages: number; // Total pages
hasNext: boolean; // Has next page
hasPrevious: boolean; // Has previous page
};
}

Defaults​

ParameterDefaultMaximum
pageSize20100
page1-

Query Parameters​

ParameterDescription
pagePage number (1-indexed)
pageSizeItems per page (max 100)

Rate Limiting​

Rate Limit Tiers​

TierRequests/minRequests/hourRequests/day
Standard1006,000100,000
Professional30018,000300,000
EnterpriseCustomCustomCustom

Response Headers​

HeaderDescription
X-RateLimit-LimitMaximum requests allowed
X-RateLimit-RemainingRequests remaining
X-RateLimit-ResetUnix timestamp when limit resets
Retry-AfterSeconds to wait (on 429)

429 Response​

{
"success": false,
"data": null,
"error": "Too Many Requests - Rate limit exceeded",
"timestamp": "2024-01-15T10:30:00Z"
}

Error Codes​

Authentication Errors​

CodeStatusDescriptionSolution
invalid_api_key401API key is invalid or expiredCheck API key validity
missing_api_key401API key not providedInclude X-WIIL-API-Key header
unauthorized403Insufficient permissionsVerify account permissions

Validation Errors​

CodeStatusDescriptionSolution
validation_error400Request validation failedCheck request schema
missing_required_field400Required field missingInclude all required fields
invalid_field_value400Invalid value for fieldCheck enumeration values
invalid_format400Field format incorrectVerify format (email, phone, etc.)

Resource Errors​

CodeStatusDescriptionSolution
resource_not_found404Resource doesn't existVerify resource ID
conversation_not_found404Conversation not foundCheck conversation ID
deployment_not_found404Deployment config not foundVerify deployment config ID

Rate Limiting Errors​

CodeStatusDescriptionSolution
rate_limit_exceeded429Too many requestsImplement exponential backoff
quota_exceeded429Monthly quota exceededUpgrade plan or wait for reset

Headers:

X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 0
X-RateLimit-Reset: 1640000000
Retry-After: 60

Server Errors​

CodeStatusDescriptionSolution
internal_error500Internal server errorRetry request; contact support if persists
service_unavailable503Service temporarily unavailableRetry with exponential backoff

Language Codes​

Supported Languages for STT/TTS​

LanguageCodeNative Speakers
English (US)en-US300M
English (UK)en-GB60M
Spanish (Spain)es-ES40M
Spanish (Mexico)es-MX130M
French (France)fr-FR75M
Germande-DE130M
Italianit-IT85M
Portuguese (Brazil)pt-BR215M
Portuguese (Portugal)pt-PT10M
Mandarin Chinesezh-CN1.1B
Japaneseja-JP125M
Koreanko-KR80M
Arabic (Saudi)ar-SA40M
Hindihi-IN600M
Russianru-RU260M
Dutchnl-NL25M
Polishpl-PL45M
Turkishtr-TR80M
Swedishsv-SE10M
Norwegianno-NO5M