requests module handles request validation and access control.
Methods
isValidRequest
Validate an incoming request with payment token.| Name | Type | Description |
|---|---|---|
accessToken | string | Bearer token from Authorization header |
requestBody | object | The request body being validated |
getRequests
Get request history for an agent.getRequestById
Get details of a specific request.Validation Response Codes
reason | Meaning |
|---|---|
undefined | Valid request |
TOKEN_EXPIRED | Access token has expired |
INSUFFICIENT_BALANCE | Not enough credits |
PLAN_EXPIRED | Time-based plan has expired |
INVALID_TOKEN | Token is malformed or invalid |
UNAUTHORIZED | Token doesn’t grant access to this agent |