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

# List accounts

> Returns the accounts in the project.



## OpenAPI

````yaml get /v2/accounts
openapi: 3.1.0
info:
  title: StackOne
  description: The documentation for the StackOne API
  version: 1.0.0
  contact: {}
servers:
  - url: https://api.stackone.com
security: []
tags:
  - name: Accounts
    description: View and manage linked accounts.
  - name: Connector Profiles
    description: View and manage connector profiles for the project.
  - name: Connectors
    description: Retrieve metadata for connectors.
  - name: Webhooks
    description: Configure and manage webhooks.
  - name: Data Sync
    description: View data-sync configs, schedules, and runs.
paths:
  /v2/accounts:
    get:
      tags:
        - Accounts
      summary: List accounts
      description: Returns the accounts in the project.
      operationId: list_accounts
      parameters:
        - name: expand
          required: false
          in: query
          description: >-
            A comma-separated list of additional fields to expand. Supported
            values: `connector` (the connector display data),
            `connector_profile` (the connector profile id and label),
            `last_request`, and `actions` (the connector action catalog, each
            flagged with whether it is enabled for this account's connector
            profile). These are omitted (returned as `null`) unless requested,
            as resolving them is more expensive.
          schema:
            nullable: true
            example: connector,connector_profile,last_request,actions
            type: string
        - name: page
          required: false
          in: query
          description: >-
            The 1-based page number to fetch. Omit both `page` and `page_size`
            to fetch all accounts at once.
          schema:
            minimum: 1
            nullable: true
            type: number
        - name: page_size
          required: false
          in: query
          description: The number of accounts to return per page.
          schema:
            minimum: 1
            maximum: 100
            nullable: true
            default: 25
            type: number
        - name: account_id
          required: false
          in: query
          description: >-
            Filter to accounts with any of these account ids. Comma-separated or
            repeated (e.g. `?account_id=a,b`).
          schema:
            nullable: true
            type: array
            items:
              type: string
        - name: connector_key
          required: false
          in: query
          description: >-
            Filter to accounts with any of these connector keys (comma-separated
            or repeated).
          schema:
            nullable: true
            type: array
            items:
              type: string
        - name: status
          required: false
          in: query
          description: >-
            Filter to accounts with any of these statuses (comma-separated or
            repeated).
          x-speakeasy-unknown-values: allow
          schema:
            type: array
            items:
              $ref: '#/components/schemas/StatusType'
        - name: owner_id
          required: false
          in: query
          description: >-
            Filter to accounts with any of these owner ids (comma-separated or
            repeated).
          schema:
            nullable: true
            type: array
            items:
              type: string
        - name: capability
          required: false
          in: query
          description: >-
            Filter to accounts you can perform this action on, rather than
            merely read. Single value — "must be able to do X" is one
            requirement, not a choice. Has no effect on requests without
            per-user account context (e.g. API keys).
          x-speakeasy-unknown-values: allow
          schema:
            $ref: '#/components/schemas/AccountCapability'
      responses:
        '200':
          description: The accounts were retrieved.
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/PaginatedAccountsResponse'
                  - type: array
                    items:
                      $ref: '#/components/schemas/AccountResource'
        '400':
          description: Invalid request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestResponse'
        '401':
          description: Unauthorized access.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedResponse'
        '403':
          description: Forbidden.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ForbiddenResponse'
        '404':
          description: Resource not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundResponse'
        '408':
          description: The request has timed out.
          headers:
            Retry-After:
              description: A time in seconds after which the request can be retried.
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RequestTimedOutResponse'
        '409':
          description: Conflict with current state.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConflictResponse'
        '422':
          description: Validation error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnprocessableEntityResponse'
        '429':
          description: Too many requests.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TooManyRequestsResponse'
        '500':
          description: Server error while executing the request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalServerErrorResponse'
        '501':
          description: This functionality is not implemented.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotImplementedResponse'
        '502':
          description: Bad gateway error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadGatewayResponse'
      security:
        - basic: []
