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

> ## Agent Instructions
> Cognite Data Fusion (CDF) is an industrial DataOps platform. Prefer English docs unless the user asks for another locale.
> Follow /_llms/ index links recursively until you reach page URLs ending in .md. Fetch those Markdown twins instead of HTML.
> For REST APIs, default to calendar version 20230101 (stable). Use 20230101-beta or 20230101-alpha only if the user is on a preview API. Cite paths under /api-reference/concepts/<version>/ and the Cdf-Version header. Prefer the Python SDK (cognite-sdk) unless the user is in JavaScript/TypeScript.
> Start here by task: platform overview /cdf/index.md; data modeling /cdf/dm/index.md; data integration /cdf/integration/index.md; access /cdf/access/index.md; CDF Toolkit /cdf/deploy/cdf_toolkit/index.md; REST quickstart /dev/quickstart.md; Python SDK https://cognite-sdk-python.readthedocs-hosted.com/en/stable/; Atlas AI /cdf/atlas_ai/concepts/index.md; Flows apps /cdf/flows/index.md; MCP and IDE setup /dev/guides/ide_ai_integration.md.
> For implementation work, also load /skill.md.

# Retrieve sequences

> 

> **Required capabilities:** `sequencesAcl:READ`

Retrieves one or more sequences by ID or external ID. The response returns the sequences in the same order as in the request.



## OpenAPI

````yaml https://storage.googleapis.com/cognitedata-api-docs/dist/20230101-alpha.json post /sequences/byids
openapi: 3.1.0
info:
  title: Cognite API
  description: >-
    Reference documentation for the Cognite Data Fusion (CDF) API. See the [API
    introduction](/api-reference/concepts/20230101/api-description) and [API
    changelog](/api-reference/changelog).
  version: v1
  contact:
    name: Cognite Support
    url: https://support.cognite.com
    email: support@cognite.com
servers:
  - url: https://{cluster}.cognitedata.com/api/v1/projects/{project}
    description: The URL for the CDF cluster to connect to
    variables:
      cluster:
        enum:
          - api
          - az-tyo-gp-001
          - az-eastus-1
          - az-power-no-northeurope
          - westeurope-1
          - asia-northeast1-1
          - gc-dsm-gp-001
        default: api
        description: The CDF cluster to connect to
      project:
        default: publicdata
        description: The CDF project name.
security:
  - oidc-token:
      - https://{cluster}.cognitedata.com/.default
  - oauth2-client-credentials:
      - https://{cluster}.cognitedata.com/.default
  - oauth2-open-industrial-data:
      - https://api.cognitedata.com/.default
  - oauth2-auth-code:
      - https://{cluster}.cognitedata.com/.default
tags:
  - name: Token
  - name: Advanced joins
  - name: Assets
  - name: Data Modeling
    x-uri-format-fragments:
      - resource: Space
        uri-fragment: models/{space}
      - resource: Data Model
        uri-fragment: models/{space}/datamodel/{externalId}/{version}
      - resource: View
        uri-fragment: models/{space}/view/{externalId}/{version}
      - resource: Container
        uri-fragment: models/{space}/container/{externalId}
      - resource: Node
        uri-fragment: models/{space}/node/{externalId}
      - resource: Edge
        uri-fragment: models/{space}/edge/{externalId}
  - name: Streams
  - name: Records
  - name: Events
  - name: Files
  - name: Functions
  - name: Function calls
  - name: Function schedules
  - name: Function Apps
  - name: Function App Calls
  - name: Function App MCP
  - name: 3D
  - name: Time series
  - name: Data point subscriptions
  - name: Synthetic Time Series
  - name: Raw
    x-uri-format-fragments:
      - resource: Database
        uri-fragment: raw/{dbName}
      - resource: Table
        uri-fragment: raw/{dbName}/{tableName}
  - name: Groups
  - name: Projects
  - name: Security categories
  - name: Data sets
  - name: Limits
  - name: Metering
  - name: Sequences
  - name: Labels
  - name: Relationships
  - name: Entity matching
  - name: Entity matching pipelines
  - name: Diagram parsing
  - name: Vision
  - name: Agents
  - name: Skills
  - name: Project Configuration
  - name: Models
  - name: Chat Completions
  - name: Cognite AI
  - name: Documents
  - name: Document preview
    x-displayName: Preview
  - name: Geospatial
  - name: SessionsInternal
  - name: Sessions
  - name: Extraction Pipelines
  - name: Extraction Pipelines Runs
  - name: Extraction Pipelines Config
  - name: Extractors
  - name: Transformations
  - name: Transformation Jobs
  - name: Transformation Schedules
  - name: Transformation Notifications
  - name: Query
  - name: Schema
  - name: Transformation External Data Sources
  - name: Annotations
  - name: User profiles
  - name: Workflows
  - name: Workflow versions
  - name: Workflow executions
  - name: Tasks
  - name: Workflow triggers
  - name: Sources
  - name: Jobs
  - name: Destinations
  - name: Mappings
  - name: Previews
  - name: Postgres Gateway Users
  - name: Postgres Gateway Tables
  - name: SAP Instances
  - name: SAP Endpoints
  - name: Schema Mappings
  - name: Writeback Requests
  - name: Simulators
  - name: Simulator Integrations
  - name: Simulator Routines
  - name: Simulator Models
  - name: Simulation Runs
  - name: Simulator Logs
  - name: Units
  - name: Unit Systems
  - name: Application Data Storage
  - name: Location Filters
  - name: User Preferences
  - name: User History
  - name: Search Config
  - name: Organizations
  - name: Applications
  - name: Integrations
  - name: Integration Tasks
  - name: Integration Actions
  - name: Integration Configuration
  - name: Integration Errors
  - name: Principals
  - name: Signals
  - name: Data products
