Request Validation and Error Responses
Public APIs validate requests before performing supported operations. Read the status and error body together to decide whether to correct the request or retry.

Illustrative backend control flow. Implement the named handlers for your application. Correct rejected inputs or access before retrying; an uncertain run-start response must not trigger a blind second POST.
Before you begin
The endpoint schema and a way to retain request and run identifiers without logging secrets.
Key concepts
Validation
A check against supported structure and constraints. Passing validation does not prove that generated answers meet every quality requirement.
Schema
A definition of fields, types, required values, and supported constraints. Use it to validate the shape of data; it does not establish factual correctness.
HTTP status
The numeric outcome returned for an HTTP request. Read the response body too; accepted work can still be running.
Revision conflict
A response indicating that the resource changed since the version used for an edit. Read current state and reconcile changes before resubmitting.
Reconciliation
Checking the run or destination to determine whether an uncertain operation completed. Do this before retrying a write after a timeout.
Handle an invalid API request
Validate required fields, types, and allowed values before sending.
Inspect non-success responses and preserve their error details.
Correct input or access problems before retrying; reconcile uncertain writes first.
The client reports a useful error and avoids repeating invalid or ambiguous operations.
Behavior and limitations
A 2xx response can mean accepted work rather than completed work. A timeout or server error can occur after work starts. Error formats vary by API version. Do not treat every non-success response as a temporary outage or discard the response body.
Invalid or missing credential
Correct authentication before repeating the request.
Insufficient access
Check key scope, organization, and resource sharing.
Invalid input
Correct the reported field using the operation’s schema.
State or revision conflict
Read current state and decide whether the operation still applies.
Provider rate limit
Follow the provider’s retry guidance and reduce request pressure.
Timeout or server failure after a write
Check the run or destination before submitting the write again.
Related resources
Was this helpful?

