UpdateCustomField - Update a custom field

Updated at:

Applicable editions

Central edition, Region edition

Endpoint and authorization information

  • Get the endpoint: Replace {domain} in the API request syntax.
  • Get a personal access token.
  • Get organizationId: Required only for the Central edition. Go to the Basic Information page in the Organization Management console to obtain your organization ID.

Product

Resource

Required permission

Project Collaboration

Custom field

Read and write

Request syntax

Central edition

PUT https://{domain}/oapi/v1/projex/organizations/{organizationId}/customField/{id}

Region edition

PUT https://{domain}/oapi/v1/projex/customField/{id}

Request headers

Parameter

Type

Required

Description

Example value

x-yunxiao-token

string

Yes

Personal access token.

pt-0fh3****0fbG_35af****0484

Request parameters

Parameter

Type

Location

Required

Description

Example value

id

string

path

Yes

Custom field ID.

organizationId

string

path

  • Yes: Central edition

  • No: Region edition

Organization ID.

-

object

body

No

defaultValue

string

body

No

Default value.

test

description

string

body

No

Field description.

test

disabledOptions

array[string]

body

No

Available options for the field. Valid only if the field is a global list-type field.

["a"]

name

string

body

No

Field name.

test

nameEn

string

body

No

Field English name.

test

operatorId

string

body

No

User ID of the operator. This parameter is invalid when using a personal token.

User ID of the operator. This parameter is invalid when using a personal token.

options

array[string]

body

No

Available options for the field. Valid only if the field is a list-type field.

["a","b","c"]

Request examples

Central edition

curl -X 'PUT' \
  'https://{domain}/oapi/v1/projex/organizations/{organizationId}/customField/{id}' \
  -H 'Content-Type: application/json' \
  -H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484' \
  --data '
    {
        "defaultValue": "test",
        "description": "test",
        "disabledOptions": ["a"],
        "name": "test",
        "nameEn": "test",
        "operatorId": "User ID of the operator. This parameter is invalid when using a personal token.",
        "options": ["a","b","c"]
    }'

Region edition

curl -X 'PUT' \
  'https://{domain}/oapi/v1/projex/customField/{id}' \
  -H 'Content-Type: application/json' \
  -H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484' \
  --data '
    {
        "defaultValue": "test",
        "description": "test",
        "disabledOptions": ["a"],
        "name": "test",
        "nameEn": "test",
        "operatorId": "User ID of the operator. This parameter is invalid when using a personal token.",
        "options": ["a","b","c"]
    }'

Response parameters

None

Error codes

For more information, see Error Code Center for API-related error codes.