---
title: "Create custom field"
method: POST
path: "/customfields/{entity}"
tags: ["Custom Fields"]
---

# Create custom field

`POST /customfields/{entity}`

## Path parameters

- `entity` 'assets' | 'locations' | 'parts' | 'workOrders' | 'vendors' | 'purchaseOrders' | 'lineItemPurchaseOrders', required

## Query parameters

- `skipWebhook` boolean

## Headers

- `x-organization-id` integer

## Request body

- object — The custom field data
  - `fields` object[], required
    - `label` string, required
    - `type` 'oneline' | 'multiline' | 'number' | 'singleSelect' | 'date' | 'datetime' | 'link', required
    - `options` string[], nullable
    - `includeInRecurrence` boolean, nullable — Only relevent in the context of Work Orders
    - `required` boolean, nullable — Mark this field as required. This only affect the frontend.
    - `unlisted` boolean, nullable — Mark this custom field as unlisted. Once unlisted it will only be editable through the Rest API. When the custom field contains data, it will be displayed in the frontend; otherwise, it will remain hidden.

## Response `200`

Successfully created the custom fields

- object[]
  - `id` number, required — ID of the custom field
  - `label` string, required — The label of the custom field
  - `sortOrder` integer, required — The order which the field will be displayed in the UI
  - `type` 'oneline' | 'multiline' | 'number' | 'singleSelect' | 'date' | 'datetime' | 'link', required
  - `options` string[] — The possible choices to the field (if applicable).

## Other responses

- `400` — OrganizationId was not provided
- `401` — Invalid token
- `403` — Failed to create the custom field
- `404` — Could not find the specified custom field.

---

[API](https://skmtc.net/getmaintainx/apis/maintainx-api.md) · [All operations](https://skmtc.net/getmaintainx/apis/maintainx-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/getmaintainx/maintainx-api/revisions/ef9153fcac7c/schema)
