> ## 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.

# Set sample expiration

> Set a sample to expire on a specific date, set it to never expire, or clear any custom expiration and follow the org default. Caller must be the sample's creator, an org owner/admin, or a Strand AI admin.



## OpenAPI

````yaml PATCH /samples/{id}/expiration
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/{id}/expiration:
    patch:
      summary: Set sample expiration
      description: >-
        Set a sample to expire on a specific date, set it to never expire, or
        clear any custom expiration and follow the org default. Caller must be
        the sample's creator, an org owner/admin, or a Strand AI admin.
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ExpirationUpdate'
      responses:
        '200':
          description: Updated sample
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Sample'
        '401':
          description: Missing or invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Not allowed for this sample
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Sample not found in this org
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Invalid input
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    ExpirationUpdate:
      type: object
      description: >-
        Provide exactly one of `expiresAt`, `neverExpire: true`, or
        `useOrgDefault: true`. `neverExpire: true` is sugar for `expiresAt:
        null` (custom). `useOrgDefault: true` clears the custom expiration and
        follows the org's default policy.
      properties:
        expiresAt:
          type: string
          format: date-time
          nullable: true
        neverExpire:
          type: boolean
        useOrgDefault:
          type: boolean
        reason:
          type: string
          maxLength: 500
    Sample:
      type: object
      required:
        - id
      properties:
        id:
          type: string
          format: uuid
        expiresAt:
          type: string
          format: date-time
          nullable: true
        expiresAtSource:
          type: string
          nullable: true
          enum:
            - org_default
            - custom
            - null
        expirationChangedAt:
          type: string
          format: date-time
          nullable: true
        expirationChangedBy:
          type: string
          nullable: true
        batchId:
          type: string
          format: uuid
    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
  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.