> ## Documentation Index
> Fetch the complete documentation index at: https://docs.provisionapp.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Custom properties and labels

> Look up your custom property ids, read and write their values, and apply labels.

Custom properties and labels are configured by your team in ProVision, so their ids are different for every partner. Look them up once, store the ids, and use the ids in every request.

## Custom properties

Conversations, clients, and sites carry a `customProperties` object, keyed by **property id**:

```json theme={null}
{
  "id": "57f2d879-20f8-4106-9abb-44fa099e0448",
  "subject": "Gate camera offline",
  "customProperties": {
    "ca_warranty_count": 2,
    "ca_region": "east",
    "ca_onsite_required": true
  }
}
```

### Look up property ids

Each resource has an endpoint that lists its properties. The full list comes back in one response; it isn't paginated.

| Resource | Endpoint | Scope |
| - | - | - |
| Conversations | `GET /v1/conversation/custom-property` | `conversation:read` |
| Clients | `GET /v1/client/custom-property` | `client:read` |
| Sites | `GET /v1/site/custom-property` | `site:read` |

```bash theme={null}
curl -sS "https://connect.provisionapp.io/v1/site/custom-property" \
  -H "x-api-key: $PROVISION_API_KEY"
```

```json theme={null}
[
  {
    "id": "ca_region",
    "entity": "site",
    "name": "Region",
    "type": "dropdown",
    "options": [
      { "id": "east", "name": "East" },
      { "id": "west", "name": "West" }
    ]
  },
  {
    "id": "ca_warranty_count",
    "entity": "site",
    "name": "Warranty count",
    "type": "number",
    "options": []
  }
]
```

Use `id`, not `name`. Your team can rename a property in ProVision at any time, but its id never changes.

Properties restricted to specific user groups are not listed and can't be read or written through the API, because an API key isn't a user whose groups could be checked.

### Create a property

`POST /v1/{site|conversation|client}/custom-property` defines a new property, the same as **Add property** in Settings → Custom Properties. It needs the `customProperty:write` scope, which is separate from the record scopes because it changes your schema.

```bash theme={null}
curl -sS -X POST "https://connect.provisionapp.io/v1/site/custom-property" \
  -H "x-api-key: $PROVISION_API_KEY" \
  -H "content-type: application/json" \
  -d '{ "name": "Warranty Tier", "type": "dropdown", "options": ["Gold", "Silver", "Bronze"], "defaultValue": "gold" }'
```

The response is `201` with the property, including its generated `id`. Rules:

* `name` must be unique among the entity's properties, otherwise the call returns `422`.
* `type` is one of `short_text`, `multi_line_text`, `url`, `number`, `checkbox`, `dropdown`, `multi_select`, `date`, `date_time`.
* `options` (labels) is required for `dropdown` and `multi_select`, and not accepted for other types. Each option's id is derived from its label.
* `defaultValue` is optional. For `dropdown` it is an option id; for `multi_select`, a list of option ids.
* The property is visible to all users. Group restrictions and groups aren't supported.

### Value formats

| `type` | Send and receive |
| - | - |
| `short_text` | A string |
| `multi_line_text` | A string |
| `url` | A string containing a URL |
| `number` | A number |
| `checkbox` | `true` or `false` |
| `dropdown` | One option `id` from `options`, as a string |
| `multi_select` | An array of option `id`s |
| `date` | An ISO 8601 date-time string, for example `"2026-11-03T00:00:00.000Z"` |
| `date_time` | An ISO 8601 date-time string |

For `dropdown` and `multi_select`, send the option's `id` (`"east"`), not its label (`"East"`).

### Write values

These endpoints accept `customProperties`:

* `POST /v1/conversation/submit` and `PATCH /v1/conversation/{id}`
* `POST /v1/client` and `PATCH /v1/client/{id}`
* `POST /v1/site` and `PATCH /v1/site/{id}`

Only the properties you send are changed. Send `null` to clear a property:

```bash theme={null}
curl -sS -X PATCH "https://connect.provisionapp.io/v1/site/$SITE_ID" \
  -H "x-api-key: $PROVISION_API_KEY" \
  -H 'content-type: application/json' \
  -d '{"customProperties":{"ca_region":"west","ca_warranty_count":null}}'
```

An unknown id or a value of the wrong type returns `400 BAD_REQUEST`. Every problem is reported at once, for example `customProperties.ca_regoin: unknown custom property`. Nothing is saved until the whole request is valid.

### Read values

* A property that was never set is **left out** of `customProperties`, unless it has a default value, in which case the default is returned.
* If your team changes a property after values were saved (renames or removes an option, or changes its type), older values are returned exactly as they were stored. They may not match the property's current type or options.
* The only reliable sign that a property has no value is that its id is missing.

### Filtering

