> ## Documentation Index
> Fetch the complete documentation index at: https://docs.goyappr.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Cancel an authorization attempt

> Requires tool-connections:manage. Closes an authorization nobody finished, which frees the slot this API key holds against the ten-open limit. The connection record itself stays and nothing is revoked at the provider - an attempt cancelled before consent never produced a grant. Already cancelled, completed, failed and expired attempts answer 200 unchanged, so a retry is safe.

Requires `tool-connections:manage`. Use the exact `attempt.id` that connection creation or replacement returned — not the connection id.

```bash theme={null}
curl -X POST https://api.goyappr.com/tool-connections/attempts/ATTEMPT_ID/cancel \
  -H "Authorization: Bearer YOUR_API_KEY"
```

Cancel the attempt when nobody is going to open its handoff. This is what frees the slot it holds against the ten-open limit that answers `429` `CONNECTION_RATE_LIMIT` on the next `POST /tool-connections`; an attempt you leave alone frees its own slot when it expires, ten minutes after it was created.

Already cancelled, completed, failed and expired attempts answer `200` with the attempt unchanged, so a retry is safe and so is cancelling an attempt you are no longer sure about.

## What it does not do

| | |
| - | - |
| The connection record | Stays, still waiting for an authorization that will never come. Cancelling does not delete it. [`POST /tool-connections/cleanup`](https://docs.goyappr.com/api-reference/tool-connections/cleanup) clears every attempt nobody finished in one request; for this one record, [`DELETE /tool-connections/{id}`](https://docs.goyappr.com/api-reference/tool-connections/disconnect) moves it to `disconnected` and [`POST /tool-connections/{id}/remove`](https://docs.goyappr.com/api-reference/tool-connections/remove) then takes it off the list. Left alone, it leaves the list by itself a day after it started. |
| The provider grant | Untouched. An attempt that was cancelled before consent never produced one; if consent did complete, use `DELETE /tool-connections/{id}` and then revoke Yappr's access in the provider's own account settings. |
| Other people's attempts | Untouched. This cancels the one attempt you name, and only if it belongs to your workspace. |


## OpenAPI

````yaml POST /tool-connections/attempts/{id}/cancel
openapi: 3.1.0
info:
  title: Yappr API
  description: >
    Create and manage AI voice agents, purchase phone numbers, configure tools,
    and initiate calls — all via REST.
  version: 1.0.0
  contact:
    url: https://goyappr.com
servers:
  - url: https://api.goyappr.com
    description: Production
security:
  - apiKey: []
paths:
  /tool-connections/attempts/{id}/cancel:
    post:
      tags:
        - Connected accounts
      summary: Cancel an authorization attempt
      description: >-
        Requires tool-connections:manage. Closes an authorization nobody
        finished, which frees the slot this API key holds against the ten-open
        limit. The connection record itself stays and nothing is revoked at the
        provider - an attempt cancelled before consent never produced a grant.
        Already cancelled, completed, failed and expired attempts answer 200
        unchanged, so a retry is safe.
      operationId: cancelToolConnectionAuthAttempt
      parameters:
        - name: id
          in: path
          required: true
          description: >-
            The attempt id from POST /tool-connections or POST
            /tool-connections/{id}/reconnect, not the connection id.
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: The attempt, in its settled state.
          content:
            application/json:
              schema:
                type: object
                properties:
                  attempt:
                    $ref: '#/components/schemas/ToolConnectionAuthAttempt'
        '401':
          description: >-
            Missing, unknown or expired API key. A key without the management
            scope is 403 INSUFFICIENT_SCOPE.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Attempt is absent or belongs to another workspace.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '503':
          description: Connection storage unavailable.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    ToolConnectionAuthAttempt:
      type: object
      required:
        - id
        - connection_id
        - status
        - expires_at
        - next_poll_at
      properties:
        id:
          type: string
          format: uuid
        connection_id:
          type: string
          format: uuid
        status:
          type: string
          enum:
            - pending_human
            - claimed
            - creating_link
            - awaiting_consent
            - verifying
            - completed
            - failed
            - expired
            - cancelled
            - reconciliation_required
        expires_at:
          type: string
          format: date-time
        next_poll_at:
          type: string
          format: date-time
        error_code:
          type:
            - string
            - 'null'
          description: >-
            Why the attempt ended, when the status alone does not say:
            AUTH_SUPERSEDED (cancelled - a reconnect replaced it before anyone
            opened its link), AUTH_EXPIRED (expired), MEMBERSHIP_REMOVED or
            AUTHORITY_REMOVED (cancelled - the member signing in lost access),
            AUTH_ACCOUNT_MISMATCH or AUTH_CONFIG_CHANGED (failed),
            AUTH_LINK_UNKNOWN or AUTH_REDEMPTION_UNKNOWN (the sign-in did not
            complete). null while open, when finished, and when a person
            cancelled it.
        return_path:
          type: string
          enum:
            - /en/tools
            - /he/tools
    Error:
      type: object
      required:
        - error
        - code
      description: >
        Every error response - the secret-key API and the browser data plane
        alike - carries a

        human-readable `error` and a stable machine `code`, and a refusal that
        names what is

        wrong with the request carries `issues[]` too. Branch on `code`, never
        on the `error`

        text. A refusal that names nothing more specific carries the code its
        status means:

        `BAD_REQUEST` (400), `UNAUTHORIZED` (401, the browser data plane; the
        secret-key API

        answers `MISSING_KEY`, `INVALID_KEY` or `EXPIRED_KEY`), `BILLING_ERROR`
        (402),

        `FORBIDDEN` (403), `NOT_FOUND` (404), `METHOD_NOT_ALLOWED` (405),
        `CONFLICT` (409),

        `GONE` (410), `PAYLOAD_TOO_LARGE` (413), `UNSUPPORTED_MEDIA_TYPE` (415),

        `UNPROCESSABLE_REQUEST` (422), `RATE_LIMIT` (429), `INTERNAL_ERROR`
        (500),

        `UPSTREAM_ERROR` (502), `SERVICE_UNAVAILABLE` (503), `UPSTREAM_TIMEOUT`
        (504). Some

        refusals add members of their own beside these (a call request's
        `status`, a workflow's

        `current_version`); the operation says which.
      properties:
        error:
          type: string
          description: The refusal, in one sentence for a person. Its wording may change.
        code:
          type: string
          description: The stable code to branch on.
        issues:
          type: array
          description: >
            Each thing at fault, on a 400 or 422 that names them: every query
            parameter or body field, not just the first. `path` is the
            parameter's name or the field's location.
          items:
            type: object
            required:
              - code
              - message
            properties:
              code:
                type: string
                description: >-
                  query_param_unknown, query_param_repeated, query_param_blank,
                  query_param_invalid, field_unknown, field_required,
                  field_invalid, or the route's own word.
              path:
                type: string
              message:
                type: string
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: >-
        Your Yappr API key (e.g. `ypr_live_...`). Generate one in the dashboard
        under **Settings → API Keys**. No key is `401 MISSING_KEY`; a key that
        is not one of ours, or is revoked, is `401 INVALID_KEY`; an expired one
        is `401 EXPIRED_KEY`. A valid key without the scope an operation needs
        is `403 INSUFFICIENT_SCOPE` on every operation, and the message names
        the scope. Every response, a 401 included, carries X-RateLimit-Limit,
        X-RateLimit-Remaining and X-RateLimit-Reset: the budget is 60 requests a
        minute per API key. Every 429, whatever its code, carries Retry-After
        (whole seconds, never zero): the per-key budget's `RATE_LIMIT` asks for
        what is left of the minute, a route's daily cap (`RATE_LIMITED`) for the
        time until that cap resets. All four headers are listed in
        Access-Control-Expose-Headers, so a browser can read them. A path the
        API does not serve (an unknown sub-path, an id left empty) is `404
        ROUTE_NOT_FOUND`, and a method a served path does not take is `405
        METHOD_NOT_ALLOWED` with an `Allow` header; both are answered before any
        scope check, and nothing is read or changed. A trailing slash is ignored
        where it cannot be an id left empty (`POST /calls/` is `POST /calls`)
        and refused where it can (`GET /calls/`). A doubled slash inside a path
        is merged into one before the request reaches the API (`GET //calls` is
        `GET /calls`).

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.