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

# List connected accounts

> List the app accounts an agent can use on your messages.



## OpenAPI

````yaml api-reference/openapi.yaml GET /v1/connected-accounts
openapi: 3.0.3
info:
  title: QX API
  version: '1.0'
  description: >-
    Run what you build in QX from your own code. Message agents, execute flows
    and grids, and read their results.
servers:
  - url: https://api.qxlabs.com
security:
  - bearerAuth: []
tags:
  - name: Agents
    description: >-
      Message agents through OpenAI's Responses API, so OpenAI's SDKs work with
      a QX API key.
  - name: Flows
    description: Execute flows and follow their executions.
  - name: Grids
    description: Execute grids, follow their executions and read their rows.
paths:
  /v1/connected-accounts:
    get:
      tags:
        - Agents
      summary: List connected accounts
      description: >
        Lists the app accounts you can use in QX: your own and the ones shared
        with you.

        To use an account other than an app's default on a message, send it in
        `connected_accounts`.
      operationId: listConnectedAccounts
      responses:
        '200':
          description: Your connected accounts, each app's default first
          content:
            application/json:
              schema:
                type: object
                properties:
                  object:
                    type: string
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          description: The account's ID, for `connected_accounts`
                        app:
                          type: string
                          description: The app, for `connected_accounts`
                        label:
                          type: string
                        connection:
                          type: string
                          nullable: true
                          description: The connection's name in QX
                        default:
                          type: boolean
                          description: >-
                            Whether agents use this account for the app when you
                            don't choose one
              example:
                object: list
                data:
                  - id: ca_41f0c2d8
                    app: gmail
                    label: Gmail
                    connection: Work Gmail
                    default: true
                  - id: ca_9b2e7a13
                    app: gmail
                    label: Gmail
                    connection: Home Gmail
                    default: false
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentsError'
      x-codeSamples:
        - lang: bash
          label: cURL
          source: |
            curl https://api.qxlabs.com/v1/connected-accounts \
              -H "Authorization: Bearer <YOUR_QX_API_KEY>"
        - lang: python
          label: Python
          source: >
            from openai import OpenAI


            client = OpenAI(base_url="https://api.qxlabs.com/v1",
            api_key="<YOUR_QX_API_KEY>")


            # A QX endpoint, so it's read with the client's own get

            accounts = client.get("/connected-accounts", cast_to=object)["data"]

            for account in accounts:
                print(account["app"], account["connection"], account["id"])
        - lang: typescript
          label: TypeScript
          source: >
            import OpenAI from "openai";


            const client = new OpenAI({ baseURL: "https://api.qxlabs.com/v1",
            apiKey: "<YOUR_QX_API_KEY>" });


            // A QX endpoint, so it's read with the client's own get

            type Account = { id: string; app: string; label: string; connection:
            string | null; default: boolean };

            const { data: accounts } = await client.get<{ data: Account[]
            }>("/connected-accounts");

            for (const account of accounts) {
              console.log(account.app, account.connection, account.id);
            }
components:
  schemas:
    AgentsError:
      type: object
      description: OpenAI's error shape
      properties:
        error:
          type: object
          properties:
            message:
              type: string
            type:
              type: string
            param:
              type: string
              nullable: true
            code:
              type: string
              nullable: true
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Your QX API key. The `X-API-Key` header works too

````

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