`GET /v1/site/list`, `GET /v1/client/list`, and `GET /v1/conversation/list` can filter on a custom property. Use `customProperties.<id>` as the `attribute` of a [filter condition](https://docs.provisionapp.io/listing-and-filtering.md#filters):

```bash theme={null}
curl -sS -G "https://connect.provisionapp.io/v1/site/list" \
  -H "x-api-key: $PROVISION_API_KEY" \
  --data-urlencode 'filters=[{"attribute":"customProperties.ca_tech_review_due","operator":"is_not_null","value":""}]'
```

Each type accepts its own operators. You don't need `valueType`: the property's type decides how `value` is read.

| `type` | Operators | `value` |
| - | - | - |
| `short_text`, `multi_line_text`, `url` | `=`, `!=`, `in`, `not_in`, `ilike`, `not_ilike`, `is_null`, `is_not_null` | Any string |
| `number` | `=`, `!=`, `<`, `<=`, `>`, `>=`, `in`, `not_in`, `is_null`, `is_not_null` | A number |
| `checkbox` | `=`, `!=` | `true` or `false` |
| `dropdown` | `=`, `!=`, `in`, `not_in`, `is_null`, `is_not_null` | An option `id` |
| `multi_select` | `in` (has any of the options), `not_in` (has none of them), `is_null`, `is_not_null` | Option `id`s |
| `date`, `date_time` | `<`, `<=`, `>`, `>=`, `is_null`, `is_not_null` | An ISO 8601 date or date-time |

* **Dates are compared as instants.** A date without a time or offset, such as `2026-11-01`, means midnight UTC. ProVision saves a `date` picked in the app as midnight in your time zone, so send a full timestamp with an offset when the day boundary matters. For example, to find sites whose `ca_tech_review_due` falls in November 2026 in US Central time:

  ```json theme={null}
  [
    {
      "attribute": "customProperties.ca_tech_review_due",
      "operator": ">=",
      "value": "2026-11-01T00:00:00-05:00"
    },
    {
      "attribute": "customProperties.ca_tech_review_due",
      "operator": "<=",
      "value": "2026-11-30T23:59:59-06:00"
    }
  ]
  ```

* **`=` and `!=` aren't offered for dates**, because a stored instant almost never equals the one you send. Use a range instead.

* **An unset property filters as its default value**, the same value ProVision shows for it. So `is_null` matches only records with no value **and** no default. A value cleared with `null` counts as not set.

* **A value cleared inside ProVision also filters as the default**, while a response leaves that property out. If you need to tell these apart, filter on a property without a default.

* **A checkbox always has a value** (`false` unless its default is `true`), so it can't be filtered with `is_null` or `is_not_null`.

An unknown id, a property restricted to user groups, an operator the property's type doesn't accept, or a value of the wrong type returns `400 BAD_REQUEST`. Every problem is reported at once, for example `customProperties.ca_tech_review_due: operator "=" is not supported for date properties`.

Filtering on a custom property is supported on these three lists only. Sorting by a custom property isn't supported.

## Labels

Labels are the tags your team applies to conversations, sites, and client-site links in ProVision. The API can see and apply **public** labels only. Private labels your team applies inside ProVision are never returned and can't be changed.

### Look up label ids

```bash theme={null}
curl -sS "https://connect.provisionapp.io/v1/labels?limit=100" \
  -H "x-api-key: $PROVISION_API_KEY"
```

```json theme={null}
{
  "data": [
    {
      "labelId": "9f8e7d6c-5b4a-4938-8271-0a1b2c3d4e5f",
      "displayName": "VIP",
      "labelGroupId": null
    },
    {
      "labelId": "2b6c1f0e-7a3d-4c5e-9f81-3d2e1c0b4a59",
      "displayName": "Warranty",
      "labelGroupId": "a1c4e7f0-3b6d-4e9a-8c2f-5d8b1e4a7c30"
    }
  ],
  "meta": { "total": 2, "limit": 100, "offset": 0 }
}
```

`GET /v1/labels` needs the `label:read` scope. To find one label by name, filter on `displayName`:

```bash theme={null}
curl -sS -G "https://connect.provisionapp.io/v1/labels" \
  -H "x-api-key: $PROVISION_API_KEY" \
  --data-urlencode 'filters=[{"attribute":"displayName","operator":"=","value":"VIP"}]'
```

`labelGroupId` shows how labels are grouped in ProVision. Groups don't affect which labels you can apply.

### Apply and remove labels

Use `PUT` to apply a label and `DELETE` to remove it:

* **A conversation:** `/v1/conversation/{id}/label/{labelId}`, with `conversation:write`.
* **A site:** `/v1/site/{id}/label/{labelId}`, with `site:write`.
* **A client-site link:** `/v1/client/{clientId}/site/{siteId}/label/{labelId}`, with both `client:write` and `site:write`.

```bash theme={null}
curl -sS -X PUT "https://connect.provisionapp.io/v1/conversation/$CONVERSATION_ID/label/$LABEL_ID" \
  -H "x-api-key: $PROVISION_API_KEY"
```

```json theme={null}
{
  "conversationId": "57f2d879-20f8-4106-9abb-44fa099e0448",
  "labels": [
    {
      "labelId": "9f8e7d6c-5b4a-4938-8271-0a1b2c3d4e5f",
      "displayName": "VIP",
      "labelGroupId": null
    }
  ]
}
```

* The response lists **every** public label the record has after the change, so you don't need to read the record again.
* Both calls are safe to repeat. Applying a label that's already there, or removing one that isn't, succeeds and changes nothing.

To read a conversation's labels without changing them, add `include=labels` to `GET /v1/conversation/{id}` or `GET /v1/conversation/list`.

> [!NOTE]
>
> The `label` on a client's email address or phone number (like "Work" or "Mobile") is a
> different thing. It's sent as a name, not a label id, and an unknown name returns `400
>     INVALID_LABEL`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.