REST API Guide

REST API Guide

Overview

The CMTC (Configuration Management Toolkit Cloud) REST API provides programmatic access to your project's configuration management data hosted in Jira Cloud. It allows you to manage Bundles, Component Versions, Subcomponents, Subprojects, and Attributes — the same resources available through the CMTC Jira UI — via standard HTTP requests authenticated with OAuth 2.0.

This video walks you through everything end-to-end: enabling the REST API, setting up OAuth 2.0, obtaining an access token with Postman, and making your first request. Watch the full walkthrough on YouTube:
Accessing REST API of an Atlassian Forge App


Prerequisites

Before making API calls, complete the following steps:

Step 1 — Enable REST API access (site admin required)

A Jira site administrator must enable the "Connected Apps" REST API feature for the CMTC Forge app. Follow Atlassian's instructions here: Access REST APIs exposed by a Forge app

Step 2 — Create an OAuth 2.0 (3LO) integration

Create an OAuth 2.0 integration in the Atlassian Developer Console and configure it to access the CMTC app. Follow the instructions in the same document (Step 2: Create an OAuth 2.0 integration).

Step 3 — Activate the authorizing user (open the app once in the UI)

The CMTC REST API executes every request as the user who authorized the OAuth token (asUser). Before that user's token can be used, the account must have opened the CMTC app in the Jira UI at least once. This first UI interaction establishes the per-user app context that the API relies on.

Log in to Jira as the account that will authorize the token, open any CMTC app page (for example the Bundles page on a project you can access), and accept the app authorization prompt if one appears. This is a one-time action per account. If you skip it, API calls will fail even though the OAuth flow and access token look correct.

This most commonly affects service / automation accounts (for example a Jenkins account) that only ever call the API headlessly and never open the app in the UI. Unlike Step 1, this step is performed by the token-authorizing user themselves and does not require a site administrator.


Selecting Scopes

When configuring your OAuth 2.0 integration (Step 2 above), you will be prompted to select scopes.

Always include this Forge scope — it grants the ability to call Forge app functions:

Scope

Description

Scope

Description

read:forge-app:jira

Required to invoke Forge app functions

In addition, select the CMTC custom scopes your integration needs. Each resource page below lists its specific scopes. Select only what you need.


Resources

Resource

Sub-page

Resource

Sub-page

Bundles

Bundle REST API

Component Versions

Component Version REST API

Subcomponents

Subcomponent REST API

Subprojects

Subproject REST API

Attributes

Attributes REST API


App Information

When linking your OAuth 2.0 integration to the CMTC Forge app, use the following identifier:

Field

Value

Field

Value

App ID

1c7d1303-ca83-4431-a72f-01252b3d024c


Base URL

All CMTC API endpoints are served under the following base URL:

https://api.atlassian.com/svc/jira/<cloud-id>/apps/<app-id>_<env-id>

You can find this URL under Manage apps → Connected apps → Configuration Management Toolkit Cloud → View app details → App REST APIs once the REST API is enabled. The URL only appears in this section after the REST API has been enabled.

Part

Description

How to Find

Part

Description

How to Find

cloud-id

Your Jira Cloud instance ID

GET https://api.atlassian.com/oauth/token/accessible-resources

app-id

CMTC Forge App ID

1c7d1303-ca83-4431-a72f-01252b3d024c (fixed, see above)

env-id

Environment ID of the CMTC installation

Run forge install list or check Developer Console


Making Requests

All requests must include a Bearer token in the Authorization header, obtained via the OAuth 2.0 flow configured in the prerequisites.

Authorization: Bearer <your-access-token>

 

Example 1 — Get bundles for a project (GET)

curl -X GET \ "https://api.atlassian.com/svc/jira/<cloud-id>/apps/<app-id>_<env-id>/v1/project/<projectId>/bundles" \ -H "Authorization: Bearer $ACCESS_TOKEN" \ -H "Content-Type: application/json"

Replace <projectId> with the numeric Jira project ID (e.g. 10104). You can optionally add ?startDate=2024-01-01&endDate=2024-12-31 to filter by release date.

Example 2 — Create a bundle (POST)

curl -X POST \ "https://api.atlassian.com/svc/jira/<cloud-id>/apps/<app-id>_<env-id>/v1/bundles" \ -H "Authorization: Bearer $ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "newBundle": { "name": "My Bundle", "projectId": "10104", "startDate": "2024-01-01", "releaseDate": "2024-06-01", "archived": false, "description": "Initial bundle", "released": true }, "copyVersionInfoToProjectVersion": false }'

Full API reference: The complete OpenAPI specification (openapi.yaml) is attached to this Confluence page. Import it into Postman, Insomnia, or any OpenAPI-compatible tool to explore all available endpoints.

 


Response Format

All CMTC API responses follow a consistent envelope format:

// Success { "data": <result> } // Error { "error": "Error message" }

Successful responses always wrap the result in a data field. Errors return an error string describing what went wrong.