Every response from the Struct API is wrapped in a standard envelope. This structure is consistent across all endpoints, regardless of the data being returned.Documentation Index
Fetch the complete documentation index at: https://docs.struct.to/llms.txt
Use this file to discover all available pages before exploring further.
Envelope Structure
The
pagination field is optional and only appears on list endpoints.Fields
success
A boolean indicating whether the request was processed successfully.
data
The response payload. Its type depends on the endpoint; it can be a single object or an array.
message
A human-readable status message. Typically null on success. On errors, this contains a description of what went wrong.
info
Metadata about the request execution. Present on most successful responses.
| Field | Type | Description |
|---|---|---|
version | string | API version that served the request |
time_taken_ms | number | Total wall-clock time in milliseconds |
credits_consumed | number | Number of API credits consumed by the request |
compute_time_ms | number | Server-side compute time in milliseconds |
pagination
Included on list endpoints that support cursor-based pagination.
| Field | Type | Description |
|---|---|---|
has_more | boolean | Whether additional pages of results exist |
pagination_key | string | number | null | Pass this value as a query parameter to fetch the next page |
Pagination
List endpoints return paginated results. To iterate through all pages, pass thepagination_key from the previous response as a query parameter in your next request.
Error Responses
When a request fails, the envelope still applies. Thesuccess field will be false and message will describe the error.