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 code in your error handling, never message. Messages are written for people and can be improved over time, but codes don't change.
  • Write hint to 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 run pyas 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

StatusMeaning
400 Bad RequestA parameter or the body is invalid. The message identifies the field.
401 UnauthorizedThe API key is missing, wrong, revoked or expired.
402 Payment RequiredYour plan needs attention: no subscription, an overdue payment, or the plan's connected account limit is reached.
403 ForbiddenThe key isn't allowed to perform this action, because of its scopes, its mode (live or test) or your plan.
404 Not FoundThe account, calendar or event doesn't exist for your app.
409 ConflictSomeone updated the resource after you read it, the same request is still in progress, or a sandbox limit is reached.
410 GoneThe sync token has expired. Read the calendar again without one.
413 Content Too LargeThe body or the uploaded file is too large.
422 Unprocessable EntityThe 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 RequestsYou've sent too many requests. Wait the number of seconds in Retry-After.
5xxPyas or the provider failed. Retry with backoff.

Every code

Authentication

CodeStatusDescription
AUTH_EXPIRED_KEY401The API key has expired.
AUTH_EXPIRED_SESSION401The session has expired.
AUTH_INSUFFICIENT_SCOPE403The API key or session does not have permission to make this request.
AUTH_INVALID_CONNECT_SESSION401The connect session is missing, invalid, expired or already used.
AUTH_INVALID_KEY401The API key is missing, unknown or revoked.
AUTH_INVALID_SESSION401The session is missing, invalid or revoked.
AUTH_KEY_IN_BROWSER403A live API key was sent from a web page. Live keys only work from a server.
AUTH_ORIGIN_NOT_ALLOWED403The request's origin is not in the app's allowed origins.
AUTH_SANDBOX_MISMATCH403A test key was used with live data, or a live key was used with sandbox data.

Billing

CodeStatusDescription
BILLING_CONNECTION_LIMIT402The plan's connected account limit has been reached.
BILLING_FEATURE_UNAVAILABLE403This feature is not included in the current plan.
BILLING_OVERDUE402The account has an overdue payment.
BILLING_SUBSCRIPTION_REQUIRED402The organization has no active subscription.

Connected accounts

CodeStatusDescription
CONNECTION_CONSENT_FAILED422The provider did not complete the connection.
CONNECTION_NOT_FOUND404No connected account was found for this request.
CONNECTION_PROVIDER_NOT_CONFIGURED422The app is not configured to connect accounts from this provider.
CONNECTION_REVOKED422The user revoked access, or the provider no longer accepts the stored credentials.
CONNECTION_SCOPE_INSUFFICIENT422The connected account did not grant a permission that this operation requires.
CONNECTION_TOKEN_EXPIRED422The provider's access token expired and could not be refreshed.

PyasConnect

CodeStatusDescription
CONNECT_CANCELLEDThe user closed the widget before connecting.
CONNECT_CONSENT_DENIEDThe user did not grant access at the provider.
CONNECT_INVALID_CONFIGThe connect widget is not configured correctly.
CONNECT_NETWORK_ERRORThe browser could not connect to the Pyas API.
CONNECT_POPUP_BLOCKEDThe browser blocked the sign-in window.
CONNECT_PROVIDER_ERRORThe calendar provider could not finish the sign-in.
CONNECT_SESSION_FAILEDYour server could not create a connect session.
CONNECT_TIMEOUTThe sign-in timed out.

Server errors

CodeStatusDescription
INTERNAL_ERROR500Something went wrong on our end.

Google, Microsoft and Zoom

CodeStatusDescription
PROVIDER_PARTIAL_SUCCESS207Some operations succeeded and some failed.
PROVIDER_RATE_LIMITED429The calendar provider is rate limiting requests for this account.
PROVIDER_TIMEOUT504The calendar provider did not respond in time.
PROVIDER_UNAVAILABLE503The calendar provider is not responding normally.
PROVIDER_UNKNOWN_ERROR502The calendar provider returned an error that Pyas could not classify.

Rate limits

CodeStatusDescription
RATE_LIMIT_BURST429Too many requests were sent in a short period.
RATE_LIMIT_EXCEEDED429The request rate exceeds this plan's rate limit.
RATE_MONTHLY_QUOTA_EXCEEDED429This plan's monthly API request limit has been reached.

Resources

CodeStatusDescription
RESOURCE_CONFLICT409The resource was modified or already exists.
RESOURCE_LIMIT_REACHED409The limit for this resource has been reached.
RESOURCE_NOT_FOUND404The calendar or event was not found.
RESOURCE_SYNC_TOKEN_EXPIRED410The sync token has expired.

Validation

CodeStatusDescription
VALIDATION_ENDPOINT_UNREACHABLE422The webhook endpoint did not accept a test delivery.
VALIDATION_IDEMPOTENCY_CONFLICT422This idempotency key was already used with a different request.
VALIDATION_INVALID_BODY400The request body is not valid.
VALIDATION_INVALID_QUERY400A query parameter is not valid.
VALIDATION_INVALID_TIMEZONE400The time zone is not an IANA time zone name.
VALIDATION_PAYLOAD_TOO_LARGE413The request body exceeds the size limit for this endpoint.
VALIDATION_REJECTED_BY_PROVIDER422The calendar provider rejected this input.
VALIDATION_UNSUPPORTED_OPERATION422This provider does not support this operation.