---
updatedAt: 2026-04-21T14:00:30.000Z
agentTools:
  projectIndex: https://marketing.developer.dotdigital.com/llms.txt
---

# Create preference

Creates a new preference or a new preference category

<br />

This operation creates either a new preference or a new preference category.

* Preferences that are inside the same category must have unique private names
* Uncategorised preferences must have unique private names
* All categories must have unique private names
* Preferences and categories can have the same public names

## Creating a preference outside of a category

1. Set the value of the `isPreference` to `true`
2. Set the value of the `CategoryId` to `null`

## Creating a preference inside a category

1. Set the value of the `isPreference` to `true`
2. Set the value of the `CategoryId` to the ID of an existing category

## Creating a preference category

1. Set the value of the `isPreference` to `false`
2. Set the value of `isPublic` to `true`
3. Set the value of the `CategoryId` to a unique integer

<span class="callRateMedium" />

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Preferences and subscriptions",
    "version": "2.0.1",
    "description": "Manage contact subscriptions, suppressions, and marketing preferences. Use this\nAPI to unsubscribe or resubscribe contacts (with or without a challenge email),\nbulk-suppress contacts, and query suppressed or unsubscribed contacts since a\ngiven date. Also provides full CRUD for preference categories and individual\npreferences, and endpoints to get or set the preference opt-in status for a\nspecific contact."
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true,
  "x-samples-languages": [
    "curl",
    "csharp",
    "java",
    "javascript",
    "node",
    "python",
    "php",
    "ruby"
  ],
  "externalDocs": {
    "description": "Learn more about Dotdigital APIs",
    "url": "https://developer.dotdigital.com"
  },
  "servers": [
    {
      "url": "https://{region}-api.dotdigital.com",
      "variables": {
        "region": {
          "default": "r1",
          "enum": [
            "r1",
            "r2",
            "r3"
          ],
          "description": "The Dotdigital region id your account belongs to"
        }
      }
    }
  ],
  "security": [
    {
      "basicAuth": []
    }
  ],
  "components": {
    "securitySchemes": {
      "basicAuth": {
        "type": "http",
        "scheme": "basic"
      }
    }
  },
  "paths": {
    "/v2/preferences": {
      "parameters": [
        {
          "in": "header",
          "name": "x-ddg-integration-token",
          "required": false,
          "description": "If you are a partner of Dotdigital and have a [verified integration](https://developer.dotdigital.com/docs/partner-integration-verification) then include your [integration tracking token](https://developer.dotdigital.co/docs/verified-integration-tracking) here.",
          "schema": {
            "type": "string",
            "pattern": "/^(?:\\{{0,1}(?:[0-9a-fA-F]){8}-(?:[0-9a-fA-F]){4}-(?:[0-9a-fA-F]){4}-(?:[0-9a-fA-F]){4}-(?:[0-9a-fA-F]){12}\\}{0,1})$/",
            "example": "5a96bc79-19a7-4544-973b-e2da0c9136f9"
          }
        }
      ],
      "post": {
        "summary": "Create preference",
        "deprecated": false,
        "description": "Creates a new preference or a new preference category",
        "operationId": "create-preference",
        "tags": [
          "Preferences and subscriptions"
        ],
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "publicName",
                  "privateName"
                ],
                "properties": {
                  "publicName": {
                    "type": "string",
                    "description": "The public name of the preference or the preference category. Contacts can see the public names of preferences in preference centres and signup forms."
                  },
                  "privateName": {
                    "type": "string",
                    "description": "The private name of the preference or the preference category. Contacts can't see private names in the preference centre or in signup forms."
                  },
                  "isPreference": {
                    "type": "boolean",
                    "description": "If this value is true, a new preference is created. If this value is false, a new preference category is created.",
                    "default": false
                  },
                  "order": {
                    "type": "string",
                    "description": "The position that you want the preference or the preference category to appear on the 'Contact preferences' page, starting from 0. Specify either an integer for absolute position, alternatively use \"top\" or \"bottom\""
                  },
                  "isPublic": {
                    "type": "boolean",
                    "description": "For preferences, if this value is true, the preference is visible in signup forms and preference centres.",
                    "default": true
                  },
                  "categoryID": {
                    "type": "integer",
                    "description": "For preferences, the unique ID of the preference category that you want to add the preference to. Default for preferences: 0. Default for preference categories: null",
                    "format": "int32"
                  }
                }
              },
              "examples": {
                "Request Example": {
                  "value": {
                    "publicName": "Preferred contact method",
                    "privateName": "Preferred contact method",
                    "isPreference": true,
                    "isPublic": true,
                    "order": 0,
                    "categoryId": null
                  },
                  "summary": "Request Example"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {}
                },
                "examples": {
                  "Result": {
                    "summary": "Result",
                    "value": "{ id: 23,\npublicName: 'Preferred contact method',\nprivateName: 'Preferred contact method',\nisPreference: false,\norder: 0,\nisPublic: true,\ncategoryId: 0,\npreferenceCount: 0,\ncreated: '2020-01-01T09:40:18.527Z',\nlastModified: '2020-01-01T09:40:18.527Z'\n}"
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
```

# Sibling pages

* [Unsubscribe contact](https://marketing.developer.dotdigital.com/reference/unsubscribe-contact.md)
* [Bulk suppress contacts](https://marketing.developer.dotdigital.com/reference/bulk-suppress-contacts.md)
* [Resubscribe contact](https://marketing.developer.dotdigital.com/reference/resubscribe-contact.md)
* [Resubscribe contact with no challenge](https://marketing.developer.dotdigital.com/reference/resubscribe-contact-with-no-challenge.md)
* [Get suppressed contacts since date](https://marketing.developer.dotdigital.com/reference/get-suppressed-contacts-since-date.md)
* [Get subscriptions for contact](https://marketing.developer.dotdigital.com/reference/get-subscriptions-for-contact.md)
* [Get unsubscribed contacts since date](https://marketing.developer.dotdigital.com/reference/get-unsubscribed-contacts-since-date.md)
* [Update preference](https://marketing.developer.dotdigital.com/reference/update-preference.md)
* [Get preferences](https://marketing.developer.dotdigital.com/reference/get-preferences.md)
* [Get modified preferences since date](https://marketing.developer.dotdigital.com/reference/get-modified-preferences-since-date.md)
* [Delete preference](https://marketing.developer.dotdigital.com/reference/delete-preference.md)
* [Set preferences for contact](https://marketing.developer.dotdigital.com/reference/set-preferences-for-contact.md)
* [Get preferences for contact](https://marketing.developer.dotdigital.com/reference/get-preferences-for-contact.md)
* [Get contacts opted into a preference and an address book](https://marketing.developer.dotdigital.com/reference/get-contacts-opted-into-a-preference-and-an-address-book.md)
* [Get contacts opted into a preference](https://marketing.developer.dotdigital.com/reference/get-contacts-opted-into-a-preference.md)
* [Get contacts with modified preference opt-in since date](https://marketing.developer.dotdigital.com/reference/get-contacts-with-modified-preference-opt-in-since-date.md)
* [Get contacts with modified preference opt-in in address book since date](https://marketing.developer.dotdigital.com/reference/get-contacts-with-modified-preference-opt-in-in-address-book-since-date.md)