{"meta":{"title":"Pontos de extremidade da API REST para campos do Project","intro":"Usar a API REST para gerenciar campos do Project","product":"API REST","breadcrumbs":[{"href":"/pt/enterprise-cloud@latest/rest","title":"API REST"},{"href":"/pt/enterprise-cloud@latest/rest/projects","title":"Projetos"},{"href":"/pt/enterprise-cloud@latest/rest/projects/fields","title":"Campos do Project"}],"documentType":"article"},"body":"# Pontos de extremidade da API REST para campos do Project\n\nUsar a API REST para gerenciar campos do Project\n\n> [!NOTE]\n> Most endpoints use `Authorization: Bearer <YOUR-TOKEN>` and `Accept: application/vnd.github+json` headers, plus `X-GitHub-Api-Version: 2026-03-10`. Curl examples below omit these standard headers for brevity.\n\n## List project fields for organization\n\n```\nGET /orgs/{org}/projectsV2/{project_number}/fields\n```\n\nList all fields for a specific organization-owned project.\n\n### Parameters\n\n#### Headers\n\n- **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n- **`project_number`** (integer) (required)\n  The project's number.\n\n- **`org`** (string) (required)\n  The organization name. The name is not case sensitive.\n\n- **`per_page`** (integer)\n  The number of results per page (max 100). For more information, see \"Using pagination in the REST API.\"\n  Default: `30`\n\n- **`before`** (string)\n  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.\"\n\n- **`after`** (string)\n  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.\"\n\n### HTTP response status codes\n\n- **200** - OK\n\n- **304** - Not modified\n\n- **401** - Requires authentication\n\n- **403** - Forbidden\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X GET \\\n  https://api.github.com/orgs/ORG/projectsV2/PROJECT_NUMBER/fields\n```\n\n**Response schema (Status: 200):**\n\nArray of `Projects v2 Field`:\n  * `id`: required, integer\n  * `issue_field_id`: integer\n  * `node_id`: string\n  * `project_url`: required, string\n  * `name`: required, string\n  * `data_type`: required, string, enum: `assignees`, `linked_pull_requests`, `reviewers`, `labels`, `milestone`, `repository`, `title`, `text`, `single_select`, `number`, `date`, `iteration`, `issue_type`, `parent_issue`, `sub_issues_progress`\n  * `options`: array of `Projects v2 Single Select Option`:\n    * `id`: required, string\n    * `name`: required, object:\n      * `raw`: required, string\n      * `html`: required, string\n    * `description`: required, object:\n      * `raw`: required, string\n      * `html`: required, string\n    * `color`: required, string\n  * `configuration`: object:\n    * `start_day`: integer\n    * `duration`: integer\n    * `iterations`: array of `Projects v2 Iteration Setting`:\n      * `id`: required, string\n      * `start_date`: required, string, format: date\n      * `duration`: required, integer\n      * `title`: required, object:\n        * `raw`: required, string\n        * `html`: required, string\n      * `completed`: required, boolean\n  * `created_at`: required, string, format: date-time\n  * `updated_at`: required, string, format: date-time\n\n## Add a field to an organization-owned project.\n\n```\nPOST /orgs/{org}/projectsV2/{project_number}/fields\n```\n\nAdd a field to an organization-owned project.\n\n### Parameters\n\n#### Headers\n\n- **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n- **`project_number`** (integer) (required)\n  The project's number.\n\n- **`org`** (string) (required)\n  The organization name. The name is not case sensitive.\n\n#### Body parameters\n\n- **`issue_field_id`** (integer) (required)\n  The ID of the IssueField to create the field for.\n\n- **`name`** (string) (required)\n  The name of the field.\n\n- **`data_type`** (string) (required)\n  The field's data type.\n  Can be one of: `iteration`\n\n- **`single_select_options`** (array of objects)\n  The options available for single select fields. At least one option must be provided when creating a single select field.\n  - **`name`** (string)\n    The display name of the option.\n  - **`color`** (string)\n    The color associated with the option.\n    Can be one of: `BLUE`, `GRAY`, `GREEN`, `ORANGE`, `PINK`, `PURPLE`, `RED`, `YELLOW`\n  - **`description`** (string)\n    The description of the option.\n\n- **`iteration_configuration`** (object) (required)\n  The configuration for iteration fields.\n  - **`start_date`** (string)\n    The start date of the first iteration.\n  - **`duration`** (integer)\n    The default duration for iterations in days. Individual iterations can override this value.\n  - **`iterations`** (array of objects)\n    Zero or more iterations for the field.\n    - **`title`** (string)\n      The title of the iteration.\n    - **`start_date`** (string)\n      The start date of the iteration.\n    - **`duration`** (integer)\n      The duration of the iteration in days.\n\n### HTTP response status codes\n\n- **201** - Response for adding a field to an organization-owned project.\n\n- **304** - Not modified\n\n- **401** - Requires authentication\n\n- **403** - Forbidden\n\n- **422** - Validation failed, or the endpoint has been spammed.\n\n### Code examples\n\n#### Create a text field\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X POST \\\n  https://api.github.com/orgs/ORG/projectsV2/PROJECT_NUMBER/fields \\\n  -d '{\n  \"name\": \"Team notes\",\n  \"data_type\": \"text\"\n}'\n```\n\n**Response schema (Status: 201):**\n\n* `id`: required, integer\n* `issue_field_id`: integer\n* `node_id`: string\n* `project_url`: required, string\n* `name`: required, string\n* `data_type`: required, string, enum: `assignees`, `linked_pull_requests`, `reviewers`, `labels`, `milestone`, `repository`, `title`, `text`, `single_select`, `number`, `date`, `iteration`, `issue_type`, `parent_issue`, `sub_issues_progress`\n* `options`: array of `Projects v2 Single Select Option`:\n  * `id`: required, string\n  * `name`: required, object:\n    * `raw`: required, string\n    * `html`: required, string\n  * `description`: required, object:\n    * `raw`: required, string\n    * `html`: required, string\n  * `color`: required, string\n* `configuration`: object:\n  * `start_day`: integer\n  * `duration`: integer\n  * `iterations`: array of `Projects v2 Iteration Setting`:\n    * `id`: required, string\n    * `start_date`: required, string, format: date\n    * `duration`: required, integer\n    * `title`: required, object:\n      * `raw`: required, string\n      * `html`: required, string\n    * `completed`: required, boolean\n* `created_at`: required, string, format: date-time\n* `updated_at`: required, string, format: date-time\n\n#### Create a number field\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X POST \\\n  https://api.github.com/orgs/ORG/projectsV2/PROJECT_NUMBER/fields \\\n  -d '{\n  \"name\": \"Story points\",\n  \"data_type\": \"number\"\n}'\n```\n\n**Response schema (Status: 201):**\n\n* `id`: required, integer\n* `issue_field_id`: integer\n* `node_id`: string\n* `project_url`: required, string\n* `name`: required, string\n* `data_type`: required, string, enum: `assignees`, `linked_pull_requests`, `reviewers`, `labels`, `milestone`, `repository`, `title`, `text`, `single_select`, `number`, `date`, `iteration`, `issue_type`, `parent_issue`, `sub_issues_progress`\n* `options`: array of `Projects v2 Single Select Option`:\n  * `id`: required, string\n  * `name`: required, object:\n    * `raw`: required, string\n    * `html`: required, string\n  * `description`: required, object:\n    * `raw`: required, string\n    * `html`: required, string\n  * `color`: required, string\n* `configuration`: object:\n  * `start_day`: integer\n  * `duration`: integer\n  * `iterations`: array of `Projects v2 Iteration Setting`:\n    * `id`: required, string\n    * `start_date`: required, string, format: date\n    * `duration`: required, integer\n    * `title`: required, object:\n      * `raw`: required, string\n      * `html`: required, string\n    * `completed`: required, boolean\n* `created_at`: required, string, format: date-time\n* `updated_at`: required, string, format: date-time\n\n#### Create a date field\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X POST \\\n  https://api.github.com/orgs/ORG/projectsV2/PROJECT_NUMBER/fields \\\n  -d '{\n  \"name\": \"Due date\",\n  \"data_type\": \"date\"\n}'\n```\n\n**Response schema (Status: 201):**\n\n* `id`: required, integer\n* `issue_field_id`: integer\n* `node_id`: string\n* `project_url`: required, string\n* `name`: required, string\n* `data_type`: required, string, enum: `assignees`, `linked_pull_requests`, `reviewers`, `labels`, `milestone`, `repository`, `title`, `text`, `single_select`, `number`, `date`, `iteration`, `issue_type`, `parent_issue`, `sub_issues_progress`\n* `options`: array of `Projects v2 Single Select Option`:\n  * `id`: required, string\n  * `name`: required, object:\n    * `raw`: required, string\n    * `html`: required, string\n  * `description`: required, object:\n    * `raw`: required, string\n    * `html`: required, string\n  * `color`: required, string\n* `configuration`: object:\n  * `start_day`: integer\n  * `duration`: integer\n  * `iterations`: array of `Projects v2 Iteration Setting`:\n    * `id`: required, string\n    * `start_date`: required, string, format: date\n    * `duration`: required, integer\n    * `title`: required, object:\n      * `raw`: required, string\n      * `html`: required, string\n    * `completed`: required, boolean\n* `created_at`: required, string, format: date-time\n* `updated_at`: required, string, format: date-time\n\n#### Create a single select field\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X POST \\\n  https://api.github.com/orgs/ORG/projectsV2/PROJECT_NUMBER/fields \\\n  -d '{\n  \"name\": \"Priority\",\n  \"data_type\": \"single_select\",\n  \"single_select_options\": [\n    {\n      \"name\": {\n        \"raw\": \"Low\",\n        \"html\": \"Low\"\n      },\n      \"color\": \"GREEN\",\n      \"description\": {\n        \"raw\": \"Low priority items\",\n        \"html\": \"Low priority items\"\n      }\n    },\n    {\n      \"name\": {\n        \"raw\": \"Medium\",\n        \"html\": \"Medium\"\n      },\n      \"color\": \"YELLOW\",\n      \"description\": {\n        \"raw\": \"Medium priority items\",\n        \"html\": \"Medium priority items\"\n      }\n    },\n    {\n      \"name\": {\n        \"raw\": \"High\",\n        \"html\": \"High\"\n      },\n      \"color\": \"RED\",\n      \"description\": {\n        \"raw\": \"High priority items\",\n        \"html\": \"High priority items\"\n      }\n    }\n  ]\n}'\n```\n\n**Response schema (Status: 201):**\n\n* `id`: required, integer\n* `issue_field_id`: integer\n* `node_id`: string\n* `project_url`: required, string\n* `name`: required, string\n* `data_type`: required, string, enum: `assignees`, `linked_pull_requests`, `reviewers`, `labels`, `milestone`, `repository`, `title`, `text`, `single_select`, `number`, `date`, `iteration`, `issue_type`, `parent_issue`, `sub_issues_progress`\n* `options`: array of `Projects v2 Single Select Option`:\n  * `id`: required, string\n  * `name`: required, object:\n    * `raw`: required, string\n    * `html`: required, string\n  * `description`: required, object:\n    * `raw`: required, string\n    * `html`: required, string\n  * `color`: required, string\n* `configuration`: object:\n  * `start_day`: integer\n  * `duration`: integer\n  * `iterations`: array of `Projects v2 Iteration Setting`:\n    * `id`: required, string\n    * `start_date`: required, string, format: date\n    * `duration`: required, integer\n    * `title`: required, object:\n      * `raw`: required, string\n      * `html`: required, string\n    * `completed`: required, boolean\n* `created_at`: required, string, format: date-time\n* `updated_at`: required, string, format: date-time\n\n#### Create an iteration field\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X POST \\\n  https://api.github.com/orgs/ORG/projectsV2/PROJECT_NUMBER/fields \\\n  -d '{\n  \"name\": \"Sprint\",\n  \"data_type\": \"iteration\",\n  \"iteration_configuration\": {\n    \"start_day\": 1,\n    \"duration\": 14,\n    \"iterations\": [\n      {\n        \"title\": {\n          \"raw\": \"Sprint 1\",\n          \"html\": \"Sprint 1\"\n        },\n        \"start_date\": \"2022-07-01\",\n        \"duration\": 14\n      },\n      {\n        \"title\": {\n          \"raw\": \"Sprint 2\",\n          \"html\": \"Sprint 2\"\n        },\n        \"start_date\": \"2022-07-15\",\n        \"duration\": 14\n      }\n    ]\n  }\n}'\n```\n\n**Response schema (Status: 201):**\n\n* `id`: required, integer\n* `issue_field_id`: integer\n* `node_id`: string\n* `project_url`: required, string\n* `name`: required, string\n* `data_type`: required, string, enum: `assignees`, `linked_pull_requests`, `reviewers`, `labels`, `milestone`, `repository`, `title`, `text`, `single_select`, `number`, `date`, `iteration`, `issue_type`, `parent_issue`, `sub_issues_progress`\n* `options`: array of `Projects v2 Single Select Option`:\n  * `id`: required, string\n  * `name`: required, object:\n    * `raw`: required, string\n    * `html`: required, string\n  * `description`: required, object:\n    * `raw`: required, string\n    * `html`: required, string\n  * `color`: required, string\n* `configuration`: object:\n  * `start_day`: integer\n  * `duration`: integer\n  * `iterations`: array of `Projects v2 Iteration Setting`:\n    * `id`: required, string\n    * `start_date`: required, string, format: date\n    * `duration`: required, integer\n    * `title`: required, object:\n      * `raw`: required, string\n      * `html`: required, string\n    * `completed`: required, boolean\n* `created_at`: required, string, format: date-time\n* `updated_at`: required, string, format: date-time\n\n## Get project field for organization\n\n```\nGET /orgs/{org}/projectsV2/{project_number}/fields/{field_id}\n```\n\nGet a specific field for an organization-owned project.\n\n### Parameters\n\n#### Headers\n\n- **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n- **`project_number`** (integer) (required)\n  The project's number.\n\n- **`field_id`** (integer) (required)\n  The unique identifier of the field.\n\n- **`org`** (string) (required)\n  The organization name. The name is not case sensitive.\n\n### HTTP response status codes\n\n- **200** - OK\n\n- **304** - Not modified\n\n- **401** - Requires authentication\n\n- **403** - Forbidden\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X GET \\\n  https://api.github.com/orgs/ORG/projectsV2/PROJECT_NUMBER/fields/FIELD_ID\n```\n\n**Response schema (Status: 200):**\n\nSame response schema as [Add a field to an organization-owned project.](#add-a-field-to-an-organization-owned-project).\n\n## List project fields for user\n\n```\nGET /users/{username}/projectsV2/{project_number}/fields\n```\n\nList all fields for a specific user-owned project.\n\n### Parameters\n\n#### Headers\n\n- **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n- **`project_number`** (integer) (required)\n  The project's number.\n\n- **`username`** (string) (required)\n  The handle for the GitHub user account.\n\n- **`per_page`** (integer)\n  The number of results per page (max 100). For more information, see \"Using pagination in the REST API.\"\n  Default: `30`\n\n- **`before`** (string)\n  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.\"\n\n- **`after`** (string)\n  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.\"\n\n### HTTP response status codes\n\n- **200** - OK\n\n- **304** - Not modified\n\n- **401** - Requires authentication\n\n- **403** - Forbidden\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X GET \\\n  https://api.github.com/users/USERNAME/projectsV2/PROJECT_NUMBER/fields\n```\n\n**Response schema (Status: 200):**\n\nSame response schema as [List project fields for organization](#list-project-fields-for-organization).\n\n## Add field to user owned project\n\n```\nPOST /users/{username}/projectsV2/{project_number}/fields\n```\n\nAdd a field to a specified user owned project.\n\n### Parameters\n\n#### Headers\n\n- **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n- **`username`** (string) (required)\n  The handle for the GitHub user account.\n\n- **`project_number`** (integer) (required)\n  The project's number.\n\n#### Body parameters\n\n- **`name`** (string) (required)\n  The name of the field.\n\n- **`data_type`** (string) (required)\n  The field's data type.\n  Can be one of: `iteration`\n\n- **`single_select_options`** (array of objects)\n  The options available for single select fields. At least one option must be provided when creating a single select field.\n  - **`name`** (string)\n    The display name of the option.\n  - **`color`** (string)\n    The color associated with the option.\n    Can be one of: `BLUE`, `GRAY`, `GREEN`, `ORANGE`, `PINK`, `PURPLE`, `RED`, `YELLOW`\n  - **`description`** (string)\n    The description of the option.\n\n- **`iteration_configuration`** (object) (required)\n  The configuration for iteration fields.\n  - **`start_date`** (string)\n    The start date of the first iteration.\n  - **`duration`** (integer)\n    The default duration for iterations in days. Individual iterations can override this value.\n  - **`iterations`** (array of objects)\n    Zero or more iterations for the field.\n    - **`title`** (string)\n      The title of the iteration.\n    - **`start_date`** (string)\n      The start date of the iteration.\n    - **`duration`** (integer)\n      The duration of the iteration in days.\n\n### HTTP response status codes\n\n- **201** - Created\n\n- **304** - Not modified\n\n- **401** - Requires authentication\n\n- **403** - Forbidden\n\n- **422** - Validation failed, or the endpoint has been spammed.\n\n### Code examples\n\n#### Create a text field\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X POST \\\n  https://api.github.com/users/USERNAME/projectsV2/PROJECT_NUMBER/fields \\\n  -d '{\n  \"name\": \"Team notes\",\n  \"data_type\": \"text\"\n}'\n```\n\n**Response schema (Status: 201):**\n\nSame response schema as [Add a field to an organization-owned project.](#add-a-field-to-an-organization-owned-project).\n\n#### Create a number field\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X POST \\\n  https://api.github.com/users/USERNAME/projectsV2/PROJECT_NUMBER/fields \\\n  -d '{\n  \"name\": \"Story points\",\n  \"data_type\": \"number\"\n}'\n```\n\n**Response schema (Status: 201):**\n\nSame response schema as [Add a field to an organization-owned project.](#add-a-field-to-an-organization-owned-project).\n\n#### Create a date field\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X POST \\\n  https://api.github.com/users/USERNAME/projectsV2/PROJECT_NUMBER/fields \\\n  -d '{\n  \"name\": \"Due date\",\n  \"data_type\": \"date\"\n}'\n```\n\n**Response schema (Status: 201):**\n\nSame response schema as [Add a field to an organization-owned project.](#add-a-field-to-an-organization-owned-project).\n\n#### Create a single select field\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X POST \\\n  https://api.github.com/users/USERNAME/projectsV2/PROJECT_NUMBER/fields \\\n  -d '{\n  \"name\": \"Priority\",\n  \"data_type\": \"single_select\",\n  \"single_select_options\": [\n    {\n      \"name\": {\n        \"raw\": \"Low\",\n        \"html\": \"Low\"\n      },\n      \"color\": \"GREEN\",\n      \"description\": {\n        \"raw\": \"Low priority items\",\n        \"html\": \"Low priority items\"\n      }\n    },\n    {\n      \"name\": {\n        \"raw\": \"Medium\",\n        \"html\": \"Medium\"\n      },\n      \"color\": \"YELLOW\",\n      \"description\": {\n        \"raw\": \"Medium priority items\",\n        \"html\": \"Medium priority items\"\n      }\n    },\n    {\n      \"name\": {\n        \"raw\": \"High\",\n        \"html\": \"High\"\n      },\n      \"color\": \"RED\",\n      \"description\": {\n        \"raw\": \"High priority items\",\n        \"html\": \"High priority items\"\n      }\n    }\n  ]\n}'\n```\n\n**Response schema (Status: 201):**\n\nSame response schema as [Add a field to an organization-owned project.](#add-a-field-to-an-organization-owned-project).\n\n#### Create an iteration field\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X POST \\\n  https://api.github.com/users/USERNAME/projectsV2/PROJECT_NUMBER/fields \\\n  -d '{\n  \"name\": \"Sprint\",\n  \"data_type\": \"iteration\",\n  \"iteration_configuration\": {\n    \"start_day\": 1,\n    \"duration\": 14,\n    \"iterations\": [\n      {\n        \"title\": {\n          \"raw\": \"Sprint 1\",\n          \"html\": \"Sprint 1\"\n        },\n        \"start_date\": \"2022-07-01\",\n        \"duration\": 14\n      },\n      {\n        \"title\": {\n          \"raw\": \"Sprint 2\",\n          \"html\": \"Sprint 2\"\n        },\n        \"start_date\": \"2022-07-15\",\n        \"duration\": 14\n      }\n    ]\n  }\n}'\n```\n\n**Response schema (Status: 201):**\n\nSame response schema as [Add a field to an organization-owned project.](#add-a-field-to-an-organization-owned-project).\n\n## Get project field for user\n\n```\nGET /users/{username}/projectsV2/{project_number}/fields/{field_id}\n```\n\nGet a specific field for a user-owned project.\n\n### Parameters\n\n#### Headers\n\n- **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n- **`project_number`** (integer) (required)\n  The project's number.\n\n- **`field_id`** (integer) (required)\n  The unique identifier of the field.\n\n- **`username`** (string) (required)\n  The handle for the GitHub user account.\n\n### HTTP response status codes\n\n- **200** - OK\n\n- **304** - Not modified\n\n- **401** - Requires authentication\n\n- **403** - Forbidden\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X GET \\\n  https://api.github.com/users/USERNAME/projectsV2/PROJECT_NUMBER/fields/FIELD_ID\n```\n\n**Response schema (Status: 200):**\n\nSame response schema as [Add a field to an organization-owned project.](#add-a-field-to-an-organization-owned-project)."}