Sample - GitHub REST API
POST/orgs/{org}/projectsV2/{project_number}/fields

Add a field to an organization-owned project

Creates a field in an organization-owned Projects v2 project. Supply either an issue_field_id, or the field name and data_type; single-select fields also require single_select_options. A 201 response returns the created field with its identifier, project URL, data type, and timestamps.

  • RetriesRetries up to 2×, 500ms backoff, 30s timeout.

2 parameters · 1 body field
project_numberintegerrequired
The numeric identifier of the organization-owned project to add the field to.
orgstringrequired
The organization name; matching is not case-sensitive.

A field definition for an organization-owned Projects v2 project. Choose a supported request variant: reference an existing issue field with issue_field_id, define a field with name and data_type, or define a single-select field with single_select_options.

issue_field_idintegerrequired
The ID of the IssueField to create the field for.

5 status codes
201Returns the created project field, including its unique identifier, name, data type, project URL, and creation and update timestamps.
idintegerrequired
The unique identifier of the field.
issue_field_idintegeroptional
The ID of the issue field.
node_idstringoptional
The node ID of the field.
project_urlstringrequired
The API URL of the project that contains the field.
namestringrequired
The name of the field.
data_typestringrequired
The field's data type.
Allowed:assigneeslinked_pull_requestsreviewerslabelsmilestonerepositorytitletextsingle_selectnumberdateiteration
optionsarray<ProjectsV2SingleSelectOption>optional
The options available for single select fields.
configurationobjectoptional
Configuration for iteration fields.
created_atstringrequired
The time when the field was created.
updated_atstringrequired
The time when the field was last updated.
304Returned when the request does not produce a modified resource.
401Returned when authentication is required or the request does not include valid authentication.
messagestringoptional
documentation_urlstringoptional
urlstringoptional
statusstringoptional
403Returned when the authenticated user does not have permission to add a field to the project.
messagestringoptional
documentation_urlstringoptional
urlstringoptional
statusstringoptional
422Returned when the request fails validation or the endpoint has been spammed.
messagestringrequired
documentation_urlstringrequired
errorsarray<object>optional

Error handling

A 401 is returned when authentication is missing or invalid, and a 403 is returned when you do not have permission to modify the project. A 422 is returned when the request fails validation or the endpoint has been spammed. Provide the required fields for the selected request variant: issue_field_id, or name and data_type; use text, number, date, or single_select for data_type, and provide at least one single_select_options entry for a single-select field.