---
title: "Replace document labels."
method: PUT
path: "/api/v1/projects/{projectId}/pages/{pageId}/labels"
tags: ["Pages"]
---

# Replace document labels.

`PUT /api/v1/projects/{projectId}/pages/{pageId}/labels`

## Request

- Base URL: `https://app.customgpt.ai`
- URL: `https://app.customgpt.ai/api/v1/projects/{projectId}/pages/{pageId}/labels`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/poll-the-people/apis/customgpt-ai/docs/api/v1/projects/:projectId/pages/:pageId/labels/put.ts> (a function with typed inputs; its response is checked against the schema)

Assigns labels to a document for access control. The provided label IDs replace any existing labels on the document. To remove all labels (making the document accessible to everyone), send an empty array.

Notes: Maximum 50 labels per document.

Warning: This replaces all existing labels. Labels not included in the request will be removed from the document.

## Path parameters

- `projectId` integer, required
- `pageId` integer, required

## Request body

- object
  - `label_ids` integer[]: List of label IDs to set for this page (replaces existing labels)

## Response `200`

Replace labels attached to a page

- object
  - `status` 'error' | 'success': The status of the response
  - `data` Label[]
    - `id` integer: Tag ID
    - `name` string: Tag name

## Other responses

- `400`: Bad Argument
- `401`: API Token is either missing or invalid
- `404`: Page not found
- `429`: Too many requests. You have exceeded your API rate limit.
- `500`: Internal Server Error

## Changes

- **2026-11-03** `77aab4354382`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/poll-the-people/apis/customgpt-ai/changes/api/v1/projects/:projectId/pages/:pageId/labels/put.md)

---

[API](https://skmtc.dev/poll-the-people/apis/customgpt-ai.md) - [All operations](https://skmtc.dev/poll-the-people/apis/customgpt-ai/llms.txt) - [OpenAPI document](https://skmtc.dev/poll-the-people/apis/customgpt-ai/revisions/77aab4354382?raw)
