saveCustomField
Requires permission settings:custom-fields:manage.
Adds a custom field, or changes an existing one's settings. The key and kind of record never change, and the type cannot change once records hold values or while an enabled approval rule tests the field. Requires permission to manage custom fields.
Errors: a failed call returns a GraphQL errors entry, not a field on the result, and data may be null or partial. Read the entry's extensions.code and message; every shape and code is in the Error reference.
Example:
- GraphQL
- cURL
mutation SaveCustomField($input: SaveCustomFieldInput!) {
saveCustomField(input: $input) {
id
type
archived
carryForward
defaultValue
editPermission
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "mutation SaveCustomField($input: SaveCustomFieldInput!) {\n saveCustomField(input: $input) {\n id\n type\n archived\n carryForward\n defaultValue\n editPermission\n }\n}",
"variables": {
"input": {
"entity": "string",
"key": "string",
"labels": {},
"placements": [
"string"
],
"required": true,
"type": "string",
"visibility": "string"
}
}
}
EOF
Variables:
{
"input": {
"entity": "string",
"key": "string",
"labels": {},
"placements": [
"string"
],
"required": true,
"type": "string",
"visibility": "string"
}
}
Response:
{
"data": {
"saveCustomField": {
"id": "id",
"type": "string",
"archived": true,
"carryForward": true,
"defaultValue": {},
"editPermission": "string"
}
}
}
saveCustomField(
input: SaveCustomFieldInput!
): CustomFieldDefinition!
Arguments
saveCustomField.input ● SaveCustomFieldInput! non-null input
The field and its settings.
Type
CustomFieldDefinition object
A field the organization added to one kind of record.