Skip to content

GitHub: Create draft item for organization owned project

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

← Projects operations · Get started

Operation github.projects_create_draft_item_for_org

Provider route: POST /orgs/{org}/projectsV2/{project_number}/drafts. 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"]["projectsCreateDraftItemForOrg"]>[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.projectsCreateDraftItemForOrg(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_create_draft_item_for_org(arguments)
result = await call.wait()
return result.body_json()
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed
pathobjectRequired within parentAdditional keys: not allowed
path.orgstringRequired within parent
path.project_numberintegerRequired within parent
bodyobjectRequired within parent
body.bodystringOptionalThe body content of the draft issue item to create in the project.
body.titlestringRequired within parentThe title of the draft issue item to create in the project.

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

26 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

Get an issue — response body
FieldTypePresenceDescription and constraints
$objectRootIssues are a great way to keep track of tasks, enhancements, and bugs for your projects.
active_lock_reasonJSONOptional
active_lock_reason (anyOf 1)stringAlternative
active_lock_reason (anyOf 2)nullAlternative
assigneesarrayOptional
assignees[]ModelEach itemExpand List users — response body — item
author_associationstringOptionalHow the author is associated with the repository.
Known values: COLLABORATOR, CONTRIBUTOR, FIRST_TIMER, FIRST_TIME_CONTRIBUTOR, MANNEQUIN, MEMBER, NONE, OWNER
bodyJSONOptional
body (anyOf 1)stringAlternativeContents of the issue
body (anyOf 2)nullAlternative
body_htmlstringOptional
body_textstringOptional
closed_atJSONRequired within parent
closed_at (anyOf 1)stringAlternativeFormat: date-time
closed_at (anyOf 2)nullAlternative
closed_byModelOptionalExpand Get an issue — response body — user
commentsJSONRequired within parent
comments (anyOf 1)integerAlternative
comments (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
comments_urlstringRequired within parentFormat: uri
created_atstringRequired within parentFormat: date-time
draftbooleanOptional
events_urlstringRequired within parentFormat: uri
html_urlstringRequired within parentFormat: uri
idJSONRequired within parent
id (anyOf 1)integerAlternativeFormat: int64
id (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
issue_dependencies_summaryModelOptionalExpand Get an issue — response body — issue dependencies summary
issue_field_valuesarrayOptional
issue_field_values[]ModelEach itemExpand Add issue field values to an issue — response body — item
labelsarrayRequired within parentLabels to associate with this issue; pass one or more label names to replace the set of labels on this issue; send an empty array to clear all labels from the issue; note that the labels are silently dropped for users without push access to the repository
labels[]JSONEach item
labels[] (anyOf 1)stringAlternative
labels[] (anyOf 2)ModelAlternativeExpand Get an issue — response body — labels item archived by, color, default, description, id, name, node id, url
labels_urlstringRequired within parent
lockedbooleanRequired within parent
milestoneModelRequired within parentExpand Get an issue — response body — milestone
node_idstringRequired within parent
numberJSONRequired within parent
number (anyOf 1)integerAlternativeNumber uniquely identifying the issue within its repository
number (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
parent_issue_urlJSONOptional
parent_issue_url (anyOf 1)stringAlternativeURL to get the parent issue of this issue, if it is a sub-issue
Format: uri
parent_issue_url (anyOf 2)nullAlternative
performed_via_github_appModelOptionalExpand Get an app — response body
pinned_commentModelOptionalExpand Get an issue — response body — pinned comment
pull_requestobjectOptional
pull_request.diff_urlstringRequired within parentFormat: uri
pull_request.html_urlstringRequired within parentFormat: uri
pull_request.merged_atstringOptionalFormat: date-time
pull_request.patch_urlstringRequired within parentFormat: uri
pull_request.urlstringRequired within parentFormat: uri
reactionsModelOptionalExpand Get an issue — response body — reactions
repositoryModelOptionalExpand List repositories for the authenticated user — response body — item
repository_urlstringRequired within parentFormat: uri
statestringRequired within parentState of the issue; either 'open' or 'closed'
state_reasonJSONOptional
state_reason (anyOf 1)stringAlternativeThe reason for the current state
Known values: completed, reopened, not_planned, duplicate
state_reason (anyOf 2)nullAlternative
sub_issues_summaryModelOptionalExpand Get an issue — response body — sub issues summary
timeline_urlstringOptionalFormat: uri
titlestringRequired within parentTitle of the issue
typeModelOptionalExpand Create issue type for an organization — response body
updated_atstringRequired within parentFormat: date-time
urlstringRequired within parentURL for the issue
Format: uri
userModelRequired within parentExpand Get an issue — response body — user

Referenced models: Get an app — response body, Get an issue — response body — issue dependencies summary, Add issue field values to an issue — response body — item, Create issue type for an organization — response body, Get an issue — response body — pinned comment, Get an issue — response body — milestone, Get an issue — response body — user, Get an issue — response body — reactions, List repositories for the authenticated user — response body — item, List users — response body — item, Get an issue — response body — sub issues summary, Get an issue — response body — labels item archived by, color, default, description, id, name, node id, url

Get a pull request — response body — links html
FieldTypePresenceDescription and constraints
$objectRootHypermedia Link
hrefstringRequired within parent

SDK function policy ID: github.projects_create_draft_item_for_org. Catalog operation: projects/create-draft-item-for-org. 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.