components:
  schemas:
    StatusType:
      type: string
      enum:
        - active
        - inactive
        - suspended
        - archived
        - expired
        - error
        - unmapped_value
        - null
    AccountCapability:
      type: string
      enum:
        - read
        - execute-actions
        - update
        - delete
        - relink
        - manage-members
        - unmapped_value
        - null
    PaginatedAccountsResponse:
      type: object
      properties:
        page:
          type: number
          description: The current page number.
        page_size:
          type: number
          description: The number of accounts per page.
        total:
          type: number
          description: The total number of accounts matching the request.
        data:
          description: The accounts on this page.
          type: array
          items:
            $ref: '#/components/schemas/AccountResource'
      required:
        - page
        - page_size
        - total
        - data
    AccountResource:
      type: object
      properties:
        id:
          type: string
          description: The unique identifier of the account.
        connector_key:
          type: string
          description: >-
            The connector/provider key this account connects to (e.g.
            `workday`). Always present; the full connector object requires
            `?expand=connector`.
        connector:
          description: >-
            The connector this account uses. Only present when requested via
            `?expand=connector`.
          nullable: true
          allOf:
            - $ref: '#/components/schemas/ConnectorResource'
        connector_profile_id:
          type: string
          description: >-
            The identifier of the connector profile this account is linked to.
            Only present when requested via `?expand=connector_profile`.
          nullable: true
        connector_profile_label:
          type: string
          description: >-
            The connector profile label: the connector profile name, appended
            with the authentication label (e.g. `Acme | Production`). Only
            present when requested via `?expand=connector_profile`.
          nullable: true
        last_request:
          type: string
          format: date-time
          description: >-
            When the account last made a request. Only present when requested
            via `?expand=last_request`.
          nullable: true
        actions:
          description: >-
            The account's connector action catalog, each flagged with whether it
            is enabled for the connector profile. Only present when requested
            via `?expand=actions`.
          nullable: true
          type: array
          items:
            $ref: '#/components/schemas/AccountActionResource'
        status:
          type: string
          enum:
            - active
            - inactive
            - suspended
            - archived
            - expired
            - error
          description: The current status of the account.
          x-speakeasy-unknown-values: allow
        status_reasons:
          description: Reasons explaining the current status.
          type: array
          items:
            $ref: '#/components/schemas/StatusReasonResource'
        owner_id:
          type: string
          description: The account owner's identifier in the provider's system.
        name:
          type: string
          description: The account owner's name in the provider's system.
        owner_username:
          type: string
          description: The end-user identifier within the owner, if any.
          nullable: true
        type:
          type: string
          description: The account type (e.g. `production` or `test`).
        created_at:
          type: string
          format: date-time
          description: When the account was created.
        updated_at:
          type: string
          format: date-time
          description: When the account was last updated.
      required:
        - id
        - connector_key
        - status
        - status_reasons
        - owner_id
        - name
        - type
        - created_at
        - updated_at
    BadRequestResponse:
      type: object
      properties:
        statusCode:
          type: number
          description: HTTP status code
          example: 400
        message:
          type: string
          description: Error message
          example: Bad Request
        timestamp:
          type: string
          description: Timestamp when the error occurred
          example: '2023-05-30T00:00:00.000Z'
          format: date-time
        data:
          description: Error details
          nullable: true
          allOf:
            - $ref: '#/components/schemas/UnifiedError'
        provider_errors:
          description: List of provider-specific errors
          nullable: true
          type: array
          items:
            $ref: '#/components/schemas/ProviderError'
      required:
        - statusCode
        - message
        - timestamp
    UnauthorizedResponse:
      type: object
      properties:
        statusCode:
          type: number
          description: HTTP status code
          example: 401
        message:
          type: string
          description: Error message
          example: Unauthorized
        timestamp:
          type: string
          description: Timestamp when the error occurred
          example: '2023-05-30T00:00:00.000Z'
          format: date-time
      required:
        - statusCode
        - message
        - timestamp
    ForbiddenResponse:
      type: object
      properties:
        statusCode:
          type: number
          description: HTTP status code
          example: 403
        message:
          type: string
          description: Error message
          example: Forbidden resource
        timestamp:
          type: string
          description: Timestamp when the error occurred
          example: '2023-05-30T00:00:00.000Z'
          format: date-time
      required:
        - statusCode
        - message
        - timestamp
    NotFoundResponse:
      type: object
      properties:
        statusCode:
          type: number
          description: HTTP status code
          example: 404
        message:
          type: string
          description: Error message
          example: Not Found
        timestamp:
          type: string
          description: Timestamp when the error occurred
          example: '2023-05-30T00:00:00.000Z'
          format: date-time
      required:
        - statusCode
        - message
        - timestamp
    RequestTimedOutResponse:
      type: object
      properties:
        statusCode:
          type: number
          description: HTTP status code
          example: 408
        message:
          type: string
          description: Error message
          example: Request timed out
        timestamp:
          type: string
          description: Timestamp when the error occurred
          example: '2023-05-30T00:00:00.000Z'
          format: date-time
      required:
        - statusCode
        - message
        - timestamp
    ConflictResponse:
      type: object
      properties:
        statusCode:
          type: number
          description: HTTP status code
          example: 409
        message:
          type: string
          description: Error message
          example: Conflict
        timestamp:
          type: string
          description: Timestamp when the error occurred
          example: '2023-05-30T00:00:00.000Z'
          format: date-time
      required:
        - statusCode
        - message
        - timestamp
    UnprocessableEntityResponse:
      type: object
      properties:
        statusCode:
          type: number
          description: HTTP status code
          example: 422
        message:
          type: string
          description: Error message
          example: Unprocessable Entity
        timestamp:
          type: string
          description: Timestamp when the error occurred
          example: '2023-05-30T00:00:00.000Z'
          format: date-time
      required:
        - statusCode
        - message
        - timestamp
    TooManyRequestsResponse:
      type: object
      properties:
        statusCode:
          type: number
          description: HTTP status code
          example: 429
        message:
          type: string
          description: Error message
          example: Too many requests
        timestamp:
          type: string
          description: Timestamp when the error occurred
          example: '2023-05-30T00:00:00.000Z'
          format: date-time
      required:
        - statusCode
        - message
        - timestamp
    InternalServerErrorResponse:
      type: object
      properties:
        statusCode:
          type: number
          description: HTTP status code
          example: 500
        message:
          type: string
          description: Error message
          example: Internal server error
        timestamp:
          type: string
          description: Timestamp when the error occurred
          example: '2023-05-30T00:00:00.000Z'
          format: date-time
      required:
        - statusCode
        - message
        - timestamp
    NotImplementedResponse:
      type: object
      properties:
        statusCode:
          type: number
          description: HTTP status code
          example: 501
        message:
          type: string
          description: Error message
          example: Not Implemented
        timestamp:
          type: string
          description: Timestamp when the error occurred
          example: '2023-05-30T00:00:00.000Z'
          format: date-time
      required:
        - statusCode
        - message
        - timestamp
    BadGatewayResponse:
      type: object
      properties:
        statusCode:
          type: number
          description: HTTP status code
          example: 502
        message:
          type: string
          description: Error message
          example: Bad Gateway
        timestamp:
          type: string
          description: Timestamp when the error occurred
          example: '2023-05-30T00:00:00.000Z'
          format: date-time
      required:
        - statusCode
        - message
        - timestamp
    ConnectorResource:
      type: object
      properties:
        key:
          type: string
          description: The connector key (e.g. `workday`).
        name:
          type: string
          description: The human-readable connector name (e.g. `SAP SuccessFactors`).
          nullable: true
        logo_url:
          type: string
          description: The URL of the connector's logo.
        categories:
          description: The categories the connector belongs to (e.g. `["hris"]`).
          type: array
          items:
            type: string
        version:
          type: string
          description: The resolved connector version.
          nullable: true
        owner:
          type: string
          description: The owner of the connector.
      required:
        - key
        - logo_url
        - categories
        - owner
    AccountActionResource:
      type: object
      properties:
        id:
          type: string
          description: The action identifier (e.g. `list_employees`).
        label:
          type: string
          description: The human-readable action label (e.g. `List Employees`).
        description:
          type: string
          description: A short description of what the action does.
        tags:
          description: The tags categorising the action.
          type: array
          items:
            type: string
        enabled:
          type: boolean
          description: >-
            Whether the action is enabled for this account's connector profile.
            Disabled actions are still listed but cannot be used.
        sync_available:
          type: boolean
          description: >-
            Whether a synced variant of this action is available for the
            account's connector profile.
      required:
        - id
        - label
        - description
        - tags
        - enabled
        - sync_available
    StatusReasonResource:
      type: object
      properties:
        code:
          description: A machine-readable status code.
          x-speakeasy-unknown-values: allow
          nullable: true
          allOf:
            - $ref: '#/components/schemas/StatusCode'
        description:
          type: string
          description: A human-readable explanation of the status.
          nullable: true
        timestamp:
          type: string
          format: date-time
          description: When this reason was recorded.
      required:
        - timestamp
    UnifiedError:
      type: object
      properties:
        statusCode:
          type: number
          description: HTTP status code
          example: 400
          nullable: true
        message:
          type: string
          description: Error message
          example: Bad Request
          nullable: true
        headers:
          type: object
          description: Response headers
          example:
            content-type: application/json
            x-request-id: 5678c28b211dace4e0a0f9171e6b88c5
          nullable: true
    ProviderError:
      type: object
      properties:
        status:
          type: number
          description: HTTP status code of the provider error
          example: 400
          nullable: true
        url:
          type: string
          description: URL that caused the error
          example: https://api.provider.com/v1/resource
          nullable: true
        raw:
          type: object
          description: Raw error response from the provider
          example:
            message: Invalid input parameters
          nullable: true
        headers:
          type: object
          description: Response headers
          example:
            content-type: application/json
            x-request-id: 5678c28b211dace4e0a0f9171e6b88c5
          nullable: true
    StatusCode:
      type: string
      enum:
        - ACCOUNT_TOKEN_REFRESH_FAILURE
        - ACCOUNT_DELETED
        - ACCOUNT_DISABLED
        - INTEGRATION_INACTIVE
        - MONITORING_ERROR
        - CONNECTOR_UNAVAILABLE
        - unmapped_value
        - null
      description: A machine-readable status code.
  securitySchemes:
    basic:
      type: http
      scheme: basic

````