NoClickError
The error family.
The server renders every refusal as {"error": {"type", "message", "next_step", ...details}}; type picks the class here (the same names
and HTTP statuses the API uses). Extra keys land in details and read as
attributes: err.connect_url, err.existing_id.
class NoClickError extends ErrorBase class for every NoClick platform error.
| type | string | |
| httpStatus | number | null | |
| nextStep | string | null | |
| details | JsonObject | |
| status | number | null | |
| requestId | string | null |
retryAfterTypeScript only
retryAfter: number | undefinedSeconds the server asked us to wait (from Retry-After), when it did.
errorTypestaticTypeScript only
static errorType: stringError types
| Class | type | HTTP | When |
|---|---|---|---|
| Offer | One way past a refusal for money: a link a person opens to pay, no sign-in needed. | ||
| InvalidRequest | invalid_request | 400 | The request is malformed or a value is out of range; |
| Unauthenticated | unauthenticated | 401 | No key was sent, or the key or session token isn't valid (revoked, expired, or not a platform key). |
| PaymentRequired | payment_required | 402 | Your account can't pay for this: |
| PlanRequired | plan_required | 402 | The account's plan doesn't allow this: plans cap some resources. |
| PriceExceeded | price_exceeded | 402 | It would cost more than the ceiling you set ( |
| ApprovalRequired | approval_required | 402 | Policy wants a person to approve this call first. |
| SpendCapExceeded | spend_cap_exceeded | 402 | A monthly spend cap ( |
| SpendingPaused | spending_paused | 402 | You paused this user's spending ( |
| PermissionDenied | permission_denied | 403 | The key or session lacks the scope, or the user it acts for can't do this (another user's object, a suspended user). |
| PolicyDenied | policy_denied | 403 | Your policy ( |
| NotFound | not_found | 404 | Nothing by that id or name in this account, or owned by the user the call acts for. |
| Conflict | conflict | 409 | It already exists ( |
| NotAvailable | not_available | 409 | Not available here: a feature the account doesn't have yet (phone numbers), or a sandbox that has stopped. |
| ActionRequired | action_required | 409 | Something has to be set up first, such as an agent answering a number before it can place calls. |
| NeedsConnection | needs_connection | 424 | The connection has no account connected yet; send the person |
| CredentialDisconnected | credential_disconnected | 424 | The connection's account was revoked or stopped working; send the person |
| QuotaExceeded | quota_exceeded | 429 | An account limit is reached (live sandboxes, background commands, inboxes); retrying later won't help. |
| RateLimited | rate_limited | 429 | Too many requests, or a send cap reached (emails, inbox replies); |
| UpstreamError | upstream_error | 502 | A service NoClick relays to refused the call or failed. |
| RequestTimeout | request_timeout | 504 | The work outlasted what one request may wait (about 90 seconds). |
| ServerError | server_error | A 5xx the server could not describe as a platform error. | |
| APIConnectionError | connection_error | The API could not be reached, even after retries. | |
| OperationFailed | operation_failed | An operation finished | |
| OperationCanceled | operation_canceled | The operation was canceled before it finished. | |
| Expired | expired | 410 | A request or operation expired before anyone acted on it. |
| OperationTimeout | operation_timeout |
| |
| WebhookSignatureError | webhook_signature_invalid | A webhook delivery's | |
| OperationExpired | Another name for |
Offer
interface OfferOne way past a refusal for money: a link a person opens to pay, no sign-in needed. Hand them url.
| kind | string |
|
| label | string | What it buys, in words: |
| priceUsd | number | |
| url | string | |
| expiresAt | Date | null | When the link stops working; refused again before then, the same link comes back. |
| operation | Operation<JsonObject> | The |
InvalidRequest
class InvalidRequest extends NoClickErrorThe request is malformed or a value is out of range; field names the argument when there is one.
- Inherits from NoClickError.
retryAfterTypeScript only
retryAfter: number | undefinedSeconds the server asked us to wait (from Retry-After), when it did.
errorTypestaticTypeScript only
static errorType: stringUnauthenticated
class Unauthenticated extends NoClickErrorNo key was sent, or the key or session token isn't valid (revoked, expired, or not a platform key).
- Inherits from NoClickError.
retryAfterTypeScript only
retryAfter: number | undefinedSeconds the server asked us to wait (from Retry-After), when it did.
errorTypestaticTypeScript only
static errorType: stringPaymentRequired
class PaymentRequired extends NoClickErrorYour account can't pay for this: balanceUsd is what's left and requiredUsd what the call
needs, in US dollars. offers are links a person opens to add funds or change plan; retry once
one is paid. A model provider's account out of funds (your own key) throws it too, with
details.reason "provider_out_of_funds". A deployed app's paid call names the app in
details.project and details.project_id (invite-only beta).
if (err instanceof PaymentRequired) for (const offer of err.offers) console.log(offer.label, offer.url);| balanceUsd | number | undefined | |
| requiredUsd | number | undefined |
retryAfterTypeScript only
retryAfter: number | undefinedSeconds the server asked us to wait (from Retry-After), when it did.
errorTypestaticTypeScript only
static errorType: stringPlanRequired
class PlanRequired extends NoClickErrorThe account's plan doesn't allow this: plans cap some resources. offers are links to the plans that do.
retryAfterTypeScript only
retryAfter: number | undefinedSeconds the server asked us to wait (from Retry-After), when it did.
errorTypestaticTypeScript only
static errorType: stringPriceExceeded
class PriceExceeded extends NoClickErrorIt would cost more than the ceiling you set (max_monthly_usd on PhoneNumber.buy).
- Inherits from NoClickError.
retryAfterTypeScript only
retryAfter: number | undefinedSeconds the server asked us to wait (from Retry-After), when it did.
errorTypestaticTypeScript only
static errorType: stringApprovalRequired
class ApprovalRequired extends NoClickErrorA policy wants a person to approve this call first. The approval request is
already out; wait on it, then retry with approvalId:
if (err instanceof ApprovalRequired && (await err.operation?.wait()))
await gmail.run("send_email_message", args, { approvalId: err.approvalId });- Inherits from NoClickError.
| approvalId | string | undefined | |
| approveUrl | string | undefined | The page where the approver answers; set only when the approver is the one the call is made for. |
| operation | HumanRequest<boolean> | null | The approval as an operation: |
operationIdTypeScript only
operationId: string | undefinedThe approval's operation id (Operation.fromId(id).wait() resolves to a boolean).
retryAfterTypeScript only
retryAfter: number | undefinedSeconds the server asked us to wait (from Retry-After), when it did.
errorTypestaticTypeScript only
static errorType: stringSpendCapExceeded
class SpendCapExceeded extends NoClickErrorA monthly spend cap (scope: key, user, agent, ...) is used up. A deployed app's paid
call names the app in project and project_id, with scope project when it's
the app's own budget_usd_per_month (invite-only beta).
- Inherits from NoClickError.
| cap | number | undefined | |
| spent | number | undefined | |
| scope | string | undefined | Which cap tripped: |
retryAfterTypeScript only
retryAfter: number | undefinedSeconds the server asked us to wait (from Retry-After), when it did.
errorTypestaticTypeScript only
static errorType: stringSpendingPaused
class SpendingPaused extends NoClickErrorYou paused this user's spending (user.pauseSpending()), so nothing that costs money runs for
them until user.resumeSpending(). message and nextStep are for you; userMessage and
action are what you asked NoClick to tell the user, to show them as they are; since is when
you paused them.
- Inherits from NoClickError.
| userMessage | string | undefined | |
| action | { label: string; url: string } | undefined | |
| since | Date | undefined |
retryAfterTypeScript only
retryAfter: number | undefinedSeconds the server asked us to wait (from Retry-After), when it did.
errorTypestaticTypeScript only
static errorType: stringPermissionDenied
class PermissionDenied extends NoClickErrorThe key or session lacks the scope, or the user it acts for can't do this (another user's object, a suspended user).
- Inherits from NoClickError.
retryAfterTypeScript only
retryAfter: number | undefinedSeconds the server asked us to wait (from Retry-After), when it did.
errorTypestaticTypeScript only
static errorType: stringPolicyDenied
class PolicyDenied extends NoClickErrorYour policy (noclick.Policy) forbids this tool.
- Inherits from NoClickError.
retryAfterTypeScript only
retryAfter: number | undefinedSeconds the server asked us to wait (from Retry-After), when it did.
errorTypestaticTypeScript only
static errorType: stringNotFound
class NotFound extends NoClickErrorNothing by that id or name in this account, or owned by the user the call acts for.
- Inherits from NoClickError.
retryAfterTypeScript only
retryAfter: number | undefinedSeconds the server asked us to wait (from Retry-After), when it did.
errorTypestaticTypeScript only
static errorType: stringConflict
class Conflict extends NoClickErrorIt already exists (existing_id names it), or another call holds it, like a conversation mid-turn.
- Inherits from NoClickError.
| existingId | string | undefined |
retryAfterTypeScript only
retryAfter: number | undefinedSeconds the server asked us to wait (from Retry-After), when it did.
errorTypestaticTypeScript only
static errorType: stringNotAvailable
class NotAvailable extends NoClickErrorNot available here: a feature the account doesn't have yet (phone numbers), or a sandbox that has stopped.
- Inherits from NoClickError.
retryAfterTypeScript only
retryAfter: number | undefinedSeconds the server asked us to wait (from Retry-After), when it did.
errorTypestaticTypeScript only
static errorType: stringActionRequired
class ActionRequired extends NoClickErrorSomething has to be set up first, such as an agent answering a number before it can place calls.
- Inherits from NoClickError.
retryAfterTypeScript only
retryAfter: number | undefinedSeconds the server asked us to wait (from Retry-After), when it did.
errorTypestaticTypeScript only
static errorType: stringNeedsConnection
class NeedsConnection extends NoClickErrorThe connection has no account connected yet; send the person connectUrl.
retryAfterTypeScript only
retryAfter: number | undefinedSeconds the server asked us to wait (from Retry-After), when it did.
errorTypestaticTypeScript only
static errorType: stringCredentialDisconnected
class CredentialDisconnected extends NoClickErrorThe connection's account was revoked or stopped working; send the person connectUrl to reconnect it.
retryAfterTypeScript only
retryAfter: number | undefinedSeconds the server asked us to wait (from Retry-After), when it did.
errorTypestaticTypeScript only
static errorType: stringQuotaExceeded
class QuotaExceeded extends NoClickErrorA spent quota: never retried automatically.
- Inherits from NoClickError.
retryAfterTypeScript only
retryAfter: number | undefinedSeconds the server asked us to wait (from Retry-After), when it did.
errorTypestaticTypeScript only
static errorType: stringRateLimited
class RateLimited extends NoClickErrorToo many requests, or a send cap reached (emails, inbox replies); retry_after says when to try again.
- Inherits from NoClickError.
retryAfterTypeScript only
retryAfter: number | undefinedSeconds the server asked us to wait (from Retry-After), when it did.
errorTypestaticTypeScript only
static errorType: stringUpstreamError
class UpstreamError extends NoClickErrorA service NoClick relays to refused the call or failed. A refusal, such as an integration's service
answering a run with an error, comes in its own words, its HTTP status in details.upstream_status,
and answers 424: it isn't retried, since sending the same call again won't help. A failure (a model's
provider down, a service that didn't answer) answers 502 and is retried; once retries run out,
retrying in a moment usually works.
- Inherits from NoClickError.
retryAfterTypeScript only
retryAfter: number | undefinedSeconds the server asked us to wait (from Retry-After), when it did.
errorTypestaticTypeScript only
static errorType: stringRequestTimeout
class RequestTimeout extends NoClickErrorThe work outlasted what one request may wait (about 90 seconds). Never retried automatically, since
the work may still be going on: an agent's turn goes on and lands in its conversation
(details.operation_id and details.conversation say where).
- Inherits from NoClickError.
retryAfterTypeScript only
retryAfter: number | undefinedSeconds the server asked us to wait (from Retry-After), when it did.
errorTypestaticTypeScript only
static errorType: stringServerError
class ServerError extends NoClickErrorA 5xx the server could not describe as a platform error.
- Inherits from NoClickError.
retryAfterTypeScript only
retryAfter: number | undefinedSeconds the server asked us to wait (from Retry-After), when it did.
errorTypestaticTypeScript only
static errorType: stringAPIConnectionError
class APIConnectionError extends NoClickErrorThe API could not be reached, even after retries.
- Inherits from NoClickError.
retryAfterTypeScript only
retryAfter: number | undefinedSeconds the server asked us to wait (from Retry-After), when it did.
errorTypestaticTypeScript only
static errorType: stringOperationFailed
class OperationFailed extends NoClickErrorAn operation finished failed without a more specific error type.
- Inherits from NoClickError.
retryAfterTypeScript only
retryAfter: number | undefinedSeconds the server asked us to wait (from Retry-After), when it did.
errorTypestaticTypeScript only
static errorType: stringOperationCanceled
class OperationCanceled extends NoClickErrorThe operation was canceled before it finished.
- Inherits from NoClickError.
retryAfterTypeScript only
retryAfter: number | undefinedSeconds the server asked us to wait (from Retry-After), when it did.
errorTypestaticTypeScript only
static errorType: stringExpired
class Expired extends NoClickErrorA request, link or operation expired before anyone acted on it.
- Inherits from NoClickError.
retryAfterTypeScript only
retryAfter: number | undefinedSeconds the server asked us to wait (from Retry-After), when it did.
errorTypestaticTypeScript only
static errorType: stringOperationTimeout
class OperationTimeout extends NoClickErroroperation.wait({ timeoutS }) ran out before the operation finished.
- Inherits from NoClickError.
retryAfterTypeScript only
retryAfter: number | undefinedSeconds the server asked us to wait (from Retry-After), when it did.
errorTypestaticTypeScript only
static errorType: stringWebhookSignatureError
class WebhookSignatureError extends NoClickErrorA webhook delivery's NoClick-Signature doesn't match its body, or its timestamp is too old.
Thrown by Webhook.verify in your receiver; answer it with a 400 and drop the delivery.
- Inherits from NoClickError.
retryAfterTypeScript only
retryAfter: number | undefinedSeconds the server asked us to wait (from Retry-After), when it did.
errorTypestaticTypeScript only
static errorType: string