paths:
  /sequences/byids:
    post:
      tags:
        - Sequences
      summary: Retrieve sequences
      description: >-


        > **Required capabilities:** `sequencesAcl:READ`


        Retrieves one or more sequences by ID or external ID. The response
        returns the sequences in the same order as in the request.
      operationId: getSequenceById
      requestBody:
        description: Ids of the sequences
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DataResourceIdsWithIgnoreUnknownIds'
      responses:
        '200':
          description: Response with the requested sequences.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DataGetSequence'
      deprecated: true
      x-code-samples:
        - lang: JavaScript
          label: JavaScript SDK
          source: >-
            const [sequence1, sequence2] = await client.sequences.retrieve([{id:
            123}, {externalId: 'abc'}]);
        - lang: Python
          label: Python SDK
          source: >
            res = client.sequences.retrieve(id=1)


            res = client.sequences.retrieve()

            res = client.sequences.retrieve_multiple(ids=[1, 2, 3])


            res = client.sequences.retrieve_multiple(external_ids=["abc",
            "def"])
        - lang: Java
          label: Java SDK
          source: >+
            List<SequenceMetadata> retrievedByExternalIds =
            client.sequences().retrieve("10");//by varargs of String 

            List<Item> listItemsExternalIds =
            List.of(Item.newBuilder().setExternalId("10").build()); 

            List<SequenceMetadata> retrievedSequencesExternalIds =
            client.sequences().retrieve(listItemsExternalIds);//by list of
            items 


            List<SequenceMetadata> retrievedByInternalIds =
            client.sequences().retrieve(10, 20);//by varargs of Long 

            List<Item> listItemsInternalIds =
            List.of(Item.newBuilder().setId(10).build()); 

            List<SequenceMetadata> retrievedSequencesInternalIds =
            client.sequences().retrieve(listItemsInternalIds); 

