> 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 location

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

Create a new location

Reference: https://docs.partnerpage.io/api-reference/entry/partner-entry/locations/create-a-location

## 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
- `entryId` (string, required) — id of the Partner entry

### Body (application/json)

This endpoint expects a PartnerLocationRequest.

- `country` (integer, required)
- `region` (integer, optional, nullable)
- `city` (integer, optional, nullable)
- `order` (integer, optional)

## Response

### 201

Successful operation

- `id` (string, required)
- `country` (integer, required)
- `region` (integer, optional, nullable)
- `city` (integer, optional, nullable)
- `order` (integer, optional)

## Errors

### 400 Bad Request Error

Invalid place, duplicate location or limit reached

- `any`

### 404 Not Found Error

Location not found

- `any`

## Examples

**Request**

```json
{
  "country": 1
}
```

**Response**

```json
{
  "id": "e4f88344-ec9d-438b-9e05-f2f4cc89ed88",
  "country": 234,
  "region": 3650,
  "city": 26345,
  "order": 0
}
```

**SDK Code**

```python Example
import requests

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

payload = { "country": 1 }
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/locations/';
const options = {
  method: 'POST',
  headers: {Authorization: 'Token  <apiKey>', 'Content-Type': 'application/json'},
  body: '{"country":1}'
};

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