> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.partnerpage.io/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.partnerpage.io/_mcp/server.

# Create a media item

POST https://v1.api.partnerpage.io/api/directory/private/v1alpha/directories/{directoryId}/entries/partners/{entryId}/media/
Content-Type: application/json

Create new profile media

Reference: https://docs.partnerpage.io/api-reference/entry/partner-entry/media/create-a-media-item

## Authentication

- `Authorization` header (required) (prefixed with ` Token   `) — Your API key, sent as `Authorization: Token <your API key>`

## Request

### Path parameters

- `directoryId` (string, required) — ID of the directory containing the profile media
- `entryId` (string, required) — ID of the entry containing the profile media

### Body (application/json)

This endpoint expects a ProfileMediaSerializerWriterRequest.

- `title` (string, optional, nullable)
- `description` (string, optional, nullable)
- `url` (string, optional, nullable)
- `file` (string, optional, nullable)
- `fileUrl` (string, optional, nullable)
- `order` (integer, optional, nullable)

## Response

### 201

Profile media details in the entry in the directory

- `id` (string, required)
- `title` (string, required, nullable)
- `description` (string, required, nullable)
- `order` (integer, required, nullable)
- `pdfFileThumbnailUrl` (string, required, nullable)
- `url` (string, required, nullable)
- `file` (string, required, nullable)
- `type` (string, required, nullable)
- `fileUrl` (string, optional, nullable)

## Examples

**Request**

```json
{}
```

**Response**

```json
{
  "id": "6a5fc0f0-c938-4b4e-85c2-b895a90b000d",
  "title": "Media 1",
  "description": "Media 1 description",
  "order": 0,
  "pdfFileThumbnailUrl": null,
  "url": null,
  "file": "https://image.domain.com/partner.png",
  "type": "I",
  "fileUrl": "https://image.domain.com/partner.png"
}
```

**SDK Code**

```python Example
import requests

url = "https://v1.api.partnerpage.io/api/directory/private/v1alpha/directories/directoryId/entries/partners/entryId/media/"

payload = {}
headers = {
    "Authorization": "Token  <apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Example
const url = 'https://v1.api.partnerpage.io/api/directory/private/v1alpha/directories/directoryId/entries/partners/entryId/media/';
const options = {
  method: 'POST',
  headers: {Authorization: 'Token  <apiKey>', 'Content-Type': 'application/json'},
  body: '{}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```