Skip to content

GitHub: Add field to user owned project

GitHub projects.projectsAddFieldForUser: arguments, response, policy and SDK examples.

← Projects operations · Get started

Operation github.projects_add_field_for_user

Provider route: POST /users/{username}/projectsV2/{project_number}/fields. Alter supplies the connection’s credentials and routing.

Install @alter-ai/sdk @alter-ai/github with npm, or alter-sdk-github with pip. Supply your connected customer’s grant ID and the arguments described below.

import { App } from "@alter-ai/sdk";
import { GitHubIntegration } from "@alter-ai/github";
async function execute(input: Parameters<GitHubIntegration["projects"]["projectsAddFieldForUser"]>[0]) {
const app = new App({ apiKey: process.env.ALTER_API_KEY! });
try {
const provider = new GitHubIntegration(app, { grantId: process.env.PROVIDER_GRANT_ID! });
const call = await provider.projects.projectsAddFieldForUser(input);
const result = await call.wait();
return result.bodyJson();
} finally {
await app.close();
}
}
import os
from alter_sdk import App
from alter_sdk_github import GitHubIntegration
async def execute(arguments):
async with App(api_key=os.environ["ALTER_API_KEY"]) as app:
provider = GitHubIntegration(app, {"grant_id": os.environ["PROVIDER_GRANT_ID"]})
call = await provider.projects.projects_add_field_for_user(arguments)
result = await call.wait()
return result.body_json()
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed
pathobjectRequired within parentAdditional keys: not allowed
path.usernamestringRequired within parent
path.project_numberintegerRequired within parent
bodyJSONRequired within parent
body (oneOf 1)objectAlternativeAdditional keys: not allowed
body (oneOf 1).data_typestringRequired within parentThe field’s data type.
One of: text, number, date
body (oneOf 1).namestringRequired within parentThe name of the field.
body (oneOf 2)ModelAlternativeExpand Add field to user owned project — request body — body / data_type: single select
body (oneOf 3)objectAlternativeAdditional keys: not allowed
body (oneOf 3).data_typestringRequired within parentThe field’s data type.
One of: iteration
body (oneOf 3).iteration_configurationModelRequired within parentExpand Add field to user owned project — request body — body / data_type: iteration iteration configuration
body (oneOf 3).namestringRequired within parentThe name of the field.

Referenced models: Add field to user owned project — request body — body / data_type: iteration iteration configuration, Add field to user owned project — request body — body / data_type: single select

Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.

FieldTypePresenceDescription and constraints
$ModelRootExpand Get project field for user — response body

Referenced models: Get project field for user — response body

