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

# Retrieve All Samples

GET all Sample instances. Returns a paginated list of Samples.


## OpenAPI

````yaml GET /api/v1/samples
openapi: 3.0.0
info:
  title: One Codex API (v1)
  description: >-
    The One Codex API (v1) -- programmatic access to One Codex's suite of
    microbial genomics data storage, analysis, and query tools.
  version: v1
servers:
  - url: https://app.onecodex.com
security:
  - apiKeyAuth: []
paths:
  /api/v1/samples:
    get:
      summary: GET samples instances
      operationId: get_samples_instances
      parameters:
        - name: page
          in: query
          required: false
          schema:
            type: integer
            default: 1
            format: int32
          description: Page number. Defaults to 1. See Pagination for more details.
        - name: per_page
          in: query
          required: false
          schema:
            type: integer
            default: 50
            format: int32
          description: >-
            Number of requested paginated records. Defaults to 50. See
            Pagination for more details.
        - name: sort
          in: query
          required: false
          schema:
            type: object
            format: string
          description: >-
            Optional Mongo-style JSON sort clause, e.g., `sort={"created_at":
            true}` to sort by created_at (descending)
        - name: where
          in: query
          required: false
          schema:
            type: object
            format: string
          description: >-
            Optional Mongo-style JSON filter clause, e.g., `where={"$uri":
            {"$eq": "/api/v1/samples/0ee172af60e84f61"}}`
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/samples'
components:
  schemas:
    samples:
      type: object
      properties:
        $uri:
          type: string
          pattern: ^/api/v1/samples\/[^/]+$
          example: /api/v1/samples/a1b2c3d4e5f67890
        created_at:
          type: string
          format: date-time
          description: >-
            Timestamp for when the object was created on the One Codex platform,
            encoded as a [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt)
            timestamp.
        error_msg:
          type: string
          nullable: true
          description: >-
            An error message if the sample failed to upload, import, or
            validate.
        filename:
          type: string
          nullable: true
          description: The sample filename.
        metadata:
          type: object
          description: A metadata object.
          properties:
            $ref: 2672f6a1-5ad8-4dd6-ac2b-57c8607658fb
        owner:
          type: object
          description: The owner of the sample.
          properties:
            $ref: 8adfa129-afb0-4cff-9408-1091c444fa3d
        primary_classification:
          type: object
          description: >-
            A reference to a Classification for the sample. This will typically
            be the [One Codex
            Database](https://docs.onecodex.com/en/articles/3761205-one-codex-database)
            or [Targeted Loci
            Database](https://docs.onecodex.com/en/articles/3754219-targeted-loci-database)
            results as appropriate. Note that samples will not have a
            `primary_classification` while they are still importing or being
            uploaded.
          properties:
            $ref: 424f8740-9815-4b0e-9597-f3a279a56e69
        project:
          type: object
          description: The project the sample belongs to (optional).
          properties:
            $ref: c5740b1b-2693-4b6f-99fa-97870c31d9d8
        size:
          type: integer
          nullable: true
          description: The size of the uploaded file in bytes.
        status:
          type: string
          enum:
            - awaiting_data
            - importing
            - validating
            - failed_validation
            - available
            - deleted
          description: The status of the sample.
        tags:
          type: array
          default: []
          description: >-
            An (optionally empty) array of references to Tags describing the
            sample. Tags are an additional unstructured organizational tool that
            complement Projects and Metadata records.
          items:
            type: object
            properties:
              $ref: 50a9c3a8-6984-49c9-9d9d-77271fc13ea8
        updated_at:
          type: string
          format: date-time
          description: >-
            Timestamp for when the object was last updated, encoded as a [RFC
            3339](https://www.ietf.org/rfc/rfc3339.txt) timestamp.
        visibility:
          type: string
          enum:
            - public
            - shared
            - private
            - importing
            - awaiting data
          description: >-
            The visibility of the sample (affects who can view the sample and
            its analyses).
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key

````