# Updates the specified custom field definition.

PUT https://api.awork.com/api/v1/customfielddefinitions/{customFieldDefinitionId}

Updates the definition's name, type, or order. Type changes are limited to compatible date and date-time types or select and colored-select types.

<Check title="Required Permissions" icon="key">The user must be an admin or have `project-manage-config:write` permissions.</Check>

## Request example

```sh
curl -X PUT --globoff 'https://api.awork.com/api/v1/customfielddefinitions/{customFieldDefinitionId}' \
  -H 'Authorization: Bearer <token>' \
  -H 'Content-Type: application/json' \
  --data '{
  "name": "Ticket-Number",
  "type": "text",
  "order": 1
}'
```

- path parameter `customFieldDefinitionId`: string (required). The id of the custom field definition to update.

## Request body (application/json)

- `name`: string (required)

- `type`: string (required)

- `order`: number or null

## Response 200

OK

application/json

```json
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "name": "Ticket-Number",
  "entity": "task",
  "type": "text",
  "createdOn": "2022-03-10T16:25:09.100Z",
  "createdBy": "123e4567-e89b-12d3-a456-426614174000",
  "updatedOn": "2022-03-10T18:55:00.500Z",
  "updatedBy": "123e4567-e89b-12d3-a456-426614174000",
  "order": 1,
  "isExternal": true
}
```

## Response 400

Bad Request

application/json

```json
{
  "code": "not-found",
  "description": "There is no matching path for this URL.",
  "link": "https://developers.awork.com",
  "details": [
    "No project with the id '123' exists."
  ],
  "validationErrors": [
    {
      "property": "FirstName",
      "message": "FirstName is required."
    }
  ],
  "traceId": "a65ce5745df02af216715ff06661fb3a"
}
```

## Response 404

Not Found

application/json

```json
{
  "code": "not-found",
  "description": "There is no matching path for this URL.",
  "link": "https://developers.awork.com",
  "details": [
    "No project with the id '123' exists."
  ],
  "validationErrors": [
    {
      "property": "FirstName",
      "message": "FirstName is required."
    }
  ],
  "traceId": "a65ce5745df02af216715ff06661fb3a"
}
```
