---
title: "Rename a collection"
description: "Only the user's own collections; Disukai and platform ones stay as they are. Needs the `videos:create` permission."
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.mosio.me/llms.txt
> Use this file to discover all available pages before exploring further.

Path: Mosio REST API › Discover

`PATCH /v1/discover/collections/{id}`

Only the user's own collections; Disukai and platform ones stay as they are. Needs the `videos:create` permission.

## Authentication

- `apiKey`, apiKey, in header, header `x-api-key`

## Path parameters

- `id` (`renameDiscoverCollection.path.id`; string, required)

## Request body

_Required._

- `name` (`renameDiscoverCollection.name`; string, required)
  - minLength 1; maxLength 80

## Example request

```json
{
  "name": "string"
}
```

## Code samples

### cURL

```bash
curl --request PATCH \
  --url 'https://app.mosio.me/v1/discover/collections/<id>' \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <x-api-key>' \
  --data '
{
  "name": "string"
}
'
```

### TypeScript

```typescript
const url = 'https://app.mosio.me/v1/discover/collections/<id>';
const options = {
  method: 'PATCH',
  headers: {'Content-Type': 'application/json', 'x-api-key': '<x-api-key>'},
  body: JSON.stringify({name: 'string'})
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://app.mosio.me/v1/discover/collections/<id>"

payload = { "name": "string" }
headers = {
    "Content-Type": "application/json",
    "x-api-key": "<x-api-key>"
}

response = requests.patch(url, json=payload, headers=headers)

print(response.text)
```

## Responses

### 200

The collection.

#### Example

```json
{
  "id": "string",
  "name": "string"
}
```

- `id` (`renameDiscoverCollection.response.200.id`; string, required)
- `name` (`renameDiscoverCollection.response.200.name`; string, required)

### 400

The request body is not valid JSON or does not match the schema.

#### Example

```json
{
  "error": "unauthorized",
  "message": "string",
  "details": null
}
```

- `error` (`renameDiscoverCollection.response.400.error`; string, required) — A stable error code.
  - one of `"unauthorized"`, `"invalid_api_key"`, `"insufficient_scope"`, `"forbidden"`, `"invalid_input"`, `"invalid_composition"`, `"idempotency_conflict"`, `"project_edited"`, `"quota_exceeded"`, `"insufficient_credits"`, `"too_many_active_renders"`, `"duration_too_long"`, `"not_found"`, `"internal_error"`
- `message` (`renameDiscoverCollection.response.400.message`; string, required) — A message for people, in Indonesian.
- `details` (`renameDiscoverCollection.response.400.details`; unknown, optional) — More about the error, such as the fields to fix.

### 401

The API key is missing or not valid.

#### Example

```json
{
  "error": "unauthorized",
  "message": "Kirim API key di header x-api-key."
}
```

- `error` (`renameDiscoverCollection.response.401.error`; string, required) — A stable error code.
  - one of `"unauthorized"`, `"invalid_api_key"`, `"insufficient_scope"`, `"forbidden"`, `"invalid_input"`, `"invalid_composition"`, `"idempotency_conflict"`, `"project_edited"`, `"quota_exceeded"`, `"insufficient_credits"`, `"too_many_active_renders"`, `"duration_too_long"`, `"not_found"`, `"internal_error"`
- `message` (`renameDiscoverCollection.response.401.message`; string, required) — A message for people, in Indonesian.
- `details` (`renameDiscoverCollection.response.401.details`; unknown, optional) — More about the error, such as the fields to fix.

### 404

No such video or file in this workspace.

#### Example

```json
{
  "error": "unauthorized",
  "message": "string",
  "details": null
}
```

- `error` (`renameDiscoverCollection.response.404.error`; string, required) — A stable error code.
  - one of `"unauthorized"`, `"invalid_api_key"`, `"insufficient_scope"`, `"forbidden"`, `"invalid_input"`, `"invalid_composition"`, `"idempotency_conflict"`, `"project_edited"`, `"quota_exceeded"`, `"insufficient_credits"`, `"too_many_active_renders"`, `"duration_too_long"`, `"not_found"`, `"internal_error"`
- `message` (`renameDiscoverCollection.response.404.message`; string, required) — A message for people, in Indonesian.
- `details` (`renameDiscoverCollection.response.404.details`; unknown, optional) — More about the error, such as the fields to fix.


Source: https://docs.mosio.me/api/rename-discover-collection/index.md
