Skip to content

Create a new custom field definition

POST https://api.prosperworks.com/developer_api/v1/custom_field_definitions

Field Type Details Default
name* string Name of the Custom Field Definition
data_type* string One of the following strings: "Checkbox", "Currency", “Date", "Dropdown", "Float", "MultiSelect", "Percentage", “String", "Text", "URL"
available_on string array List of strings containing one or more of the following: “lead”, “person”, “opportunity”, “company”, "project", "task"
options integer array Array of options for Dropdown and MultiSelect fields. A minimum of one option is required for Dropdown and a minimum of 2 options is required for MultiSelect
currency string 3-letter currency code (e.g., "USD","CAD")

* indicates a required field

Request Body

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
{
  "name": "A Dropdown",
  "data_type": "Dropdown",
  "available_on": [ "lead", "person", "company"],
  "options": [
    {
        "name": "Option1"
    },
    {
        "name": "Option2"
    }
  ]
}

Example Requests

Create a Dropdown Custom Field

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
curl --request POST "https://api.prosperworks.com/developer_api/v1/custom_field_definitions" \
  --header "X-PW-AccessToken: YOUR_TOKEN_HERE" \
  --header "X-PW-Application: developer_api" \
  --header "X-PW-UserEmail: YOUR_EMAIL_HERE" \
  --header "Content-Type: application/json" \
  --data "{
  \"name\": \"A Dropdown\",
  \"data_type\": \"Dropdown\",
  \"available_on\": [ \"lead\", \"person\", \"company\"],
  \"options\": [
    {
        \"name\": \"Option1\"
    },
    {
        \"name\": \"Option2\"
    }
  ]
}"
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
{
    "id": 5,
    "name": "A Dropdown",
    "canonical_name": null,
    "data_type": "Dropdown",
    "available_on": [
        "lead",
        "person",
        "company"
    ],
    "options": [
        {
            "id": 5,
            "name": "Option1",
            "rank": 0
        },
        {
            "id": 6,
            "name": "Option2",
            "rank": 1
        }
    ]
}

Create a Currency Custom Field

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
curl --request POST "https://api.prosperworks.com/developer_api/v1/custom_field_definitions" \
  --header "X-PW-AccessToken: YOUR_TOKEN_HERE" \
  --header "X-PW-Application: developer_api" \
  --header "X-PW-UserEmail: YOUR_EMAIL_HERE" \
  --header "Content-Type: application/json" \
  --data "{
  \"name\": \"My Currency\",
  \"data_type\": \"Currency\",
  \"available_on\": [ \"lead\", \"person\"],
  \"currency\": \"CAD\"
}"
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
{
    "id": 6,
    "name": "My Currency",
    "canonical_name": null,
    "data_type": "Currency",
    "available_on": [
        "lead",
        "person"
    ],
    "currency": "CAD"
}

Create a String Custom Field

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
curl --request POST "https://api.prosperworks.com/developer_api/v1/custom_field_definitions" \
  --header "X-PW-AccessToken: YOUR_TOKEN_HERE" \
  --header "X-PW-Application: developer_api" \
  --header "X-PW-UserEmail: YOUR_EMAIL_HERE" \
  --header "Content-Type: application/json" \
  --data "{
  \"name\": \"A String\",
  \"data_type\": \"String\",
  \"available_on\": [ \"lead\", \"person\"]
}"
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
{
    "id": 7,
    "name": "A String",
    "canonical_name": null,
    "data_type": "String",
    "available_on": [
        "lead",
        "person"
    ]
}