Using API v1? See what changes in v2, or the v1 docs
Errors
Every error response has the same format. It includes a stable code that your code can check, a message that describes what went wrong, a hint that explains how to fix it, a link to the error code's page, and the traceId that identifies the request in your logs.
{
"success": false,
"error": {
"code": "CONNECTION_NOT_FOUND",
"message": "No connected account was found for this request.",
"hint": "The user may not have connected this provider yet. Start a connection with PyasConnect.",
"status": 404,
"traceId": "trc_5f2a9c1e7b3d4a6f8e0c2b1d",
"docs": "https://developer.pyas.io/errors/CONNECTION_NOT_FOUND"
}
}
- Check
codein your error handling, nevermessage. Messages are written for people and can be improved over time, but codes don't change. - Write
hintto your logs, where developers can read it. - Keep the
traceId. Include it when you contact support so that we can help you faster. To see what the request did, how the provider responded and why the request failed, call the endpoint below or runpyas logs get trc_...:
GET /v2/logs/{traceId}
The error codes are also available as data, for use in your tooling and your coding agent. This request returns every code with its status, causes, fix, whether retrying helps, and related codes:
GET https://api.pyas.io/v2/errors
Status codes
| Status | Meaning |
|---|---|
400 Bad Request | A parameter or the body is invalid. The message identifies the field. |
401 Unauthorized | The API key is missing, wrong, revoked or expired. |
402 Payment Required | Your plan needs attention: no subscription, an overdue payment, or the plan's connected account limit is reached. |
403 Forbidden | The key isn't allowed to perform this action, because of its scopes, its mode (live or test) or your plan. |
404 Not Found | The account, calendar or event doesn't exist for your app. |
409 Conflict | Someone updated the resource after you read it, the same request is still in progress, or a sandbox limit is reached. |
410 Gone | The sync token has expired. Read the calendar again without one. |
413 Content Too Large | The body or the uploaded file is too large. |
422 Unprocessable Entity | The request is valid but can't be completed: the provider doesn't support it or rejected it, the account must be reconnected, or an Idempotency-Key was reused for a different request. |
429 Too Many Requests | You've sent too many requests. Wait the number of seconds in Retry-After. |
5xx | Pyas or the provider failed. Retry with backoff. |
Every code
Authentication
| Code | Status | Description |
|---|---|---|
AUTH_EXPIRED_KEY | 401 | The API key has expired. |
AUTH_EXPIRED_SESSION | 401 | The session has expired. |
AUTH_INSUFFICIENT_SCOPE | 403 | The API key or session does not have permission to make this request. |
AUTH_INVALID_CONNECT_SESSION | 401 | The connect session is missing, invalid, expired or already used. |
AUTH_INVALID_KEY | 401 | The API key is missing, unknown or revoked. |
AUTH_INVALID_SESSION | 401 | The session is missing, invalid or revoked. |
AUTH_KEY_IN_BROWSER | 403 | A live API key was sent from a web page. Live keys only work from a server. |
AUTH_ORIGIN_NOT_ALLOWED | 403 | The request's origin is not in the app's allowed origins. |
AUTH_SANDBOX_MISMATCH | 403 | A test key was used with live data, or a live key was used with sandbox data. |
Billing
| Code | Status | Description |
|---|---|---|
BILLING_CONNECTION_LIMIT | 402 | The plan's connected account limit has been reached. |
BILLING_FEATURE_UNAVAILABLE | 403 | This feature is not included in the current plan. |
BILLING_OVERDUE | 402 | The account has an overdue payment. |
BILLING_SUBSCRIPTION_REQUIRED | 402 | The organization has no active subscription. |
Connected accounts
| Code | Status | Description |
|---|---|---|
CONNECTION_CONSENT_FAILED | 422 | The provider did not complete the connection. |
CONNECTION_NOT_FOUND | 404 | No connected account was found for this request. |
CONNECTION_PROVIDER_NOT_CONFIGURED | 422 | The app is not configured to connect accounts from this provider. |
CONNECTION_REVOKED | 422 | The user revoked access, or the provider no longer accepts the stored credentials. |
CONNECTION_SCOPE_INSUFFICIENT | 422 | The connected account did not grant a permission that this operation requires. |
CONNECTION_TOKEN_EXPIRED | 422 | The provider's access token expired and could not be refreshed. |
PyasConnect
| Code | Status | Description |
|---|---|---|
CONNECT_CANCELLED | The user closed the widget before connecting. | |
CONNECT_CONSENT_DENIED | The user did not grant access at the provider. | |
CONNECT_INVALID_CONFIG | The connect widget is not configured correctly. | |
CONNECT_NETWORK_ERROR | The browser could not connect to the Pyas API. | |
CONNECT_POPUP_BLOCKED | The browser blocked the sign-in window. | |
CONNECT_PROVIDER_ERROR | The calendar provider could not finish the sign-in. | |
CONNECT_SESSION_FAILED | Your server could not create a connect session. | |
CONNECT_TIMEOUT | The sign-in timed out. |
Server errors
| Code | Status | Description |
|---|---|---|
INTERNAL_ERROR | 500 | Something went wrong on our end. |
Google, Microsoft and Zoom
| Code | Status | Description |
|---|---|---|
PROVIDER_PARTIAL_SUCCESS | 207 | Some operations succeeded and some failed. |
PROVIDER_RATE_LIMITED | 429 | The calendar provider is rate limiting requests for this account. |
PROVIDER_TIMEOUT | 504 | The calendar provider did not respond in time. |
PROVIDER_UNAVAILABLE | 503 | The calendar provider is not responding normally. |
PROVIDER_UNKNOWN_ERROR | 502 | The calendar provider returned an error that Pyas could not classify. |
Rate limits
| Code | Status | Description |
|---|---|---|
RATE_LIMIT_BURST | 429 | Too many requests were sent in a short period. |
RATE_LIMIT_EXCEEDED | 429 | The request rate exceeds this plan's rate limit. |
RATE_MONTHLY_QUOTA_EXCEEDED | 429 | This plan's monthly API request limit has been reached. |
Resources
| Code | Status | Description |
|---|---|---|
RESOURCE_CONFLICT | 409 | The resource was modified or already exists. |
RESOURCE_LIMIT_REACHED | 409 | The limit for this resource has been reached. |
RESOURCE_NOT_FOUND | 404 | The calendar or event was not found. |
RESOURCE_SYNC_TOKEN_EXPIRED | 410 | The sync token has expired. |
Validation
| Code | Status | Description |
|---|---|---|
VALIDATION_ENDPOINT_UNREACHABLE | 422 | The webhook endpoint did not accept a test delivery. |
VALIDATION_IDEMPOTENCY_CONFLICT | 422 | This idempotency key was already used with a different request. |
VALIDATION_INVALID_BODY | 400 | The request body is not valid. |
VALIDATION_INVALID_QUERY | 400 | A query parameter is not valid. |
VALIDATION_INVALID_TIMEZONE | 400 | The time zone is not an IANA time zone name. |
VALIDATION_PAYLOAD_TOO_LARGE | 413 | The request body exceeds the size limit for this endpoint. |
VALIDATION_REJECTED_BY_PROVIDER | 422 | The calendar provider rejected this input. |
VALIDATION_UNSUPPORTED_OPERATION | 422 | This provider does not support this operation. |