> For AI agents: the complete documentation index is available at [llms.txt](https://docs.snaptrade.com/llms.txt), and the full documentation text is available at [llms-full.txt](https://docs.snaptrade.com/llms-full.txt). Markdown versions of documentation pages are available by appending .md to the URL path.

# Force disable connection

POST https://api.snaptrade.com/authorizations/{authorizationId}/disable

Manually force the specified connection to become disabled. This should only be used for testing a reconnect flow, and never used on production connections.
Will trigger a disconnect as if it happened naturally, and send a [`CONNECTION_BROKEN` webhook](/docs/webhooks#webhooks-connection_broken) for the connection.

This endpoint is available on test keys. If you would like it enabled on production keys as well, please contact support as it is disabled by default.


Reference: https://docs.snaptrade.com/reference/Connections/Connections_disableBrokerageAuthorization

## Code Examples

### TypeScript

```typescript

import { Snaptrade } from "snaptrade-typescript-sdk";

const snaptrade = new Snaptrade({
  clientId: "PARTNER_CLIENT_ID",
  consumerKey: "CONSUMER_KEY",
});

const response =
  await snaptrade.connections.disableBrokerageAuthorization(
    {
      authorizationId:
        "87b24961-b51e-4db8-9226-f198f6518a89",
      userId: "snaptrade-user-123",
      userSecret:
        "adf2aa34-8219-40f7-a6b3-60156985cc61",
    },
  );
console.log(response.data);

```

### Python

```python

from pprint import pprint
from snaptrade_client import SnapTrade

snaptrade = SnapTrade(
    client_id="PARTNER_CLIENT_ID",
    consumer_key="CONSUMER_KEY"
)

response = snaptrade.connections.disable_brokerage_authorization(
    authorization_id="87b24961-b51e-4db8-9226-f198f6518a89",
    user_id="snaptrade-user-123",
    user_secret="adf2aa34-8219-40f7-a6b3-60156985cc61"
)
pprint(response.body)

```

## OpenAPI Specification

```yaml

openapi: 3.0.0
info:
  description: Connect brokerage accounts to your app for live positions and trading
  version: 1.0.0
  title: SnapTrade
  termsOfService: N/A
  contact:
    email: api@snaptrade.com
  x-konfig-ignore:
    potential-incorrect-type: true
  x-readme:
    explorer-enabled: false
paths:
  /authorizations/{authorizationId}/disable:
    post:
      tags:
        - Connections
      summary: Force disable connection
      description: >
        Manually force the specified connection to become disabled. This should
        only be used for testing a reconnect flow, and never used on production
        connections.

        Will trigger a disconnect as if it happened naturally, and send a
        [`CONNECTION_BROKEN` webhook](/docs/webhooks#webhooks-connection_broken)
        for the connection.


        This endpoint is available on test keys. If you would like it enabled on
        production keys as well, please contact support as it is disabled by
        default.
      operationId: Connections_disableBrokerageAuthorization
      parameters:
        - in: path
          name: authorizationId
          required: true
          schema:
            description: >-
              Unique identifier for the connection (brokerage_authorization_id).
              This is the UUID used to reference the connection in SnapTrade.
            type: string
            format: uuid
            example: 87b24961-b51e-4db8-9226-f198f6518a89
        - in: query
          required: true
          name: userId
          schema:
            description: >-
              SnapTrade User ID. This is chosen by the API partner and can be
              any string that is a) unique to the user, and b) immutable for the
              user. It is recommended to NOT use email addresses for this
              property because they are usually not immutable.
            type: string
            example: snaptrade-user-123
        - in: query
          required: true
          name: userSecret
          schema:
            description: >-
              SnapTrade User Secret. This is a randomly generated string and
              should be stored securely. If compromised, please rotate it via
              the [rotate user secret
              endpoint](/reference/Authentication/Authentication_resetSnapTradeUserSecret).
            type: string
            example: adf2aa34-8219-40f7-a6b3-60156985cc61
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                description: Confirmation that the connection has been disabled.
                type: object
                properties:
                  detail:
                    description: Connection disabled confirmation
                    type: string
                    example: >-
                      Connection 0b3ebefb-ed47-43df-cd8f-729a4420b5cf has been
                      disabled
        '401':
          description: Unauthorized, invalid credentials for this resource
          content:
            application/json:
              schema:
                description: Example for failed request response
                type: object
                properties:
                  default_detail:
                    example: Unable to verify signature sent
                  default_code:
                    example: 1076
        '402':
          description: >-
            Unable to sync with brokerage account because the connection is
            disabled.
          content:
            application/json:
              schema:
                description: This connection is already disabled.
                type: object
                properties:
                  detail:
                    example: This connection is already disabled.
                  code:
                    example: 3011
        '403':
          description: Customer or user does not have access to this feature
          content:
            application/json:
              schema:
                description: Example for failed request response
                type: object
                properties:
                  detail:
                    example: >-
                      Feature is not enabled for this customer or this
                      connection
                  default_code:
                    example: 1141
        '404':
          description: The requested resource does not exist.
          content:
            application/json:
              schema:
                description: Example for failed request response
                type: object
                properties:
                  default_detail:
                    example: The requested resource does not exist.
                  default_code:
                    example: 1011

```