Skip to content

Add Issue or Pull Request to board

POST /api/v5/org/{owner}/kanban/{kanban_id}/add_item

This endpoint adds Issues and Pull Requests from the specified repository to a board of the specified organization. By submitting the repository path and the lists of Issue and Pull Request numbers, you can bring the corresponding items into the board for management.

Access token support

  • AtomGit user access token (AtomGit user access tokens)

Anonymous access

This endpoint allows anonymous access.

Request parameters

Parameter Location Type Required Description
owner path string Yes Organization path
kanban_id path string Yes Board ID

Request Body:

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "repo": {
      "description": "Repository path",
      "type": "string"
    },
    "issue_iids": {
      "description": "iid of an issue in the repository",
      "type": "array",
      "items": {
        "type": "integer"
      }
    },
    "pr_iids": {
      "description": "iid of a pull request in the repository",
      "type": "array",
      "items": {
        "type": "integer"
      }
    }
  },
  "required": ["repo", "issue_iids", "pr_iids"]
}

Response parameters

On success, the response body is an empty object {} and no business fields are returned.

Error responses

400 Invalid parameters

{
  "error": "invalid_request",
  "message": "Parameters cannot be empty"
}

401 Unauthenticated

{
  "error": "unauthorized",
  "message": "Missing or invalid access token"
}

The actual error field names are determined by what the backend returns.

HTTP response status codes

Status code Description
200 Success (OK)
400 Invalid parameters (Bad request)
401 Requires authentication
403 Forbidden
404 Resource not found (Not found)
500 Internal system error (Internal server error)

Request example

Parameter description

This endpoint allows anonymous access; for authentication, you may provide an AtomGit user access token.

Replace <owner> with the organization path (the address path of an enterprise, organization, or individual); replace <kanban_id> with the board ID; replace <repo> with the repository path.

cURL

curl -X POST 'https://api.atomgit.com/api/v5/org/<owner>/kanban/<kanban_id>/add_item' \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -d '{"repo": "<repo>", "issue_iids": [1, 2], "pr_iids": [3]}'

JavaScript

// Native fetch (Node.js 18+ / browser)
const response = await fetch("https://api.atomgit.com/api/v5/org/<owner>/kanban/<kanban_id>/add_item", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Accept": "application/json"
  },
  body: JSON.stringify({
    repo: "<repo>",
    issue_iids: [1, 2],
    pr_iids: [3]
  })
});

if (!response.ok) {
  throw new Error(`Request failed: ${response.status}`);
}

const data = await response.json();
console.log(data);

Python

import requests

resp = requests.post(
    "https://api.atomgit.com/api/v5/org/<owner>/kanban/<kanban_id>/add_item",
    json={
        "repo": "<repo>",
        "issue_iids": [1, 2],
        "pr_iids": [3],
    },
    headers={"Accept": "application/json"},
    timeout=10,
)
resp.raise_for_status()

print(resp.json())

Response example

Status code: 200

{}

Error codes

Error code Description
400 Invalid parameters or unparseable request
401 Unauthenticated or invalid credentials
403 Forbidden
404 Request path does not exist
500 Internal system error

Markdown source: View on AtomGit·Content from the open-source project gitcode-dev/atomgit-api-doc