Skip to main content
The REST API is now versioned. For more information, see "About API versioning."

REST API endpoints for Project fields

Use the REST API to manage Project fields

List project fields for organization

List all fields for a specific organization-owned project.

Fine-grained access tokens for "List project fields for organization"

This endpoint works with the following fine-grained token types:

The fine-grained token must have the following permission set:

  • "Projects" organization permissions (read)

This endpoint can be used without authentication or the aforementioned permissions if only public resources are requested.

Parameters for "List project fields for organization"

Headers
Name, Type, Description
accept string

Setting to application/vnd.github+json is recommended.

Path parameters
Name, Type, Description
project_number integer Required

The project's number.

org string Required

The organization name. The name is not case sensitive.

Query parameters
Name, Type, Description
per_page integer

The number of results per page (max 100). For more information, see "Using pagination in the REST API."

Default: 30

before string

A cursor, as given in the Link header. If specified, the query only searches for results before this cursor. For more information, see "Using pagination in the REST API."

after string

A cursor, as given in the Link header. If specified, the query only searches for results after this cursor. For more information, see "Using pagination in the REST API."

HTTP response status codes for "List project fields for organization"

Status codeDescription
200

OK

304

Not modified

401

Requires authentication

403

Forbidden

Code samples for "List project fields for organization"

Request example

get/orgs/{org}/projectsV2/{project_number}/fields
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/orgs/ORG/projectsV2/PROJECT_NUMBER/fields

Response

Status: 200
{ "id": 12345, "node_id": "PVTF_lADOABCD1234567890", "name": "Priority", "data_type": "single_select", "project_url": "https://api.github.com/projects/67890", "options": [ { "id": "option_1", "name": "Low", "color": "GREEN", "description": "Low priority items" }, { "id": "option_2", "name": "Medium", "color": "YELLOW", "description": "Medium priority items" }, { "id": "option_3", "name": "High", "color": "RED", "description": "High priority items" } ], "created_at": "2022-04-28T12:00:00Z", "updated_at": "2022-04-28T12:00:00Z" }

Get project field for organization

Get a specific field for an organization-owned project.

Fine-grained access tokens for "Get project field for organization"

This endpoint works with the following fine-grained token types:

The fine-grained token must have the following permission set:

  • "Projects" organization permissions (read)

This endpoint can be used without authentication or the aforementioned permissions if only public resources are requested.

Parameters for "Get project field for organization"

Headers
Name, Type, Description
accept string

Setting to application/vnd.github+json is recommended.

Path parameters
Name, Type, Description
project_number integer Required

The project's number.

field_id integer Required

The unique identifier of the field.

org string Required

The organization name. The name is not case sensitive.

HTTP response status codes for "Get project field for organization"

Status codeDescription
200

OK

304

Not modified

401

Requires authentication

403

Forbidden

Code samples for "Get project field for organization"

Request example

get/orgs/{org}/projectsV2/{project_number}/fields/{field_id}
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/orgs/ORG/projectsV2/PROJECT_NUMBER/fields/FIELD_ID

Response

Status: 200
{ "id": 12345, "node_id": "PVTF_lADOABCD1234567890", "name": "Priority", "data_type": "single_select", "project_url": "https://api.github.com/projects/67890", "options": [ { "id": "option_1", "name": "Low", "color": "GREEN", "description": "Low priority items" }, { "id": "option_2", "name": "Medium", "color": "YELLOW", "description": "Medium priority items" }, { "id": "option_3", "name": "High", "color": "RED", "description": "High priority items" } ], "created_at": "2022-04-28T12:00:00Z", "updated_at": "2022-04-28T12:00:00Z" }

List project fields for user

List all fields for a specific user-owned project.

Fine-grained access tokens for "List project fields for user"

This endpoint does not work with GitHub App user access tokens, GitHub App installation access tokens, or fine-grained personal access tokens.

Parameters for "List project fields for user"

Headers
Name, Type, Description
accept string

Setting to application/vnd.github+json is recommended.

Path parameters
Name, Type, Description
project_number integer Required

The project's number.

user_id string Required

The unique identifier of the user.

Query parameters
Name, Type, Description
per_page integer

The number of results per page (max 100). For more information, see "Using pagination in the REST API."

Default: 30

before string

A cursor, as given in the Link header. If specified, the query only searches for results before this cursor. For more information, see "Using pagination in the REST API."

after string

A cursor, as given in the Link header. If specified, the query only searches for results after this cursor. For more information, see "Using pagination in the REST API."

HTTP response status codes for "List project fields for user"

Status codeDescription
200

OK

304

Not modified

401

Requires authentication

403

Forbidden

Code samples for "List project fields for user"

Request example

get/users/{user_id}/projectsV2/{project_number}/fields
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/users/USER_ID/projectsV2/PROJECT_NUMBER/fields

Response

Status: 200
{ "id": 12345, "node_id": "PVTF_lADOABCD1234567890", "name": "Priority", "data_type": "single_select", "project_url": "https://api.github.com/projects/67890", "options": [ { "id": "option_1", "name": "Low", "color": "GREEN", "description": "Low priority items" }, { "id": "option_2", "name": "Medium", "color": "YELLOW", "description": "Medium priority items" }, { "id": "option_3", "name": "High", "color": "RED", "description": "High priority items" } ], "created_at": "2022-04-28T12:00:00Z", "updated_at": "2022-04-28T12:00:00Z" }

Get project field for user

Get a specific field for a user-owned project.

Fine-grained access tokens for "Get project field for user"

This endpoint does not work with GitHub App user access tokens, GitHub App installation access tokens, or fine-grained personal access tokens.

Parameters for "Get project field for user"

Headers
Name, Type, Description
accept string

Setting to application/vnd.github+json is recommended.

Path parameters
Name, Type, Description
project_number integer Required

The project's number.

field_id integer Required

The unique identifier of the field.

user_id string Required

The unique identifier of the user.

HTTP response status codes for "Get project field for user"

Status codeDescription
200

OK

304

Not modified

401

Requires authentication

403

Forbidden

Code samples for "Get project field for user"

Request example

get/users/{user_id}/projectsV2/{project_number}/fields/{field_id}
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/users/USER_ID/projectsV2/PROJECT_NUMBER/fields/FIELD_ID

Response

Status: 200
{ "id": 12345, "node_id": "PVTF_lADOABCD1234567890", "name": "Priority", "data_type": "single_select", "project_url": "https://api.github.com/projects/67890", "options": [ { "id": "option_1", "name": "Low", "color": "GREEN", "description": "Low priority items" }, { "id": "option_2", "name": "Medium", "color": "YELLOW", "description": "Medium priority items" }, { "id": "option_3", "name": "High", "color": "RED", "description": "High priority items" } ], "created_at": "2022-04-28T12:00:00Z", "updated_at": "2022-04-28T12:00:00Z" }