API reference
Response headers
The headers that the Check API sets, and the responses that carry each one.
Request ID, version, and region
| Header | Description |
|---|---|
X-Request-Id | The ID of the request. The Check API writes req_ followed by 26 letters and digits. The ID is equal to data.requestId of a 200 and to traceId of an error. |
X-Api-Version | The API version from the path, such as v1. |
X-Region | The region that answered. JP for https://api.jp.flowmask.ai. |
The Check API always sets its own X-Request-Id. It ignores an X-Request-Id header in the request. Log the ID with each request. Support asks for it when you report a problem.
Most responses have these three headers. These responses have no X-Api-Version and no X-Region.
- A
404 api_version_not_supportedresponse, because the version in the path does not exist. - A
404 not_foundresponse for a path outside/api/<version>/, such as/check. - A
400or a503from the network in front of the Check API. That network answers400 validation_failedwith the field errortext_too_longfor a body over 8 MiB. It answers503 service_unavailablewhen the Check API does not answer, or answers too late. ItsX-Request-Iddoes not start withreq_. - A
403that is not JSON, or an HTML502,503, or504, from the network in front of the Check API. Such a response can also have noX-Request-Id. See Answers outside the envelope.
Headers on a 200
| Header | Description |
|---|---|
Cache-Control | no-store. Do not cache the answer. |
X-Ignored-Fields | The top-level fields of the body that the Check API ignored, such as lang, userId. Present only when the body had such a field. See Unknown fields. |
X-RateLimit-Remaining | The requests left in the current minute. |
X-RateLimit-Reset | The seconds until the count of the minute starts again. |
X-Quota-Tokens-Remaining | The input tokens left this month. |
X-Quota-Reset | The time when the monthly quota starts again. |
Rate limits and quota describes the last four headers.
Headers by response
Every response in this table but the last row has X-Request-Id. The table lists the other headers of each response.
| Response | Headers |
|---|---|
200 | X-Api-Version, X-Region, Cache-Control, X-RateLimit-Remaining, X-RateLimit-Reset, X-Quota-Tokens-Remaining, and X-Quota-Reset. Also X-Ignored-Fields when the Check API ignored a field. |
429 rate_limited | X-Api-Version, X-Region, Retry-After, X-RateLimit-Remaining, X-RateLimit-Reset, X-Quota-Tokens-Remaining, and X-Quota-Reset |
429 monthly_quota_exceeded | X-Api-Version, X-Region, Retry-After, X-RateLimit-Remaining, X-Quota-Tokens-Remaining, and X-Quota-Reset |
400, 401, 500, 503, and 404 not_found for a path under /api/v1/ | X-Api-Version and X-Region |
404 api_version_not_supported | None |
404 not_found for a path outside /api/<version>/ | None |
400 or 503 from the network in front of the Check API | None |
403 that is not JSON, or HTML 502, 503, or 504 | None. X-Request-Id can be absent too. |