API reference
Issues
List, open, comment on and close issues.
See Issues.
GET /v1/orgs/:orgId/repos/:name/issues
Lists issues in one state, newest first. Pass the returned cursor to get the next page.
Auth: user access token or platform agent key · Scope: git:read
| Path parameter | Description |
|---|---|
:orgId | Organization id (org_…). |
:name | Repository name. |
| Query parameter | Type | Required | Default | Notes |
|---|---|---|---|---|
state | "open" | "closed" | No | "open" | |
cursor | string | No | ||
label | string | No | up to 50 characters | |
author | string | No | up to 64 characters | |
assignee | string | No | up to 64 characters |
Response 200
{
issues: {
number: number
createdAt?: number
updatedAt?: number
orgId: string
repoId: string
labels?: string[]
title: string
body?: string
state?: "open" | "closed"
assignees?: string[]
comments?: number
closedAt?: number
closedBy?: string
closedByPull?: number
authorId: string
authorEmail?: string
authorName?: string
}[]
cursor: null | string
}Errors
| Status | Message |
|---|---|
404 | Repository not found |
POST /v1/orgs/:orgId/repos/:name/issues
Opens an issue. Issues and pull requests share one number sequence per repository.
Auth: user access token or platform agent key · Scope: git:read
| Path parameter | Description |
|---|---|
:orgId | Organization id (org_…). |
:name | Repository name. |
Request body
| Field | Type | Required | Default | Notes |
|---|---|---|---|---|
title | string | Yes | 1–256 characters; trimmed | |
body | string | No | "" | up to 65,536 characters |
labels | string[] | No | [] | up to 10 items; each 1–50 characters, trimmed |
assignees | string[] | No | [] | up to 10 items; each 1–64 characters |
Response 201
{
issue: {
number: number
createdAt?: number
updatedAt?: number
orgId: string
repoId: string
labels?: string[]
title: string
body?: string
state?: "open" | "closed"
assignees?: string[]
comments?: number
closedAt?: number
closedBy?: string
closedByPull?: number
authorId: string
authorEmail?: string
authorName?: string
}
}Errors
| Status | Message |
|---|---|
400 | Assignees must be members of this organization. |
404 | Repository not found |
404 | Issue not found |
409 | Could not create the issue. Try again. |
GET /v1/orgs/:orgId/repos/:name/issues/:number
An issue and its comments.
Auth: user access token or platform agent key · Scope: git:read
| Path parameter | Description |
|---|---|
:orgId | Organization id (org_…). |
:name | Repository name. |
:number | Issue or pull request number. |
Response 200
{
issue: {
number: number
createdAt?: number
updatedAt?: number
orgId: string
repoId: string
labels?: string[]
title: string
body?: string
state?: "open" | "closed"
assignees?: string[]
comments?: number
closedAt?: number
closedBy?: string
closedByPull?: number
authorId: string
authorEmail?: string
authorName?: string
}
comments: {
number: number
createdAt?: number
updatedAt?: number
orgId: string
repoId: string
body: string
authorId: string
authorEmail?: string
authorName?: string
commentId: string
}[]
}Errors
| Status | Message |
|---|---|
404 | Repository not found |
404 | Not found |
404 | Issue not found |
PATCH /v1/orgs/:orgId/repos/:name/issues/:number
Edits the title, body or labels, or closes and reopens the issue.
Auth: user access token or platform agent key · Scope: git:read · Allowed: Author, or git:write
| Path parameter | Description |
|---|---|
:orgId | Organization id (org_…). |
:name | Repository name. |
:number | Issue or pull request number. |
Request body
| Field | Type | Required | Notes |
|---|---|---|---|
title | string | No | 1–256 characters; trimmed |
body | string | No | up to 65,536 characters |
labels | string[] | No | up to 10 items; each 1–50 characters, trimmed |
assignees | string[] | No | up to 10 items; each 1–64 characters |
state | "open" | "closed" | No |
Response 200
{
issue: {
number: number
createdAt?: number
updatedAt?: number
orgId: string
repoId: string
labels?: string[]
title: string
body?: string
state?: "open" | "closed"
assignees?: string[]
comments?: number
closedAt?: number
closedBy?: string
closedByPull?: number
authorId: string
authorEmail?: string
authorName?: string
}
}Errors
| Status | Message |
|---|---|
400 | Assignees must be members of this organization. |
403 | Only the author or members with git:write can change this issue. |
404 | Repository not found |
404 | Not found |
404 | Issue not found |
409 | The issue changed. Reload and try again. |
POST /v1/orgs/:orgId/repos/:name/issues/:number/comments
Adds a comment to an issue.
Auth: user access token or platform agent key · Scope: git:read
| Path parameter | Description |
|---|---|
:orgId | Organization id (org_…). |
:name | Repository name. |
:number | Issue or pull request number. |
Request body
| Field | Type | Required | Notes |
|---|---|---|---|
body | string | Yes | 1–65,536 characters; trimmed |
Response 201
{
comment: {
authorId: string
authorEmail: string
authorName?: string
repoId: string
orgId: string
number: number
commentId: string
body: string
} | {
authorId: string
authorEmail?: undefined
authorName?: undefined
repoId: string
orgId: string
number: number
commentId: string
body: string
}
}Errors
| Status | Message |
|---|---|
404 | Repository not found |
404 | Not found |
404 | Issue not found |
409 | Could not add the comment. Try again. |