> 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.

# 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,
  SnaptradeAuth,
} from "snaptrade-typescript-sdk";

const snaptrade = new Snaptrade({
  auth: SnaptradeAuth.commercialApiKey({
    consumerKey: "CONSUMER_KEY",
    clientId: "CLIENT_ID",
  }),
});

const response =
  await snaptrade.connections.syncBrokerageAuthorizationTransactions(
    {
      authorizationId:
        "87b24961-b51e-4db8-9226-f198f6518a89",
      userId: "USER_ID",
      userSecret: "USER_SECRET",
    },
  );
console.log(response.data);

```

### Python

```python

from pprint import pprint
from snaptrade_client import SnapTrade, SnapTradeAuth

snaptrade = SnapTrade(
    auth=SnapTradeAuth.commercial_api_key(
        consumer_key="CONSUMER_KEY",
        client_id="CLIENT_ID",
    )
)

response = snaptrade.connections.sync_brokerage_authorization_transactions(
    authorization_id="87b24961-b51e-4db8-9226-f198f6518a89",
    user_id="USER_ID",
    user_secret="USER_SECRET"
)
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
      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
      security:
        - PartnerSignature: []
          PartnerClientId: []
          PartnerTimestamp: []
          userId: []
          userSecret: []
        - PersonalSignature: []
          PersonalClientId: []
          PersonalTimestamp: []

```