Skip to content

GitHub: Add item to user owned project

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

← Projects operations · Get started

Operation github.projects_add_item_for_user

Provider route: POST /users/{username}/projectsV2/{project_number}/items. 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"]["projectsAddItemForUser"]>[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.projectsAddItemForUser(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_item_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
bodyModelRequired within parentExpand Add item to user owned project — request body — body

Referenced models: Add item to user owned project — request body — body

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

FieldTypePresenceDescription and constraints
$ModelRootExpand Add item to user owned project — response body

Referenced models: Add item to user owned project — response body

25 more schemas are linked from the tables above, on the schema pages.

Add item to user owned project — response body
FieldTypePresenceDescription and constraints
$objectRootAn item belonging to a project
archived_atJSONRequired within parent
archived_at (anyOf 1)stringAlternativeThe time when the item was archived.
Format: date-time
archived_at (anyOf 2)nullAlternative
contentJSONOptionalThe content represented by the item.
content (anyOf 1)ModelAlternativeExpand Get an issue — response body
content (anyOf 2)ModelAlternativeExpand Request reviewers for a pull request — response body
content (anyOf 3)ModelAlternativeExpand Add item to user owned project — response body — content Draft Issue
content_typestringRequired within parentThe type of content tracked in a project item
Known values: Issue, PullRequest, DraftIssue
created_atstringRequired within parentThe time when the item was created.
Format: date-time
creatorModelOptionalExpand List users — response body — item
idJSONRequired within parent
id (anyOf 1)numberAlternativeThe unique identifier of the project item.
id (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
item_urlstringOptionalThe URL of the item in the project.
Format: uri
node_idstringOptionalThe node ID of the project item.
project_urlstringOptionalThe URL of the project this item belongs to.
Format: uri
updated_atstringRequired within parentThe time when the item was last updated.
Format: date-time

Referenced models: Get an issue — response body, Add item to user owned project — response body — content Draft Issue, Request reviewers for a pull request — response body, List users — response body — item

Add item to user owned project — request body — body
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed
idintegerOptionalThe unique identifier of the issue or pull request to add to the project.
numberintegerOptionalThe issue or pull request number.
ownerstringOptionalThe repository owner login.
repostringOptionalThe repository name.
typestringRequired within parentThe type of item to add to the project. Must be either Issue or PullRequest.
One of: Issue, PullRequest
$ (oneOf 1)JSONAlternative
$ (oneOf 2)JSONAlternative
Add item to user owned project — response body — content Draft Issue
FieldTypePresenceDescription and constraints
$objectRootA draft issue in a project
bodyJSONOptional
body (anyOf 1)stringAlternativeThe body content of the draft issue
body (anyOf 2)nullAlternative
created_atstringRequired within parentThe time the draft issue was created
Format: date-time
idJSONRequired within parent
id (anyOf 1)numberAlternativeThe ID of the draft issue
id (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
node_idstringRequired within parentThe node ID of the draft issue
titlestringRequired within parentThe title of the draft issue
updated_atstringRequired within parentThe time the draft issue was last updated
Format: date-time
userModelRequired within parentExpand Get an issue — response body — user

Referenced models: Get an issue — response body — user

List users — response body — item
FieldTypePresenceDescription and constraints
$objectRootA GitHub user.
avatar_urlstringRequired within parentFormat: uri
emailJSONOptional
email (anyOf 1)stringAlternative
email (anyOf 2)nullAlternative
events_urlstringRequired within parent
followers_urlstringRequired within parentFormat: uri
following_urlstringRequired within parent
gists_urlstringRequired within parent
gravatar_idJSONRequired within parent
gravatar_id (anyOf 1)stringAlternative
gravatar_id (anyOf 2)nullAlternative
html_urlstringRequired within parentFormat: uri
idJSONRequired within parent
id (anyOf 1)integerAlternativeFormat: int64
id (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
loginstringRequired within parent
nameJSONOptional
name (anyOf 1)stringAlternative
name (anyOf 2)nullAlternative
node_idstringRequired within parent
organizations_urlstringRequired within parentFormat: uri
received_events_urlstringRequired within parentFormat: uri
repos_urlstringRequired within parentFormat: uri
site_adminbooleanRequired within parent
starred_atstringOptional
starred_urlstringRequired within parent
subscriptions_urlstringRequired within parentFormat: uri
typestringRequired within parent
urlstringRequired within parentFormat: uri
user_view_typestringOptional
Get an app — response body
FieldTypePresenceDescription and constraints
$JSONRoot
$ (anyOf 1)objectAlternativeGitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub.
$ (anyOf 1).client_idstringOptional
$ (anyOf 1).created_atstringRequired within parentFormat: date-time
$ (anyOf 1).descriptionJSONRequired within parent
$ (anyOf 1).description (anyOf 1)stringAlternative
$ (anyOf 1).description (anyOf 2)nullAlternative
$ (anyOf 1).eventsarrayRequired within parentThe list of events for the GitHub app. Note that the `installation_target`, `security_advisory`, and `meta` events are not included because they are global events and not specific to an installation.
$ (anyOf 1).events[]stringEach item
$ (anyOf 1).external_urlstringRequired within parentFormat: uri
$ (anyOf 1).html_urlstringRequired within parentFormat: uri
$ (anyOf 1).idJSONRequired within parent
$ (anyOf 1).id (anyOf 1)integerAlternativeUnique identifier of the GitHub app
$ (anyOf 1).id (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
$ (anyOf 1).installations_countJSONOptional
$ (anyOf 1).installations_count (anyOf 1)integerAlternativeThe number of installations associated with the GitHub app. Only returned when the integration is requesting details about itself.
$ (anyOf 1).installations_count (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
$ (anyOf 1).namestringRequired within parentThe name of the GitHub app
$ (anyOf 1).node_idstringRequired within parent
$ (anyOf 1).ownerJSONRequired within parent
$ (anyOf 1).owner (anyOf 1)ModelAlternativeExpand List users — response body — item
$ (anyOf 1).owner (anyOf 2)ModelAlternativeExpand Get an app — response body — client id, created at, description, events, external url, html url, id, installations count, name, node id, owner, permissions, slug, updated at owner Enterprise
$ (anyOf 1).permissionsobjectRequired within parentThe set of permissions for the GitHub app
Additional keys: see wildcard field
$ (anyOf 1).permissions.checksstringOptional
$ (anyOf 1).permissions.contentsstringOptional
$ (anyOf 1).permissions.deploymentsstringOptional
$ (anyOf 1).permissions.issuesstringOptional
$ (anyOf 1).permissions.metadatastringOptional
$ (anyOf 1).permissions.*stringAdditional keys
$ (anyOf 1).slugstringOptionalThe slug name of the GitHub app
$ (anyOf 1).updated_atstringRequired within parentFormat: date-time
$ (anyOf 2)nullAlternative

Referenced models: Get an app — response body — client id, created at, description, events, external url, html url, id, installations count, name, node id, owner, permissions, slug, updated at owner Enterprise, List users — response body — item

SDK function policy ID: github.projects_add_item_for_user. Catalog operation: projects/add-item-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.