components:
  schemas:
    DataResourceIdsWithIgnoreUnknownIds:
      type: object
      allOf:
        - type: object
          required:
            - items
          properties:
            items:
              type: array
              items:
                oneOf:
                  - type: object
                    title: Select by Id
                    properties:
                      id:
                        $ref: '#/components/schemas/CogniteInternalId'
                  - type: object
                    title: Select by ExternalId
                    properties:
                      externalId:
                        $ref: '#/components/schemas/CogniteExternalId'
              minItems: 1
              maxItems: 1000
        - $ref: '#/components/schemas/IgnoreUnknownIdsField'
    DataGetSequence:
      type: object
      required:
        - items
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/GetSequenceDTO'
    CogniteInternalId:
      description: A server-generated ID for the object.
      type: integer
      minimum: 1
      maximum: 9007199254740991
      format: int64
    CogniteExternalId:
      description: >-
        The external ID provided by the client. Must be unique for the resource
        type.
      type: string
      maxLength: 255
      example: my.known.id
    IgnoreUnknownIdsField:
      type: object
      properties:
        ignoreUnknownIds:
          description: Ignore IDs and external IDs that are not found
          type: boolean
          default: false
    GetSequenceDTO:
      type: object
      required:
        - id
        - columns
        - createdTime
        - lastUpdatedTime
      description: Information about the sequence stored in the database.
      properties:
        id:
          type: integer
          description: Unique Cognite-provided identifier for the sequence.
          example: 1
          format: int64
          readOnly: true
        name:
          type: string
          example: Any relevant name
          description: Name of the sequence.
        description:
          type: string
          example: Optional description
          description: Description of the sequence.
        assetId:
          type: integer
          example: 1221123111
          description: Optional asset this sequence is associated with.
          format: int64
        externalId:
          $ref: '#/components/schemas/CogniteExternalId'
        metadata:
          type: object
          example:
            extracted-by: cognite
          description: >-
            Custom, application specific metadata. String key -> String value.
            Maximum length of key is 128 bytes, up to 256 key-value pairs, up to
            a total size of 10000 bytes across all keys and values.
          additionalProperties:
            type: string
        columns:
          type: array
          description: List of column definitions.
          items:
            $ref: '#/components/schemas/GetSequenceColumnDTO'
        createdTime:
          type: integer
          example: 100000000000
          description: >-
            Time when this sequence was created in CDF in milliseconds since Jan
            1, 1970.
          format: int64
          readOnly: true
        lastUpdatedTime:
          type: integer
          example: 100000000000
          description: >-
            The last time this sequence was updated in CDF, in milliseconds
            since Jan 1, 1970.
          format: int64
          readOnly: true
        dataSetId:
          type: integer
          format: int64
          description: Data set this sequence belongs to.
          example: 2718281828459
    GetSequenceColumnDTO:
      type: object
      required:
        - id
        - valueType
        - createdTime
        - lastUpdatedTime
      description: Information about a column stored in the database.
      properties:
        name:
          type: string
          example: depth
          description: Human readable name of the column.
        externalId:
          type: string
          example: DPS1
          description: User provided column identifier (unique for a given sequence).
        description:
          type: string
          example: Optional description
          description: Description of the column.
        valueType:
          $ref: '#/components/schemas/SequenceValueTypeEnum'
        metadata:
          type: object
          example:
            extracted-by: cognite
          description: Custom, application specific metadata. String key -> String value.
          additionalProperties:
            type: string
        createdTime:
          type: integer
          example: 100000000000
          description: >-
            Time when this asset was created in CDF in milliseconds since Jan 1,
            1970.
          format: int64
          readOnly: true
        lastUpdatedTime:
          type: integer
          example: 100000000000
          description: >-
            The last time this asset was updated in CDF, in milliseconds since
            Jan 1, 1970.
          format: int64
          readOnly: true
    SequenceValueTypeEnum:
      type: string
      description: >-
        What type the datapoints in a column will have. DOUBLE is restricted to
        the range [-1E100, 1E100]
      default: DOUBLE
      enum:
        - STRING
        - DOUBLE
        - LONG
  securitySchemes:
    oidc-token:
      type: http
      scheme: bearer
      bearerFormat: OpenID Connect or OAuth2 token
      description: >-
        Access token issued by the CDF project's configured identity provider.
        Access token must be an OpenID Connect token, and the project must be
        configured to accept OpenID Connect tokens. Use a header key of
        'Authorization' with a value of 'Bearer $accesstoken'. The token can be
        obtained through any flow supported by the identity provider.
    oauth2-client-credentials:
      type: oauth2
      description: >-
        Access token issued by the CDF project's configured identity provider.
        Access token must be an OpenID Connect token, and the project must be
        configured to accept OpenID Connect tokens. Use a header key of
        'Authorization' with a value of 'Bearer $accesstoken'. The token can be
        obtained through any flow supported by the identity provider.
      flows:
        clientCredentials:
          tokenUrl: https://your-idps.token.url/
          scopes:
            default: https://{cluster}.cognitedata.com/.default
    oauth2-open-industrial-data:
      type: oauth2
      description: >-
        Auth flow for Open Industrial Data. Get your client secret from
        https://hub.cognite.com/open-industrial-data-211.
      flows:
        clientCredentials:
          tokenUrl: >-
            https://login.microsoftonline.com/48d5043c-cf70-4c49-881c-c638f5796997/oauth2/v2.0/token
          scopes:
            default: https://api.cognitedata.com/.default
    oauth2-auth-code:
      type: oauth2
      description: >-
        Access token issued by the CDF project's configured identity provider.
        Access token must be an OpenID Connect token, and the project must be
        configured to accept OpenID Connect tokens. Use a header key of
        'Authorization' with a value of 'Bearer $accesstoken'. The token can be
        obtained through any flow supported by the identity provider.
      flows:
        authorizationCode:
          authorizationUrl: https://your-idps.authorization.url/
          tokenUrl: https://your-idps.token.url/
          scopes:
            default: https://{cluster}.cognitedata.com/.default

````