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

# Update Media Name

> Update the name of a media item

## Endpoint

```
POST https://api.ugc.inc/media/update-name
```

## Overview

Update the name of a single media item. Works for both user-uploaded media and social audio.

## Request Body

<ParamField body="id" type="string" required>
  The ID of the media item to update
</ParamField>

<ParamField body="name" type="string" required>
  The new name for the media item
</ParamField>

## Response

<ResponseField name="data" type="UserMedia | SocialAudio">
  The updated media object
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST https://api.ugc.inc/media/update-name \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "id": "media_abc123",
      "name": "my-video.mp4"
    }'
  ```

  ```python Python theme={null}
  import requests

  response = requests.post(
      'https://api.ugc.inc/media/update-name',
      headers={
          'Authorization': 'Bearer YOUR_API_KEY',
          'Content-Type': 'application/json'
      },
      json={
          'id': 'media_abc123',
          'name': 'my-video.mp4'
      }
  )

  data = response.json()
  print(data['data']['name'])
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://api.ugc.inc/media/update-name', {
    method: 'POST',
    headers: {
      'Authorization': 'Bearer YOUR_API_KEY',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      id: 'media_abc123',
      name: 'my-video.mp4'
    })
  });

  const data = await response.json();
  console.log(data.data.name);
  ```

  ```typescript React theme={null}
  import { UGCClient } from 'ugcinc';

  const client = new UGCClient({
    apiKey: 'YOUR_API_KEY'
  });

  const response = await client.media.updateName({
    id: 'media_abc123',
    name: 'my-video.mp4'
  });

  if (response.ok) {
    console.log(`Updated name to: ${response.data.name}`);
  }
  ```
</RequestExample>

<ResponseExample>
  ```json Success Response theme={null}
  {
    "ok": true,
    "code": 200,
    "data": {
      "id": "media_abc123",
      "org_id": "org_xyz789",
      "name": "my-video.mp4",
      "tag": "featured",
      "type": "video",
      "url": "https://example.com/media/video.mp4",
      "created_at": "2024-01-15T10:30:00.000Z",
      "media_type": "user_media"
    },
    "message": "Name updated successfully"
  }
  ```

  ```json Error Response theme={null}
  {
    "ok": false,
    "code": 404,
    "message": "Media not found"
  }
  ```
</ResponseExample>