Get project field for user — response body
FieldTypePresenceDescription and constraints
$objectRootA field inside a projects v2 project
configurationobjectOptionalConfiguration for iteration fields.
configuration.durationJSONOptional
configuration.duration (anyOf 1)integerAlternativeThe duration of the iteration in days.
configuration.duration (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
configuration.iterationsarrayOptional
configuration.iterations[]ModelEach itemExpand Get project field for user — response body — configuration iterations item
configuration.start_dayJSONOptional
configuration.start_day (anyOf 1)integerAlternativeThe day of the week when the iteration starts.
configuration.start_day (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
created_atstringRequired within parentThe time when the field was created.
Format: date-time
data_typestringRequired within parentThe field's data type.
Known values: assignees, linked_pull_requests, reviewers, labels, milestone, repository, title, text, single_select, number, date, iteration, issue_type, parent_issue, sub_issues_progress
idJSONRequired within parent
id (anyOf 1)integerAlternativeThe unique identifier of the field.
id (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
issue_field_idJSONOptional
issue_field_id (anyOf 1)integerAlternativeThe ID of the issue field.
issue_field_id (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
namestringRequired within parentThe name of the field.
node_idstringOptionalThe node ID of the field.
optionsarrayOptionalThe options available for single select fields.
options[]ModelEach itemExpand Get project field for user — response body — options item
project_urlstringRequired within parentThe API URL of the project that contains the field.
updated_atstringRequired within parentThe time when the field was last updated.
Format: date-time

Referenced models: Get project field for user — response body — configuration iterations item, Get project field for user — response body — options item

Add field to user owned project — request body — body / data_type: iteration iteration configuration
FieldTypePresenceDescription and constraints
$objectRootThe configuration for iteration fields.
durationintegerRequired within parentThe default duration for iterations in days. Individual iterations can override this value.
iterationsarrayOptionalZero or more iterations for the field.
iterations[]objectEach itemAdditional keys: not allowed
iterations[].durationintegerRequired within parentThe duration of the iteration in days.
iterations[].start_datestringRequired within parentThe start date of the iteration.
Format: date
iterations[].titlestringRequired within parentThe title of the iteration.
start_datestringRequired within parentThe start date of the first iteration.
Format: date
Add field to user owned project — request body — body / data_type: single select
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed
data_typestringRequired within parentThe field's data type.
One of: single_select
namestringRequired within parentThe name of the field.
single_select_optionsarrayRequired within parentThe options available for single select fields. At least one option must be provided when creating a single select field.
single_select_options[]ModelEach itemExpand Add field to user owned project — request body — body / data_type: single select single select options item

Referenced models: Add field to user owned project — request body — body / data_type: single select single select options item

Get project field for user — response body — configuration iterations item
FieldTypePresenceDescription and constraints
$objectRootAn iteration setting for an iteration field
completedbooleanRequired within parentWhether the iteration has been completed.
durationJSONRequired within parent
duration (anyOf 1)integerAlternativeThe duration of the iteration in days.
duration (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
idstringRequired within parentThe unique identifier of the iteration setting.
start_datestringRequired within parentThe start date of the iteration.
Format: date
titleobjectRequired within parentThe iteration title, in raw text and HTML formats.
title.htmlstringRequired within parent
title.rawstringRequired within parent
Get project field for user — response body — options item
FieldTypePresenceDescription and constraints
$objectRootAn option for a single select field
colorstringRequired within parentThe color associated with the option.
descriptionobjectRequired within parentThe description of the option, in raw text and HTML formats.
description.htmlstringRequired within parent
description.rawstringRequired within parent
idstringRequired within parentThe unique identifier of the option.
nameobjectRequired within parentThe display name of the option, in raw text and HTML formats.
name.htmlstringRequired within parent
name.rawstringRequired within parent
Add field to user owned project — request body — body / data_type: single select single select options item
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed
colorstringOptionalThe color associated with the option.
One of: BLUE, GRAY, GREEN, ORANGE, PINK, PURPLE, RED, YELLOW
descriptionstringOptionalThe description of the option.
namestringOptionalThe display name of the option.

SDK function policy ID: github.projects_add_field_for_user. Catalog operation: projects/add-field-for-user. Rules can name either ID; function rules distinguish managed calls and conservatively cover raw calls sharing the route. Existing grant permissions and policy rules apply. wait() returns an immediate result or waits for a required approval; it never approves the request itself. Persist the approval ID to resume after a restart.

Provider errors retain their response; JSON decoding raises ProviderAPIError for provider failures. ManagedOperationError identifies contract/input/retention errors. See error handling and provider-specific behavior. Sensitive input may be refused before approval storage. A decoding error never resubmits a write.

Pinned headers: {"X-GitHub-Api-Version": "2026-03-10", "User-Agent": "Alter", "Accept": "application/vnd.github+json"}

Official provider source

Report an issue with this page

Necessary

Required for sign-in, security, authorization, and remembering your choices.

Always active

Analytics

Helps us understand which product and documentation features are useful.

Performance diagnostics

Uses performance tracing and privacy-masked session replay to diagnose problems.

You can change these choices at any time from Cookie settings.