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

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

Create a new filter option mapping. Filter Options Mappings allow the system to auto-assign filter options to entries based on other options assigned.
For example, you could create a mapping to auto-assign an 'Industry' filter option when the partner or the directory admin selects a filter option representing a product or service that the partner is proficient in.
Mappings consist of a name, a single 'origin' filter option, and multiple 'destination' filter options. Origin options define the option that will be auto-assigned when the entry gets manually assigned one of the destination options.

Reference: https://docs.partnerpage.io/api-reference/directory/filter-maps/create-a-new-filter-option-mapping

## 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 to create the filter option mapping for

### Body (application/json)

This endpoint expects a FilterOptionMappingSerializerWriterRequest.

- `originOption` (string, required)
- `destinationOptions` (list of string, required)
- `name` (string, optional)
- `order` (integer, optional)

## Response

### 201

Newly created filter option mapping details

- `originOption` (string, required)
- `destinationOptions` (list of string, required)
- `name` (string, optional)
- `order` (integer, optional)

## Errors

### 400 Bad Request Error

- `map from string to any`

### 404 Not Found Error

- `map from string to any`

## Examples

**Request**

```json
{
  "originOption": "string",
  "destinationOptions": [
    "string"
  ]
}
```

**Response**

```json
{
  "originOption": "127af47a-cb9c-4d54-96ca-4f799791d8b8",
  "destinationOptions": [
    "64f0fab6-32a4-4205-991b-d4eb87e82da2",
    "ce98b73d-3784-4186-9cb5-3eb5450b7c98"
  ],
  "name": "Filter Mapping Example",
  "order": 0,
  "href": "/api/directory/private/v1alpha/directories/969d9b77-c063-4101-b534-63071317ddbd/mappings/6a5fc0f0-c938-4b4e-85c2-b895a90b000d/",
  "id": "6a5fc0f0-c938-4b4e-85c2-b895a90b000d"
}
```

**SDK Code**

```python application/json example
import requests

url = "https://v1.api.partnerpage.io/api/directory/private/v1alpha/directories/directoryId/mappings/"

payload = {
    "originOption": "string",
    "destinationOptions": ["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/directories/directoryId/mappings/';
const options = {
  method: 'POST',
  headers: {Authorization: 'Token  <apiKey>', 'Content-Type': 'application/json'},
  body: '{"originOption":"string","destinationOptions":["string"]}'
};

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