> 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 contact request custom form

PUT https://v1.api.partnerpage.io/api/directory/private/v1alpha/directories/{directoryId}/forms/contact-request/
Content-Type: application/json

Create and configure a new custom contact request form for the specified directory. This will override the current form being used, if any.

Reference: https://docs.partnerpage.io/api-reference/directory/forms/create-a-contact-request-custom-form

## 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 generic directory to configure the form for

### Body (application/json)

This endpoint expects a Forms.FormRequest.

- `title` (string, required)
- `fields` (list of FieldRequest, required)
- `groups` (list of StepRequest, optional)

## Response

### 200

The new form was successfully created and set as active

- `title` (string, required)
- `fields` (list of Field, required)
- `isCustom` (boolean, required)
- `groups` (list of Step, optional)

## Errors

### 400 Bad Request Error

Invalid input data

- `any`

### 403 Forbidden Error

User is not allowed to update this directory

- `any`

### 404 Not Found Error

Directory not found

- `any`

## Types

### FieldRequest

- `type` (string, required)
- `attributes` (AttributeRequest, required)
- `id` (string, optional)
- `groups` (list of string, optional)
- `key` (string, optional)
- `options` (list of OptionRequest, optional)
- `overrides` (OverrideRequest, optional, nullable)
- `inputType` (enum, optional) — * `radiogroup` - radiogroup * `select` - select * `multiselect` - multiselect
  - Allowed values: `radiogroup`, `select`, `multiselect`

### StepRequest

- `key` (string, required)
- `title` (string, required)
- `description` (string, optional)
- `disabled` (boolean, optional, default: false)

### Field

- `type` (string, required)
- `attributes` (Attribute, required)
- `id` (string, optional)
- `groups` (list of string, optional)
- `key` (string, optional)
- `options` (list of Option, optional)
- `overrides` (Override, optional, nullable)
- `inputType` (enum, optional) — * `radiogroup` - radiogroup * `select` - select * `multiselect` - multiselect
  - Allowed values: `radiogroup`, `select`, `multiselect`

### Step

- `key` (string, required)
- `title` (string, required)
- `description` (string, optional)
- `disabled` (boolean, optional, default: false)

### AttributeRequest

- `label` (string, required)
- `description` (string, optional, nullable)
- `placeholder` (string, optional, nullable)
- `exportLabel` (string, optional, nullable)
- `internalLabel` (string, optional, nullable)
- `required` (boolean, optional, nullable)
- `order` (integer, optional, nullable)
- `hidden` (boolean, optional, nullable)
- `systemKey` (string, optional, nullable)
- `customizable` (boolean, optional, nullable)
- `minLength` (integer, optional, nullable)
- `maxLength` (integer, optional, nullable)
- `minValue` (string, optional, nullable)
- `maxValue` (string, optional, nullable)
- `precision` (integer, optional, nullable)
- `decimals` (integer, optional, nullable)
- `currencySymbol` (string, optional, nullable)
- `currencyCode` (string, optional, nullable)
- `minChoices` (integer, optional, nullable)
- `maxChoices` (integer, optional, nullable)
- `allowOther` (boolean, optional, nullable)

### OptionRequest

- `value` (string, required)
- `order` (integer, optional)
- `systemKey` (string, optional, nullable)

### OverrideRequest

- `attributes` (list of OverrideAttributeRequest, required)
- `conditions` (list of ConditionRequest, optional)
- `conditionCombinator` (enum, optional, default: and) — * `and` - and * `or` - or
  - Allowed values: `and`, `or`

### Attribute

- `label` (string, required)
- `description` (string, optional, nullable)
- `placeholder` (string, optional, nullable)
- `exportLabel` (string, optional, nullable)
- `internalLabel` (string, optional, nullable)
- `required` (boolean, optional, nullable)
- `order` (integer, optional, nullable)
- `hidden` (boolean, optional, nullable)
- `systemKey` (string, optional, nullable)
- `customizable` (boolean, optional, nullable)
- `minLength` (integer, optional, nullable)
- `maxLength` (integer, optional, nullable)
- `minValue` (string, optional, nullable)
- `maxValue` (string, optional, nullable)
- `precision` (integer, optional, nullable)
- `decimals` (integer, optional, nullable)
- `currencySymbol` (string, optional, nullable)
- `currencyCode` (string, optional, nullable)
- `minChoices` (integer, optional, nullable)
- `maxChoices` (integer, optional, nullable)
- `allowOther` (boolean, optional, nullable)

### Option

- `id` (string, required)
- `value` (string, required)
- `order` (integer, optional)
- `systemKey` (string, optional, nullable)

### Override

- `attributes` (list of OverrideAttribute, required)
- `conditions` (list of Condition, optional)
- `conditionCombinator` (enum, optional, default: and) — * `and` - and * `or` - or
  - Allowed values: `and`, `or`

### OverrideAttributeRequest

- `attribute` (string, required)
- `value` (boolean, required)

### ConditionRequest

- `key` (string, required, nullable)
- `operator` (enum, required) — * `equals` - equals * `not_equals` - not_equals
  - Allowed values: `equals`, `not_equals`
- `value` (string, required)

### OverrideAttribute

- `attribute` (string, required)
- `value` (boolean, required)

### Condition

- `key` (string, required, nullable)
- `operator` (enum, required) — * `equals` - equals * `not_equals` - not_equals
  - Allowed values: `equals`, `not_equals`
- `value` (string, required)

## Examples

**Request**

```json
{
  "title": "Contact request form",
  "fields": []
}
```

**Response**

```json
{
  "title": "Updated Contact Request Form",
  "fields": [
    {
      "type": "text",
      "attributes": {
        "label": "First Name",
        "placeholder": "John",
        "exportLabel": "first_name",
        "internalLabel": "partnerpage-first_name",
        "required": true,
        "order": 0,
        "hidden": false,
        "systemKey": "first_name",
        "customizable": false,
        "minLength": 0,
        "maxLength": 255
      },
      "id": "6bc20308-f4c7-4608-acba-4186d4c5a458",
      "overrides": null
    },
    {
      "type": "text",
      "attributes": {
        "label": "Company size",
        "placeholder": "Enter size",
        "exportLabel": "Company size",
        "internalLabel": "company_size",
        "required": false,
        "order": 1,
        "hidden": false,
        "systemKey": null,
        "customizable": false,
        "minLength": 0,
        "maxLength": 255
      },
      "id": "7cd31419-e5d8-5719-bdcb-5297e5d6b569",
      "overrides": null
    },
    {
      "type": "consent",
      "attributes": {
        "label": "I agree to this",
        "placeholder": null,
        "exportLabel": null,
        "internalLabel": "I agree to this",
        "required": false,
        "order": 2,
        "hidden": false,
        "systemKey": null,
        "customizable": false
      },
      "id": "8de4252a-f6e9-6820-cedc-63a8f6e7c67a",
      "overrides": null
    }
  ],
  "isCustom": true
}
```

**SDK Code**

```python Update Contact Request Form (application/json)
import requests

url = "https://v1.api.partnerpage.io/api/directory/private/v1alpha/directories/:directoryId/forms/contact-request/"

payload = {
    "title": "Contact request form",
    "fields": []
}
headers = {
    "Authorization": "Token  <apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Update Contact Request Form (application/json)
const url = 'https://v1.api.partnerpage.io/api/directory/private/v1alpha/directories/:directoryId/forms/contact-request/';
const options = {
  method: 'PUT',
  headers: {Authorization: 'Token  <apiKey>', 'Content-Type': 'application/json'},
  body: '{"title":"Contact request form","fields":[]}'
};

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