> ## 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 Public Samples

GET all publicly-listed samples. Returns a paginated list of Samples.


## OpenAPI

````yaml GET /api/v1/samples/public
openapi: 3.1.0
info:
  description: >-
    The One Codex API (v1) -- programmatic access to One Codex's suite of
    microbial genomics data storage, analysis, and query tools.
  title: One Codex API (v1)
  version: v1
servers:
  - url: https://app.onecodex.com
security:
  - apiKeyAuth: []
paths:
  /api/v1/samples/public:
    get:
      summary: GET samples instances_public
      operationId: get_samples_instances_public
      parameters:
        - description: Page number. Defaults to 1. See Pagination for more details.
          in: query
          name: page
          required: false
          schema:
            default: 1
            format: int32
            type: integer
        - description: >-
            Number of requested paginated records. Defaults to 50. See
            Pagination for more details.
          in: query
          name: per_page
          required: false
          schema:
            default: 50
            format: int32
            type: integer
        - description: >-
            Optional Mongo-style JSON sort clause, e.g., `sort={"created_at":
            true}` to sort by created_at (descending)
          in: query
          name: sort
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            default: null
        - description: >-
            Optional Mongo-style JSON filter clause, e.g., `where={"$uri":
            {"$eq": "/api/v1/samples/0ee172af60e84f61"}}`
          in: query
          name: where
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            default: null
      responses:
        '200':
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/samples'
                type: array
          description: OK
components:
  schemas:
    samples:
      properties:
        $uri:
          example: /api/v1/samples/0d77065796f8d173
          pattern: ^/api/v1/samples/[a-f0-9]{16}$
          readOnly: true
          title: $Uri
          type: string
        created_at:
          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.
          format: date-time
          title: Created At
          type: string
        error_msg:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: >-
            An error message if the sample failed to upload, import, or
            validate.
          title: Error Msg
        filename:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: The sample filename.
          title: Filename
        metadata:
          description: A metadata object.
          properties:
            __DOLLAR_REF__:
              example: /api/v1/metadata/a1b2c3d4e5f67890
              format: uri
              pattern: ^/api/v1/metadata/[a-f0-9]{16}$
              type: string
          title: metadata
          type: object
        owner:
          description: The owner of the sample.
          properties:
            __DOLLAR_REF__:
              example: /api/v1/users/a1b2c3d4e5f67890
              format: uri
              pattern: ^/api/v1/users/[a-f0-9]{16}$
              type: string
          title: users
          type: object
        primary_classification:
          anyOf:
            - properties:
                __DOLLAR_REF__:
                  example: /api/v1/classifications/a1b2c3d4e5f67890
                  format: uri
                  pattern: ^/api/v1/classifications/[a-f0-9]{16}$
                  type: string
              title: classifications
              type: object
            - type: 'null'
          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.
          title: Primary Classification
        project:
          anyOf:
            - properties:
                __DOLLAR_REF__:
                  example: /api/v1/projects/a1b2c3d4e5f67890
                  format: uri
                  pattern: ^/api/v1/projects/[a-f0-9]{16}$
                  type: string
              title: projects
              type: object
            - properties:
                __DOLLAR_REF__:
                  example: /api/v1/projects/a1b2c3d4e5f67890
                  format: uri
                  pattern: ^/api/v1/projects/[a-f0-9]{16}$
                  type: string
              type: object
            - type: 'null'
          default: null
          description: The project the sample belongs to (optional).
          title: Project
        size:
          anyOf:
            - type: integer
            - type: 'null'
          default: null
          description: The size of the uploaded file in bytes.
          title: Size
        status:
          description: >-
            Enum for user-facing data status.


            This is a subset of `DataStatus` for the `status` attribute in the
            APIs.
          enum:
            - awaiting_data
            - importing
            - validating
            - failed_validation
            - available
            - deleted
          title: UserFacingDataStatus
          type: string
        tags:
          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:
            properties:
              __DOLLAR_REF__:
                example: /api/v1/tags/a1b2c3d4e5f67890
                format: uri
                pattern: ^/api/v1/tags/[a-f0-9]{16}$
                type: string
            title: tags
            type: object
          title: Tags
          type: array
        updated_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          default: null
          description: >-
            Timestamp for when the object was last updated on the One Codex
            platform, encoded as a [RFC
            3339](https://www.ietf.org/rfc/rfc3339.txt) timestamp.
          title: Updated At
        visibility:
          description: >-
            Enum for the v1 API `visibility` attribute.


            Note: this is legacy and only exists for backwards-compatibility in
            the public v1 API.
          enum:
            - public
            - shared
            - private
            - importing
            - awaiting data
          title: ApiV1Visibility
          type: string
      required:
        - $uri
        - created_at
        - metadata
        - owner
        - primary_classification
        - status
        - visibility
      title: samples
      type: object
  securitySchemes:
    apiKeyAuth:
      in: header
      name: X-API-Key
      type: apiKey

````