---
title: "Set sample expiration (bulk)"
method: PATCH
path: "/samples/expiration"
tags: ["Samples"]
---

# Set sample expiration (bulk)

`PATCH /samples/expiration`

All-or-nothing: if any sample fails the permission gate the whole call is rejected before any writes. Max 500 IDs per call.

## Request body

- object — 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
  - `sampleIds` string[], required

## Response `200`

Bulk update result

- object
  - `updated` integer, required
  - `batchId` string, uuid, required

## Other responses

- `401` — Missing or invalid API key
- `403` — One or more samples are not in the API key's 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)
