---
title: "Update Folder"
method: PATCH
path: "/api/public/v2/folders/{folder_id}"
tags: ["folders"]
---

# Update Folder

`PATCH /api/public/v2/folders/{folder_id}`

## Path parameters

- `folder_id` integer, required — The ID of the folder to update.

## Request body

- UpdateFolderRequest
  - `name` string, required — The new name for the folder. Must be unique within its parent folder.

## Response `200`

Folder updated successfully

- CreateFolderSuccessResponse
  - `success` boolean — Indicates if the operation was successful
  - `folder` Folder
    - `id` integer — Unique identifier for the folder
    - `name` string — The name of the folder
    - `created_at` string, date-time — Timestamp when the folder was created
    - `updated_at` string, date-time — Timestamp when the folder was last updated
    - `path` object[], nullable — JSON array representing the folder hierarchy path. Contains the IDs and names of all parent folders. Null for root-level folders.
    - `workspace_id` integer — ID of the workspace this folder belongs to
    - `parent_id` integer, nullable — ID of the parent folder. Null for root-level folders.
    - `external_ids` ExternalId[] — External ID mappings for the folder.
      - `source` string, required — The external system or namespace that owns the ID.
      - `external_id` string, required — The identifier for this entity in the external system.

## Other responses

- `400` — Bad request - Folder with the same name already exists at this level
- `401` — Unauthorized - Missing or invalid API key
- `404` — Folder not found
- `422` — Validation error - request parameters or body are invalid.

---

[API](https://skmtc.net/promptlayer/apis/promptlayer-api.md) · [All operations](https://skmtc.net/promptlayer/apis/promptlayer-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/promptlayer/promptlayer-api/revisions/a23093a0a506/schema)
