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

# List samples

> List the calling organization's samples, the public cohort, or both. Cursor-paginated newest-first; `all` always emits mine first and de-duplicates owned public samples in favor of the mine representation. Credit-free.

The facet parameters are byte-identical to the ones the Strand web app puts in a filtered `/samples` URL, so a browser query string is a valid API query string and vice versa. Facets compose with AND; `status` and `workflow` values compose with OR; repeated `marker` and `field` values compose with AND. Tags is addressed through the predefined Tags field definition. The retired `tag` parameter is rejected with 400 rather than ignored. Unknown values, malformed clauses and over-cap arrays are also rejected.

A public release supports title search (`q`) only. Under `scope=all` any other facet suppresses the public block; under `scope=public` it is a 400.



## OpenAPI

````yaml GET /samples
openapi: 3.1.0
info:
  title: Strand AI Platform API
  version: v1
  description: >-
    REST surface for uploading WSIs, submitting Lattice inference jobs, and
    streaming results. All endpoints require an API key or Strand AI OAuth
    access token in the `Authorization: Bearer` header.
servers:
  - url: https://app.strandai.com/api/v1
    description: Production
security:
  - ApiKey: []
  - OAuth2: []
paths:
  /samples:
    get:
      summary: List samples
      description: >-
        List the calling organization's samples, the public cohort, or both.
        Cursor-paginated newest-first; `all` always emits mine first and
        de-duplicates owned public samples in favor of the mine representation.
        Credit-free.


        The facet parameters are byte-identical to the ones the Strand web app
        puts in a filtered `/samples` URL, so a browser query string is a valid
        API query string and vice versa. Facets compose with AND; `status` and
        `workflow` values compose with OR; repeated `marker` and `field` values
        compose with AND. Tags is addressed through the predefined Tags field
        definition. The retired `tag` parameter is rejected with 400 rather than
        ignored. Unknown values, malformed clauses and over-cap arrays are also
        rejected.


        A public release supports title search (`q`) only. Under `scope=all` any
        other facet suppresses the public block; under `scope=public` it is a
        400.
      parameters:
        - name: scope
          in: query
          required: false
          schema:
            type: string
            enum:
              - mine
              - public
              - all
            default: mine
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 48
        - name: cursor
          in: query
          required: false
          schema:
            type: string
            minLength: 1
          description: Opaque cursor returned as `nextCursor`; not bound to page size.
        - name: q
          in: query
          required: false
          schema:
            type: string
            minLength: 1
            maxLength: 200
          description: >-
            Case-insensitive substring match against the sample's display name
            or filename. The only facet a public release can answer.
        - name: status
          in: query
          required: false
          style: form
          explode: true
          schema:
            type: array
            maxItems: 5
            items:
              type: string
              enum:
                - ready
                - preprocessing
                - uploading
                - upload_failed
                - preprocess_failed
          description: Repeatable lifecycle-status filter. Values compose with OR.
        - name: uploaded_from
          in: query
          required: false
          schema:
            type: string
            format: date
            pattern: ^(?!0000-)\d{4}-\d{2}-\d{2}$
          description: >-
            Inclusive lower bound on upload date in years 0001-9999, as a UTC
            calendar day. Must not be later than `uploaded_to`.
        - name: uploaded_to
          in: query
          required: false
          schema:
            type: string
            format: date
            pattern: ^(?!0000-)\d{4}-\d{2}-\d{2}$
          description: >-
            Inclusive upper bound on upload date in years 0001-9999, as a UTC
            calendar day: the whole day is matched.
        - name: workflow
          in: query
          required: false
          style: form
          explode: true
          schema:
            type: array
            maxItems: 3
            items:
              type: string
              enum:
                - ready_no_job
                - in_flight
                - has_results
          description: >-
            Repeatable run-state filter: `ready_no_job` (preprocessed, never
            submitted), `in_flight` (a non-terminal job exists), `has_results`
            (a completed marker prediction exists). Values compose with OR.
        - name: marker
          in: query
          required: false
          style: form
          explode: true
          schema:
            type: array
            maxItems: 20
            items:
              type: string
              pattern: ^[^,:]{1,100}:(requested|completed)$
          description: >-
            Repeatable per-marker state filter of the form `NAME:state`, where
            state is `requested` or `completed`. Marker names cannot contain `:`
            or `,`. Values compose with AND.
        - name: field
          in: query
          required: false
          style: form
          explode: true
          schema:
            type: array
            maxItems: 20
            items:
              type: string
              pattern: >-
                ^[0-9a-fA-F-]{36}:(eq|contains|gte|lte)(:.+)$|^[0-9a-fA-F-]{36}:(is_empty|is_not_empty)$
          description: >-
            Repeatable custom-field filter of the form
            `DEFINITION_UUID:op[:VALUE]`. `op` is one of `eq`, `contains`,
            `gte`, `lte`, `is_empty`, `is_not_empty`; the first four carry a
            value that is JSON-encoded and then URL-encoded (so `"high"`, `3`,
            `true`). Operators are checked against the definition's type.
            Org-defined fields have no meaning on the public cohort. Under
            `scope=all` a field facet returns matching organization-owned
            samples and suppresses public rows; under `scope=public` it is
            rejected. Values compose with AND.
      responses:
        '200':
          description: A scoped sample page
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SampleList'
        '400':
          description: Invalid query or cursor
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Missing or invalid credential
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    SampleList:
      type: object
      additionalProperties: false
      required:
        - items
        - nextCursor
        - appUrl
      properties:
        items:
          type: array
          items:
            oneOf:
              - $ref: '#/components/schemas/MineSampleListItem'
              - $ref: '#/components/schemas/PublicSampleListItem'
            discriminator:
              propertyName: ownership
              mapping:
                mine: '#/components/schemas/MineSampleListItem'
                public: '#/components/schemas/PublicSampleListItem'
        nextCursor:
          type: string
          nullable: true
          description: Opaque cursor for the next item, or null when exhausted.
        appUrl:
          type: string
          format: uri
          description: >-
            Canonical browser URL for this exact scope and filter; pagination
            omitted.
    Error:
      type: object
      required:
        - error
        - message
      properties:
        error:
          type: string
        message:
          type: string
        reason:
          type: string
          nullable: true
        required:
          type: integer
          nullable: true
        retryAfterSeconds:
          type: integer
          nullable: true
    MineSampleListItem:
      type: object
      additionalProperties: false
      required:
        - ownership
        - id
        - name
        - filename
        - status
        - fileSize
        - fields
        - createdAt
        - appUrl
      properties:
        ownership:
          type: string
          enum:
            - mine
        id:
          type: string
          format: uuid
          description: Organization-authorized sample id.
        name:
          type: string
          nullable: true
        filename:
          type: string
        status:
          type: string
        fileSize:
          type: string
          description: Decimal string for a 64-bit byte count.
        fields:
          $ref: '#/components/schemas/SampleFields'
        createdAt:
          type: string
          format: date-time
          nullable: true
        appUrl:
          type: string
          format: uri
          description: Canonical browser URL.
    PublicSampleListItem:
      type: object
      additionalProperties: false
      required:
        - ownership
        - id
        - title
        - thumbnailUrl
        - appUrl
      properties:
        ownership:
          type: string
          enum:
            - public
        id:
          type: string
          format: uuid
          description: Safe public share UUID. Never an internal sample id.
        title:
          type: string
        thumbnailUrl:
          type: string
          description: Authenticated v1 public thumbnail route.
        appUrl:
          type: string
          format: uri
          description: Canonical browser URL.
    SampleFields:
      type: object
      additionalProperties: true
      description: >-
        Unified field values keyed by stable definition key. Tags is a string
        array at `tags`; Public is a boolean at `public`. Values are validated
        against the organization's definitions.
  securitySchemes:
    ApiKey:
      type: http
      scheme: bearer
      bearerFormat: sk-strand-XXXXXXXXXXXXXXXXXXXXXXXX
    OAuth2:
      type: oauth2
      description: >-
        Strand AI authorization-code flow with S256 PKCE, explicit organization
        consent, and RFC 8707 resource binding.
      flows:
        authorizationCode:
          authorizationUrl: https://auth.strandai.com/oauth2/auth
          tokenUrl: https://auth.strandai.com/oauth2/token
          scopes:
            samples:read: Read slide metadata and estimates
            samples:write: Upload and change slides
            jobs:read: Read run status
            jobs:write: Start, export, or cancel runs
            results:read: Read and download results
            credits:spend: Reserve and spend organization credits

````

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