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

# Sync transactions for a connection

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

Trigger a transactions sync for all accounts under this connection. Updates will be queued asynchronously. Transactions are not updated intra-day, but calling this endpoint can ensure that the previous day's transactions have been synced. For more information on sync behaviour, see: https://docs.snaptrade.com/docs/syncing


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

## 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.syncBrokerageAuthorizationTransactions(
    {
      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.sync_brokerage_authorization_transactions(
    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}/transactions/sync:
    post:
      tags:
        - Connections
      summary: Sync transactions for a connection
      description: >
        Trigger a transactions sync for all accounts under this connection.
        Updates will be queued asynchronously. Transactions are not updated
        intra-day, but calling this endpoint can ensure that the previous day's
        transactions have been synced. For more information on sync behaviour,
        see: https://docs.snaptrade.com/docs/syncing
      operationId: Connections_syncBrokerageAuthorizationTransactions
      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 transaction syncs have been scheduled.
                type: object
                properties:
                  detail:
                    description: Transactions sync confirmation details
                    type: string
                    example: >-
                      Connection 0b3ebefb-ed47-43df-cd8f-729a4420b5cf scheduled
                      for transactions sync
        '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: Cannot perform action because connection is disabled
                type: object
                properties:
                  detail:
                    example: >-
                      Unable to sync with brokerage account because the
                      connection is disabled.
                  code:
                    example: 3003

```