---
title: "Create a custom field"
method: POST
path: "/api/v2/custom-fields"
tags: ["Custom Fields"]
---

# Create a custom field

`POST /api/v2/custom-fields`

> 🔑
>
> Required OAuth scope: `customFields:write`.

Creates a custom field.

## Headers

- `360-api-version` 'v2.0', required

## Request body

- InputCustomFieldDTO
  - `name` string, required — The name of the custom field.
  - `targetType` 'users' | 'contents', required — The resource type to which the custom field is linked.
  - `type` 'string' | 'date', required — The type of the custom field.

## Response `201`

Returns the created custom field.

- CustomFieldDTO
  - `name` string, required — The name of the custom field.
  - `targetType` 'users' | 'contents', required — The resource type to which the custom field is linked.
  - `type` 'string' | 'date', required — The type of the custom field.
  - `_id` string, ObjectId, required — The unique ID of the custom field.

## Other responses

- `400` — The server cannot or will not process the request due to something that is perceived to be a client error.
- `401` — The given access token is either missing, invalid, has expired, or has been revoked.
- `403` — The given access token does not have the required OAuth scope to execute the request.
- `429` — The client has sent too many requests in a short amount of time.

---

[API](https://skmtc.net/360learning/apis/core-api.md) · [All operations](https://skmtc.net/360learning/apis/core-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/360learning/core-api/revisions/94b691b0b72c/schema)
