# Operations with Specific CustomFieldDefaults

This resource lets you read and update default settings of a custom field in a project.
|  Resource  |     ```GENERIC /api/admin/customFieldSettings/customFields/{fieldID}/fieldDefaults ```    |
| --- | --- |
|  Returned entity  |  [CustomFieldDefaults](api-entity-CustomFieldDefaults.html). For the description of the entity attributes, see [Supported Fields](#CustomFieldDefaults-supported-fields) section.  |
|  Supported methods  |      * `GET`: [Read a Specific CustomFieldDefaults](#get-CustomFieldDefaults-method).    * `POST`: [Update a Specific CustomFieldDefaults](#update-CustomFieldDefaults-method).    |

## CustomFieldDefaults attributes

Represents default project-related settings of the custom field. These settings are applied at the moment when the custom field is attached to a project. After that, any changes in default settings do not affect the field settings for this project.

### Related Resources

Below you can find the list of resources that let you work with this entity.

* [Custom Field Defaults](resource-api-admin-customFieldSettings-customFields-fieldID-fieldDefaults.html)

### Attributes

This table describes attributes of the `CustomFieldDefaults` entity.

* To receive an attribute in the response from the server, specify it explicitly in the `fields` request parameter.

* To update an attribute, provide it in the body of a POST request.

|  Field  |  Type  |  Description  |
| --- | --- | --- |
|  id  |  String  |  The ID of the default custom field settings. `Read-only`.  |
|  canBeEmpty  |  Boolean  |  Indicates whether this field can have empty value in the issue.  |
|  emptyFieldText  |  String  |  The text that is shown as a placeholder when the field is empty. `Can be null`.  |
|  isPublic  |  Boolean  |  If `true`, then a user needs Read Issue and Update Issue permissions to access this field. Otherwise, the field is considered private, and Read Issue Private Fields and Update Issue Private Fields permissions are required.  |
|  parent  |  [CustomField](api-entity-CustomField.html)  |  Reference to the custom field. `Read-only`.  |

## Read a Specific CustomFieldDefaults

Get default settings for the field.

### Required permissions

Requires read access custom field.

### Request syntax

```GENERIC
GET /api/admin/customFieldSettings/customFields/{fieldID}/fieldDefaults?{fields}
```

|  null  |  The database ID of CustomFieldDefaults  |
| --- | --- |

### Request parameters

|  Parameter  |  Type  |  Description  |
| --- | --- | --- |
|  fields  |  String  |  A list of CustomFieldDefaults attributes that should be returned in the response. If no field is specified, only the `entityID` is returned.  |

### Sample

#### Sample request

```CURL
https://example.youtrack.cloud/api/admin/customFieldSettings/customFields/58-8/fieldDefaults?fields=canBeEmpty,emptyFieldText,isPublic,parent(id,name)
```

#### Sample response body

```JSON
{
  "emptyFieldText": null,
  "canBeEmpty": true,
  "isPublic": true,
  "parent": {
    "name": "Due Date",
    "id": "58-8",
    "$type": "CustomField"
  },
  "$type": "CustomFieldDefaults"
}
```

## Update a Specific CustomFieldDefaults

Update default settings for the field.

### Required permissions

Requires Update Project permission in all the projects where field is used. If field is auto-attached, Low-level Admin Write permission is required.

### Request syntax

```GENERIC
POST /api/admin/customFieldSettings/customFields/{fieldID}/fieldDefaults?{fields}
```

|  null  |  The database ID of CustomFieldDefaults  |
| --- | --- |

### Request parameters

|  Parameter  |  Type  |  Description  |
| --- | --- | --- |
|  fields  |  String  |  A list of CustomFieldDefaults attributes that should be returned in the response. If no field is specified, only the `entityID` is returned.  |

### Sample

Let's make the field private by default. Let's also set that it cannot be empty.

#### Sample request

```CURL
https://example.youtrack.cloud/api/admin/customFieldSettings/customFields/58-8/fieldDefaults?fields=canBeEmpty,emptyFieldText,isPublic,parent(id,name)
```

#### Sample request body

```JSON
{
  "emptyFieldText": null,
  "canBeEmpty": false,
  "isPublic": false
}
```

#### Sample response body

```JSON
{
  "emptyFieldText": null,
  "canBeEmpty": false,
  "isPublic": false,
  "parent": {
    "isAutoAttached": false,
    "name": "Due Date",
    "id": "58-8",
    "$type": "CustomField"
  },
  "$type": "CustomFieldDefaults"
}
```

