> 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 filter option

POST https://v1.api.partnerpage.io/api/directory/private/v1alpha/filters/{filterId}/options/
Content-Type: application/json

Create a filter option within a custom filter. The image is optional. Send it as base64 in `image`, or upload the file to `POST /api/core/private/v1alpha/files/` first and send the returned URL in `imageUrl`; only a URL from that endpoint is accepted, and the file is copied into the option. A file in `image` wins over `imageUrl`, and a value in either wins over `null` in the other; `null` alone leaves the option without an image

Reference: https://docs.partnerpage.io/api-reference/directory/filters/filter-options/create-a-filter-option

## Authentication

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

## Request

### Path parameters

- `filterId` (string, required) — ID of the filter where the option will be created

### Body (application/json)

This endpoint expects a FilterOptionSerializerWriterRequest.

- `name` (string, required)
- `order` (integer, optional)
- `image` (string, optional, nullable)
- `imageUrl` (string, optional, nullable)

## Response

### 200

Details of the filter option

- `href` (string, required)
- `id` (string, required)
- `name` (string, required)
- `order` (integer, required)
- `slug` (string, required)
- `image` (string, required, nullable)
- `imageUrl` (string, required, nullable)
- `filter` (string, required)
- `parentOptionId` (string, required)
- `parentOptionSlug` (string, required)
- `hasResults` (boolean, optional, nullable)

## Errors

### 400 Bad Request Error

Validation error, for example an invalid name or order, a base64 image of the wrong type or over 4 MB, an imageUrl not returned by the files upload endpoint, a staged file that is missing, of the wrong type or too large, a filter that already has its maximum number of options, or a system filter, which doesn't take new options

- `any`

### 403 Forbidden Error

The filter does not exist, belongs to another organization, or the user cannot edit filters

- `any`

### 429 Too Many Requests Error

Rate limit exceeded

- `any`

## Examples

**Request**

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

**Response**

```json
{
  "href": "/api/directory/private/v1alpha/filters/006059d7-4d1e-4ace-b816-32fa9a9659ac/options/64f0fab6-32a4-4205-991b-d4eb87e82da2/",
  "id": "64f0fab6-32a4-4205-991b-d4eb87e82da2",
  "name": "First Option",
  "order": 0,
  "slug": "first-option",
  "image": "https://image.domain.com/partner.png",
  "imageUrl": "https://image.domain.com/partner.png",
  "filter": "string",
  "parentOptionId": "string",
  "parentOptionSlug": "string"
}
```

**SDK Code**

```python application/json example
import requests

url = "https://v1.api.partnerpage.io/api/directory/private/v1alpha/filters/filterId/options/"

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

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

print(response.json())
```

```javascript application/json example
const url = 'https://v1.api.partnerpage.io/api/directory/private/v1alpha/filters/filterId/options/';
const options = {
  method: 'POST',
  headers: {Authorization: 'Token  <apiKey>', 'Content-Type': 'application/json'},
  body: '{"name":"string"}'
};

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