tastytradeDeveloper Docs
Legacy ↗

API Reference / Accounts and Customers

List Customer Accounts

getCustomersCustomerIdAccounts
get/customers/{customer_id}/accounts

Base URL: https://api.cert.tastyworks.com (Sandbox) · https://api.tastyworks.com (Production)

Returns every account the current customer has access to, each wrapped with the customer's authority level over it. After authenticating, this is typically the first call a client makes to discover account numbers for subsequent requests. Authority levels are `owner` (full privileges), `trade-only` (can trade but not move cash), and `read-only` (GET access only). Pass `me` as the `customer_id`.

Code samples

curl -X GET 'https://api.cert.tastyworks.com/customers/me/accounts' \
  -H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
  -H 'User-Agent: tastytrade-docs-example/1.0'

Parameters

NameInTypeDescription
customer_id*pathstringOnly a value of `me` is allowed. The API does not expose customers' internal identifiers.
e.g. "me"

Responses

200A list of the accounts the customer can access, each with its authority level.application/json

Example response

{
  "data": {
    "items": [
      {
        "account": {
          "account-number": "5WX01234",
          "account-type-name": "string",
          "closed-at": "2024-01-15T14:30:00.000Z",
          "created-at": "2024-01-15T14:30:00.000Z",
          "day-trader-status": "string",
          "ext-account-id": "abc123",
          "ext-crm-id": "abc123",
          "external-accounts": "string",
          "external-fdid": "string",
          "external-id": "abc123",
          "funding-date": "2024-01-15",
          "futures-account-purpose": "string",
          "investment-objective": "string",
          "investment-time-horizon": "string",
          "is-closed": true,
          "is-firm-error": true,
          "is-firm-proprietary": true,
          "is-foreign": "string",
          "is-futures-approved": true,
          "liquidity-needs": "string",
          "margin-or-cash": "string",
          "nickname": "string",
          "opened-at": "2024-01-15T14:30:00.000Z",
          "regulatory-domain": "string",
          "risk-tolerance": "string",
          "submitting-user-id": "abc123",
          "suitable-options-level": "string"
        },
        "authority-level": "owner"
      }
    ]
  },
  "context": "/customers/{customer_id}/accounts",
  "pagination": {
    "per-page": 0,
    "page-offset": 0,
    "item-offset": 0,
    "total-items": 0,
    "total-pages": 0,
    "current-item-count": 0
  }
}

Schema

  • datarequiredobject
    • itemsrequiredarray<object>{2 fields}
  • contextrequiredstring

    example: "/customers/{customer_id}/accounts"

  • paginationobject

    Paging metadata, present on paginated list responses.

    • per-pageinteger
    • page-offsetinteger
    • item-offsetinteger
    • total-itemsinteger
    • total-pagesinteger
    • current-item-countinteger
401Missing or expired access token, or a missing/malformed User-Agent header. Send a valid Authorization: Bearer token and a User-Agent like my-app/1.0.application/json

Example response

{
  "error": {
    "code": "unauthorized",
    "message": "No valid access token was provided; access tokens expire after 15 minutes."
  }
}

Schema

  • errorrequiredobject
    • coderequiredstring

      Machine-readable error code (see the Error reference).

    • messagerequiredstring

      Human-readable explanation.

    • errorsarray<object>{3 fields}

      Present for multi-error / validation failures; one entry per problem.

404No customer matches the supplied customer_id. Pass `me` to resolve the current customer.application/json

Example response

{
  "error": {
    "code": "string",
    "message": "string",
    "errors": [
      {
        "code": "string",
        "message": "string",
        "domain": "string"
      }
    ]
  }
}

Schema

  • errorrequiredobject
    • coderequiredstring

      Machine-readable error code (see the Error reference).

    • messagerequiredstring

      Human-readable explanation.

    • errorsarray<object>{3 fields}

      Present for multi-error / validation failures; one entry per problem.

429Request rate exceeded. Back off exponentially and reduce request rate.application/json

Example response

{
  "error": {
    "code": "string",
    "message": "string",
    "errors": [
      {
        "code": "string",
        "message": "string",
        "domain": "string"
      }
    ]
  }
}

Schema

  • errorrequiredobject
    • coderequiredstring

      Machine-readable error code (see the Error reference).

    • messagerequiredstring

      Human-readable explanation.

    • errorsarray<object>{3 fields}

      Present for multi-error / validation failures; one entry per problem.

Related

Agents: this page is also Markdown (with the embedded OpenAPI definition) — append .md or send Accept: text/markdown. Index at /llms.txt.