Errors & retries
Interpret REST status codes, handle asynchronous operations, and retry requests without creating duplicate resources.
Check the HTTP status before reading a successful result. Most API errors are JSON with an error string:
{ "error": "not authenticated" }Some refusals also carry a machine-readable code and a fix that says how to get past it:
{ "error": "this account already has 10 free services, the most it can have — choose a paid plan, or delete a free service", "code": "free_service_cap", "fix": "Retry with a paid planKey from list_plans, or delete one of the account's free services first."}code |
Meaning |
|---|---|
email_unverified |
The account owner has not confirmed their email address, so no new service can be added yet. |
free_service_cap |
The account already has as many free services as it may have. |
free_hours_used |
The account’s free hours for this month are used up, so a free service can’t be created, started or deployed. Moving it to a paid plan still works. |
free_replicas |
A free service runs a single instance. |
free_tier_off |
The free plan is not offered. |
free_platform_account |
This account cannot use the free plan. |
host_flagged |
The hostname is on Google’s list of unsafe sites (phishing or malware), so it can’t be attached. |
free_database_unavailable |
Free databases aren’t available yet. Name a paid plan. |
Branch on code when it is present.
Error messages are intended to help a human diagnose the request. Branch your client logic on the status and operation context rather than matching an exact English error string. Proxies, network failures, and some specialized endpoints may return a different body.
Common statuses
Section titled “Common statuses”| Status | Meaning | Next step |
|---|---|---|
200 |
Request completed | Read the response for the operation |
201 |
Resource created | Store the returned identifier and inspect its state |
202 |
Work accepted or queued | Follow the deployment or job until it completes |
400 |
Invalid input or unsupported configuration | Check parameter names, types, and allowed values |
401 |
Authentication missing or invalid | Check the Bearer header and whether the key was revoked |
402 |
Billing blocks the action, where enforced | Resolve the account billing requirement in the dashboard |
403 |
Access or key scope does not permit the action | Check permissions, project, and environment restrictions |
404 |
Resource missing or not visible to you | Check the ID and scope; inaccessible resources may be hidden |
409 |
Current resource state conflicts with the request | Inspect the service or active deployment before trying again |
413 |
Payload exceeds the accepted limit | Reduce the archive or use the supported upload flow |
429 |
Too many requests | Respect Retry-After when present and slow down |
5xx |
Server or upstream failure | Preserve context, back off, and inspect state before repeating a write |
Not every operation uses every status. The operation pages describe successful responses and endpoint-specific errors. Authentication and authorization middleware can return additional errors before the handler runs.
Retry reads conservatively
Section titled “Retry reads conservatively”For a transient read failure, use bounded exponential backoff with jitter. Honor a Retry-After header when it is returned. Do not retry authentication or validation failures unchanged.
There is no single published numeric rate limit for all authenticated operations. Limits can depend on the endpoint and platform configuration. Avoid tight polling loops; request incremental logs and reuse results where possible.
Inspect before repeating a write
Section titled “Inspect before repeating a write”The documented API does not promise an Idempotency-Key contract. A timeout after creation or deployment may mean the server accepted the request but the response did not reach you.
Before retrying:
- Read the project or service and look for the resource or deployment.
- If the first operation succeeded, continue using its identifier.
- If its outcome remains unclear, inspect logs or contact support rather than repeatedly creating resources.
Creation requests can start billed resources: a create without a planKey uses the free plan only while the account can have one, and otherwise the cheapest paid plan. The response’s planNote says which. Restore, credential rotation, and SQL requests can affect data or running clients; retrying them requires particular care.
Treat a queued operation as a workflow
Section titled “Treat a queued operation as a workflow”Deployment acceptance is the beginning of the workflow. Read deployment history, inspect build logs, then check the running service. A 202 response alone is not evidence that the application is healthy.
For help, include the operation, timestamp, HTTP status, and relevant resource ID. Remove API keys, database credentials, and secret environment values before sharing a request or log.