Use the Support Time Contract Management REST API to create, import, read, update and delete support contracts, and read their calculated logged hours, remaining hours and status. It works on Jira Cloud and Jira Service Management Cloud sites where the app is installed.
This page is for developers. Administrators enable the API for their site and share the complete base URL with the integration owner.
Every endpoint needs an active app license, App REST APIs enabled on the site, an edition that allows the API, and the matching app scope plus read:forge-app:jira. Advanced has API access; Standard has access only when a rollout has explicitly enabled it for your site. Atlassian Forge app REST APIs are a Preview feature.
Quick start
-
Check that the app license is active and that Advanced is selected, or that the API rollout is enabled for your Standard site.
-
Ask a site or organization admin to enable App REST APIs in Atlassian Administration → Apps → Sites → your site → Connected apps → Support Time Contract Management → View app details → Details. Copy the complete base URL shown there.
-
Create an OAuth 2.0 integration in the Atlassian Developer Console. Add the app scopes you need and the Jira scope read:forge-app:jira.
-
Set a callback URL, obtain consent using the console-generated authorization URL, and exchange the returned code for an access token.
-
Call GET /v1/contracts with Authorization: Bearer <access token>.
# Copy the complete base URL from Connected apps; omit the trailing slash.
export BASE="https://YOUR-SITE.atlassian.net/gateway/api/svc/jira/apps/9e9acd44-46e1-48d1-8466-a07544d57455_ENVIRONMENT-ID"
# Supply ACCESS_TOKEN from your integration’s secure token store.
curl --request GET --url "$BASE/v1/contracts" \
--header "Authorization: Bearer $ACCESS_TOKEN" \
--header "Accept: application/json"
Authentication and authorization
Choose the base URL
All endpoint paths are relative to BASE. These two URL forms reach the same app installation. Prefer copying the complete URL from Connected apps after enabling the API.
https://api.atlassian.com/svc/jira/{cloudId}/apps/{appId}_{environmentId}
https://{your-site}.atlassian.net/gateway/api/svc/jira/apps/{appId}_{environmentId}
|
Part |
Value |
|---|---|
|
appId |
9e9acd44-46e1-48d1-8466-a07544d57455; the same for every site. |
|
environmentId |
The released app environment. Use the value in the full base URL displayed in Connected apps or the Developer Console. |
|
cloudId |
Your site’s cloud ID; available at https://{your-site}.atlassian.net/_edge/tenant_info. |
1. Enable the API for the site
-
Open Atlassian Administration and select your organization.
-
Go to Apps → Sites and select the site where Support Time Contract Management is installed.
-
Select Connected apps, find Support Time Contract Management, then choose View app details.
-
On the Details tab, find App REST APIs, choose Enable app REST APIs and confirm. Share the displayed base URL with your developer.
App REST APIs are off by default. Disabling the setting immediately blocks API calls from every integration on that site; the app’s Jira interface continues to work.
2. Configure an OAuth 2.0 integration
-
In the Atlassian Developer Console, choose Create → OAuth 2.0 integration and name it. The person connecting the integration must be a member of the target site.
-
Open Permissions → Add Marketplace or custom app. Select your site, Support Time Contract Management and its released environment. Select only the app scopes required by your integration, then choose Add.
-
Under Permissions, also add the Jira product scope read:forge-app:jira.
-
Under Authorization, set your callback URL. Start with the authorization URL generated by the console for the app. Preserve its sns parameter, which associates the custom scopes with this app.
-
For unattended token renewal, include offline_access in the scope parameter. Scopes are separated by spaces; URL-encode spaces as %20. Obtain consent for the selected site.
Do not remove sns from the authorization URL. Without it, Atlassian drops the custom app scopes and calls fail with 403 Missing required scopes.
Open Atlassian Developer Console
Scopes and operations
|
Scope |
Display name |
Grants |
|---|---|---|
|
read:contract:custom |
Read support contracts |
List and get contracts; get import status |
|
write:contract:custom |
Create/update support contracts |
Create, import and update contracts |
|
delete:contract:custom |
Delete support contracts |
Delete contracts |
|
read:forge-app:jira |
Atlassian product scope |
Required on every call |
|
Operation |
Method and path |
App scope |
Success status |
|---|---|---|---|
|
Create a contract |
POST /v1/contracts |
write:contract:custom |
201; 200 for an existing externalId |
|
Import contracts |
POST /v1/contracts/import |
write:contract:custom |
202 |
|
Get import status |
GET /v1/imports/{batchId} |
read:contract:custom |
200 |
|
List contracts |
GET /v1/contracts |
read:contract:custom |
200 |
|
Get a contract |
GET /v1/contracts/{id} |
read:contract:custom |
200 |
|
Update a contract |
PUT /v1/contracts/{id} |
write:contract:custom |
200 |
|
Delete a contract |
DELETE /v1/contracts/{id} |
delete:contract:custom |
200 |
Write access does not include read access. An integration that imports contracts and polls their progress needs both write:contract:custom and read:contract:custom, plus read:forge-app:jira.
3. Exchange the authorization code for tokens
Open the console-generated authorization URL, choose the site and accept. Atlassian redirects to your callback with a code parameter. Exchange the code promptly; it is valid for only a few minutes.
curl --request POST --url https://auth.atlassian.com/oauth/token \
--header "Content-Type: application/json" \
--data '{
"grant_type": "authorization_code",
"client_id": "YOUR_CLIENT_ID",
"client_secret": "YOUR_CLIENT_SECRET",
"code": "CODE_FROM_CALLBACK",
"redirect_uri": "YOUR_CALLBACK_URL"
}'
The response contains access_token, token_type, expires_in and scope. If offline_access was granted, it also contains refresh_token. Access tokens last one hour; use expires_in to schedule renewal. Store tokens and client secrets securely.
Renew access
curl --request POST --url https://auth.atlassian.com/oauth/token \
--header "Content-Type: application/json" \
--data '{
"grant_type": "refresh_token",
"client_id": "YOUR_CLIENT_ID",
"client_secret": "YOUR_CLIENT_SECRET",
"refresh_token": "YOUR_LATEST_REFRESH_TOKEN"
}'
Refresh tokens rotate: store the new refresh token returned by each renewal. A refresh token expires after 90 days without use. Reuse an access token across calls.
4. Send the token on every request
GET /v1/contracts HTTP/1.1
Authorization: Bearer {access_token}
Accept: application/json
POST and PUT requests also require Content-Type: application/json.
Who the API acts as
Calls are attributed to the Atlassian account that gave consent; that account is recorded on contract changes. For unattended integrations, use a dedicated Atlassian account.
API access is site-wide within each granted operation scope. The API does not perform a separate Jira permission check on each call. The Support Time Contract global permission controls access to the Jira UI only; it does not restrict API calls. Grant integration scopes accordingly.
Contracts are app-managed data. Logged hours are computed as the app across the JSM projects configured in its settings. The caller’s individual project permissions do not change which worklogs are summed.
Atlassian: access REST APIs exposed by a Forge app
Related documentation