---
title: "Set sample expiration"
method: PATCH
path: "/samples/{id}/expiration"
tags: ["Samples"]
---

# Set sample expiration

`PATCH /samples/{id}/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 admin.

## Path parameters

- `id` string, uuid, required

## Request body

- ExpirationUpdate — 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.
  - `expiresAt` string, date-time, nullable
  - `neverExpire` boolean
  - `useOrgDefault` boolean
  - `reason` string

## Response `200`

Updated sample

- Sample
  - `id` string, uuid, required
  - `expiresAt` string, date-time, nullable
  - `expiresAtSource` 'org_default' | 'custom' | 'null', nullable
  - `retentionChangedAt` string, date-time, nullable
  - `retentionChangedBy` string, nullable
  - `batchId` string, uuid

## Other responses

- `401` — Missing or invalid API key
- `403` — Not allowed for this sample
- `404` — Sample not found in this org
- `422` — Invalid input

---

[API](https://skmtc.dev/strandai/apis/strand-ai-platform-api.md) · [All operations](https://skmtc.dev/strandai/apis/strand-ai-platform-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/strandai/strand-ai-platform-api/revisions/811cda19da65/schema)
