---
title: "Create Field"
method: POST
path: "/v2/fields"
---

# Create Field

`POST /v2/fields`

## Request

- Base URL: `https://pub-api.conversion.ai/api`
- URL: `https://pub-api.conversion.ai/api/v2/fields`
- Auth: one of:
  - API key in header `X-API-Key`
  - API key in query parameter `api_key`

Create a field on a standard or custom object. Use `POST /v2/fields/relationships` to link two objects.

## Request body

- object
  - `label` string, required: The human-readable display name of the field.
  - `key` string: Key used in record field maps. Leading and trailing whitespace is trimmed. Use letters, numbers, or underscores, including Unicode letters. Optional; derived from the label when omitted, preserving Unicode letters. Must be unique within this object.
  - `objectType` 'CONTACT' | 'COMPANY' | 'OPPORTUNITY' | 'CAMPAIGN' | 'CAMPAIGN_MEMBER' | 'CUSTOM_OBJECT', required: The object the field belongs to (case-insensitive). An unsupported value returns an `invalid_object_type` error.
  - `dataType` 'STRING' | 'NUMBER' | 'BOOLEAN' | 'DATE' | 'DATETIME' | 'PICKLIST', required: The data type of the field's value (case-insensitive).
  - `customObjectId` string, uuid: Required for CUSTOM_OBJECT; omit for standard objects.

## Response `200`

Field created successfully.

- object
  - `data` object
    - `field` FieldSchema, required
      - `key` string, required: Key used in record field maps.
      - `label` string, required
      - `objectType` 'CONTACT' | 'COMPANY' | 'OPPORTUNITY' | 'CAMPAIGN' | 'CAMPAIGN_MEMBER' | 'CUSTOM_OBJECT', required
      - `customObjectId` string, uuid: Present for custom-object fields.
      - `dataType` 'STRING' | 'NUMBER' | 'BOOLEAN' | 'DATE' | 'DATETIME' | 'PICKLIST' | 'RELATIONSHIP', required
      - `readOnly` boolean, required: Whether this field is unavailable for writes through the custom-object batch endpoint.
      - `relationshipTargets` RelationshipFieldReference[]: Fields on the other side of this relationship, identified by key and object. For a reverse field, this points to its writable source field.
        - `key` string, required
        - `objectType` 'CONTACT' | 'COMPANY' | 'OPPORTUNITY' | 'CAMPAIGN' | 'CAMPAIGN_MEMBER' | 'CUSTOM_OBJECT', required
        - `customObjectId` string, uuid

## Other responses

- `400`: The request was malformed or contained invalid data.
- `401`: Authentication failed.
- `403`: The API key lacks permission, or custom objects are not enabled.
- `404`: Custom object not found in this workspace.
- `500`: An unexpected server error occurred.

---

[API](https://skmtc.dev/conversion/apis/conversion-api.md) - [All operations](https://skmtc.dev/conversion/apis/conversion-api/llms.txt) - [OpenAPI document](https://skmtc.dev/conversion/apis/conversion-api/revisions/8422f815402a?raw)
