---
title: "Updates an expiry date of a collection."
method: PUT
path: "/collections/{collection_id}/expiry_date"
tags: ["Collections"]
---

# Updates an expiry date of a collection.

`PUT /collections/{collection_id}/expiry_date`

## Request

- Base URL: `https://h2ogpte.genai.h2o.ai/api/v1`
- URL: `https://h2ogpte.genai.h2o.ai/api/v1/collections/{collection_id}/expiry_date`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/h2o/apis/h2ogpte-rest-api/docs/collections/:collection_id/expiry_date/put.ts> (a function with typed inputs; its response is checked against the schema)

Updates an expiry date of a collection.

## Path parameters

- `collection_id` string, required

## Request body

- UpdateCollectionExpiryRequest
  - `expiry_date` string, required: Collection expiry. Either an ISO 8601 date ("2026-09-30") or a full ISO 8601 datetime with optional timezone offset ("2026-09-30T17:00:00-05:00"). A date-only value resolves to midnight (00:00:00) of that day in the timezone below.
  - `timezone` string: Optional timezone to associate with the expiry date (with IANA timezone support). Ignored for parsing when expiry_date carries its own offset, but always stored as the collection's expiry_timezone so the expiry is displayed in this zone.

## Response `204`

Successful operation

## Other responses

- `400`: Bad request
- `401`: Unauthorized - Invalid or missing API key
- `default`: Unexpected error

---

[API](https://skmtc.dev/h2o/apis/h2ogpte-rest-api.md) - [All operations](https://skmtc.dev/h2o/apis/h2ogpte-rest-api/llms.txt) - [OpenAPI document](https://skmtc.dev/h2o/apis/h2ogpte-rest-api/revisions/a82a117320f4?raw)
