Skip to content

Add a field to an organization-owned project.

POST
/orgs/{org}/projectsV2/{project_number}/fields

Add a field to an organization-owned project.

API method documentation

project_number
required
integer

The project’s number.

org
required
string

The organization name. The name is not case sensitive.

Media type application/json
One of:
object
issue_field_id
required

The ID of the IssueField to create the field for.

integer
Examples

Create a text field

{
"name": "Team notes",
"data_type": "text"
}

Response for adding a field to an organization-owned project.

Media type application/json
Projects v2 Field

A field inside a projects v2 project

object
id
required

The unique identifier of the field.

integer
issue_field_id

The ID of the issue field.

integer
node_id

The node ID of the field.

string
project_url
required

The API URL of the project that contains the field.

string
name
required

The name of the field.

string
data_type
required

The field’s data type.

string
Allowed values: assignees linked_pull_requests reviewers labels milestone repository title text single_select number date iteration issue_type parent_issue sub_issues_progress
options

The options available for single select fields.

Array<object>
Projects v2 Single Select Option

An option for a single select field

object
id
required

The unique identifier of the option.

string
name
required

The display name of the option, in raw text and HTML formats.

object
raw
required
string
html
required
string
description
required

The description of the option, in raw text and HTML formats.

object
raw
required
string
html
required
string
color
required

The color associated with the option.

string
configuration

Configuration for iteration fields.

object
start_day

The day of the week when the iteration starts.

integer
duration

The duration of the iteration in days.

integer
iterations
Array<object>
Projects v2 Iteration Setting

An iteration setting for an iteration field

object
id
required

The unique identifier of the iteration setting.

string
start_date
required

The start date of the iteration.

string format: date
duration
required

The duration of the iteration in days.

integer
title
required

The iteration title, in raw text and HTML formats.

object
raw
required
string
html
required
string
completed
required

Whether the iteration has been completed.

boolean
created_at
required

The time when the field was created.

string format: date-time
updated_at
required

The time when the field was last updated.

string format: date-time
Examples
{
"id": 24680,
"node_id": "PVTF_lADOABCD2468024680",
"name": "Team notes",
"data_type": "text",
"project_url": "https://api.github.com/projects/67890",
"created_at": "2022-05-15T08:00:00Z",
"updated_at": "2022-05-15T08:00:00Z"
}

Not modified

Requires authentication

Media type application/json
Basic Error

Basic Error

object
message
string
documentation_url
string
url
string
status
string
Example generated
{
"message": "example",
"documentation_url": "example",
"url": "example",
"status": "example"
}

Forbidden

Media type application/json
Basic Error

Basic Error

object
message
string
documentation_url
string
url
string
status
string
Example generated
{
"message": "example",
"documentation_url": "example",
"url": "example",
"status": "example"
}

Validation failed, or the endpoint has been spammed.

Media type application/json
Validation Error

Validation Error

object
message
required
string
documentation_url
required
string
errors
Array<object>
object
resource
string
field
string
message
string
code
required
string
index
integer
value
One of:
string
nullable
Example generated
{
"message": "example",
"documentation_url": "example",
"errors": [
{
"resource": "example",
"field": "example",
"message": "example",
"code": "example",
"index": 1,
"value": [
"example"
]
}
]
}