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

# Disconnect a connection

> Disconnects one of the caller's connections, removing it and leaving every other connection in place.

Use this tool when you need to:
- Remove a stored credential the caller no longer wants tasks to run on
- Drop a connection that needs re-authentication and will not be reconnected

Examples:
- DELETE /connections/{connectionID}
- DELETE /connections/6f1c2a9e-3b7d-4c55-9a2e-0d8b1f4e7c21

Hints:
- connectionID is the connection's uuid (the schema answers 422 for a value that is not a uuid, and one that is not a canonical lowercase uuid is 404 connection_not_found); answers 204.
- The connection is disconnected at once: it leaves every list and read, and its name and ChatGPT account are free for a new connection. The tasks and profiles that name it follow shortly after, in the background.
- Claude Code and Codex tasks that run on the connection move to the harness's default as it stands when they move, so their next turn runs there; disconnecting the harness's last connection moves them to Aether inference.
- OpenCode tasks that run on the connection are disconnected until a connection is chosen for each (patchTask with runs_on), and the last OpenCode connection leaves no default. A default's or a profile's fallback that names the connection is left disconnected (its connection_id absent).
- Refused, in this order, with 409 connection_runs_agent while the caller's agent runs on it (move the agent with patchAgent's runs_on first), 409 connection_runs_profiles while agent profiles run on it (the message names them: pin another connection, or nobody, on each with patchAgentProfile's runs_on first), and 409 connection_is_default while it is a harness's default and the caller holds another connection that harness's tasks could run on (the message names them: make one the default with setDefaultConnection first).
- Use reconnectConnection instead to replace its credential and keep its id (createChatgptPlanDeviceAuth with mode reconnect for a ChatGPT plan).
- Any signed-in user, for their own connections; through a platform API key pinned to an org where the caller is a viewer or billing member it is refused with 403 org_role_insufficient, and an agent host's grant with 403 agent_host_route_not_allowed. A connection the caller does not hold is 404 connection_not_found.



## OpenAPI

````yaml api-reference/openapi.json DELETE /connections/{connectionID}
openapi: 3.1.0
info:
  title: Aether API
  version: 0.1.0
servers:
  - url: https://api.runaether.dev
security:
  - bearerAuth: []
paths:
  /connections/{connectionID}:
    delete:
      tags:
        - connections
      summary: Disconnect a connection
      description: >-
        Disconnects one of the caller's connections, removing it and leaving
        every other connection in place.


        Use this tool when you need to:

        - Remove a stored credential the caller no longer wants tasks to run on

        - Drop a connection that needs re-authentication and will not be
        reconnected


        Examples:

        - DELETE /connections/{connectionID}

        - DELETE /connections/6f1c2a9e-3b7d-4c55-9a2e-0d8b1f4e7c21


        Hints:

        - connectionID is the connection's uuid (the schema answers 422 for a
        value that is not a uuid, and one that is not a canonical lowercase uuid
        is 404 connection_not_found); answers 204.

        - The connection is disconnected at once: it leaves every list and read,
        and its name and ChatGPT account are free for a new connection. The
        tasks and profiles that name it follow shortly after, in the background.

        - Claude Code and Codex tasks that run on the connection move to the
        harness's default as it stands when they move, so their next turn runs
        there; disconnecting the harness's last connection moves them to Aether
        inference.

        - OpenCode tasks that run on the connection are disconnected until a
        connection is chosen for each (patchTask with runs_on), and the last
        OpenCode connection leaves no default. A default's or a profile's
        fallback that names the connection is left disconnected (its
        connection_id absent).

        - Refused, in this order, with 409 connection_runs_agent while the
        caller's agent runs on it (move the agent with patchAgent's runs_on
        first), 409 connection_runs_profiles while agent profiles run on it (the
        message names them: pin another connection, or nobody, on each with
        patchAgentProfile's runs_on first), and 409 connection_is_default while
        it is a harness's default and the caller holds another connection that
        harness's tasks could run on (the message names them: make one the
        default with setDefaultConnection first).

        - Use reconnectConnection instead to replace its credential and keep its
        id (createChatgptPlanDeviceAuth with mode reconnect for a ChatGPT plan).

        - Any signed-in user, for their own connections; through a platform API
        key pinned to an org where the caller is a viewer or billing member it
        is refused with 403 org_role_insufficient, and an agent host's grant
        with 403 agent_host_route_not_allowed. A connection the caller does not
        hold is 404 connection_not_found.
      operationId: deleteConnection
      parameters:
        - description: The connection's id.
          in: path
          name: connectionID
          required: true
          schema:
            description: The connection's id.
            format: uuid
            type: string
      responses:
        '204':
          description: No Content
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConnectionsErrorResponse'
          description: Unauthorized
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrgAuthorizationErrorResponse'
          description: Forbidden
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConnectionsErrorResponse'
          description: Not Found
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConnectionsErrorResponse'
          description: Conflict
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConnectionsErrorResponse'
          description: Unprocessable Entity
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConnectionsErrorResponse'
          description: Internal Server Error
components:
  schemas:
    ConnectionsErrorResponse:
      additionalProperties: false
      properties:
        code:
          enum:
            - aether_inference_unavailable
            - aether_inference_unserved
            - agent_credential_unreadable
            - agent_host_account_deleting
            - agent_host_command_not_found
            - agent_host_creation_disabled
            - agent_host_exists
            - agent_host_illegal_transition
            - agent_host_not_allowlisted
            - agent_host_not_found
            - agent_host_other_provider_app
            - agent_host_project_not_eligible
            - agent_host_provisioning_failed
            - agent_host_state_changed
            - agent_host_wake_failed
            - agent_line_unavailable
            - bad_gateway
            - bad_request
            - conflict
            - connection_account_held
            - connection_agent_only
            - connection_harness_mismatch
            - connection_is_default
            - connection_name_taken
            - connection_not_found
            - connection_option_mismatch
            - connection_runs_agent
            - connection_runs_profiles
            - device_auth_not_found
            - fallback_is_own_connection
            - forbidden
            - gateway_timeout
            - gone
            - internal_error
            - line_exists
            - line_not_found
            - line_not_imessage
            - method_not_allowed
            - no_default_connection
            - not_acceptable
            - not_found
            - not_implemented
            - payment_required
            - precondition_failed
            - rate_limited
            - request_canceled
            - request_timeout
            - request_too_large
            - service_unavailable
            - unauthenticated
            - unsupported_media_type
            - validation_failed
            - whatsapp_not_enabled
          minLength: 1
          type: string
        error:
          minLength: 1
          type: string
        errors:
          items:
            $ref: '#/components/schemas/ErrorDetail'
          type: array
      required:
        - error
        - code
      type: object
    OrgAuthorizationErrorResponse:
      additionalProperties: false
      properties:
        code:
          enum:
            - org_membership_required
            - org_role_insufficient
            - org_suspended
            - account_deleting
            - agent_host_route_not_allowed
            - credential_kind_not_admitted
            - grant_scope_insufficient
          type: string
        error:
          minLength: 1
          type: string
      required:
        - error
        - code
      type: object
    ErrorDetail:
      additionalProperties: false
      properties:
        location:
          description: >-
            Where the error occurred, e.g. 'body.items[3].tags' or
            'path.thing-id'
          type: string
        message:
          description: Error message text
          type: string
        value:
          description: The value at the given location
      type: object
  securitySchemes:
    bearerAuth:
      bearerFormat: JWT
      scheme: bearer
      type: http

````

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