Audit
Analytics
Content
Content - attachments
Content body
Content - children and descendants
Content - macro body
Content comments
Content labels
Content permissions
Content properties
Content restrictions
Content states
Content versions
Content watches
Dynamic modules
Experimental
Group
Inline tasks
Label info
Long-running task
Relation
Search
Settings
Space
Space permissions
Space properties
Space settings
Template
Themes
Users

Rate this page:

Content states

Get content state

GET /wiki/rest/api/content/{id}/state

Gets the current content state of the draft or current version of content. To specify the draft version, set the parameter status to draft, otherwise archived or current will get the relevant published state.

Permissions required: Permission to view the content.

Connect app scope requiredREAD

Request

Path parameters
id Required

string

The id of the content whose content state is of interest.

Query parameters
status

string

Set status to one of [current,draft,archived].

Valid values: current, draft, archived

Example

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// This sample uses Atlassian Forge
// https://developer.atlassian.com/platform/forge/
//
// This API resource doesn't support Oauth2 (3LO). See alternate authorization methods:
// https://developer.atlassian.com/cloud/confluence/rest/#auth
import api, { route } from "@forge/api";

const response = await api.requestConfluence(route`/wiki/rest/api/content/{id}/state`, {
  headers: {
    'Accept': 'application/json'
  }
});

console.log(`Response: ${response.status} ${response.statusText}`);
console.log(await response.json());

Responses

Returned if permission allows viewing of content.

Content typeValue
application/json

ContentStateResponse

Set the content state of a content and publishes a new version of the content.

PUT /wiki/rest/api/content/{id}/state

Sets the content state of the content specified and creates a new version (publishes the content without changing the body) of the content with the new state.

Permissions required: Permission to edit the content.

Connect app scope requiredWRITE

Request

Path parameters
id Required

string

The Id of the content whose content state is to be set.

Query parameters
status

string

Status of content onto which state will be placed. If draft, then draft state will change. If current, state will be placed onto a new version of the content with same body as previous version.

Valid values: current, draft

Body parameters
name

string

name of content state

color

string

Color of state. Must be in 6 digit hex form (#FFFFFF)

id

integer

id of state

Format: int64

Example

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// This sample uses Atlassian Forge
// https://developer.atlassian.com/platform/forge/
//
// This API resource doesn't support Oauth2 (3LO). See alternate authorization methods:
// https://developer.atlassian.com/cloud/confluence/rest/#auth
import api, { route } from "@forge/api";

const response = await api.requestConfluence(route`/wiki/rest/api/content/{id}/state`, {
  method: 'PUT',
  headers: {
    'Accept': 'application/json'
  }
});

console.log(`Response: ${response.status} ${response.statusText}`);
console.log(await response.json());

Responses

Returned if content state is set successfully.

Content typeValue
application/json

ContentStateResponse

Removes the content state of a content and publishes a new version.

DELETE /wiki/rest/api/content/{id}/state

Removes the content state of the content specified and creates a new version (publishes the content without changing the body) of the content with the new status.

Permissions required: Permission to edit the content.

Connect app scope requiredDELETE

Request

Path parameters
id Required

string

The Id of the content whose content state is to be set.

Query parameters
status

string

status of content state from which to delete state. Can be draft or archived

Valid values: current, draft

Example

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// This sample uses Atlassian Forge
// https://developer.atlassian.com/platform/forge/
//
// This API resource doesn't support Oauth2 (3LO). See alternate authorization methods:
// https://developer.atlassian.com/cloud/confluence/rest/#auth
import api, { route } from "@forge/api";

const response = await api.requestConfluence(route`/wiki/rest/api/content/{id}/state`, {
  method: 'DELETE',
  headers: {
    'Accept': 'application/json'
  }
});

console.log(`Response: ${response.status} ${response.statusText}`);
console.log(await response.json());

Responses

Returned if content state is removed from content.

Content typeValue
application/json

ContentStateResponse

Gets available content states for content.

GET /wiki/rest/api/content/{id}/state/available

Gets content states that are available for the content to be set as.

Permissions required: Permission to edit the content.

Connect app scope requiredREAD

Request

Path parameters
id Required

string

id of content to get available states for

Example

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// This sample uses Atlassian Forge
// https://developer.atlassian.com/platform/forge/
//
// This API resource doesn't support Oauth2 (3LO). See alternate authorization methods:
// https://developer.atlassian.com/cloud/confluence/rest/#auth
import api, { route } from "@forge/api";

const response = await api.requestConfluence(route`/wiki/rest/api/content/{id}/state/available`, {
  headers: {
    'Accept': 'application/json'
  }
});

console.log(`Response: ${response.status} ${response.statusText}`);
console.log(await response.json());

Responses

Returned if the content is found and permission is valid.

Content typeValue
application/json

AvailableContentStates

Get content state settings for space

GET /wiki/rest/api/space/{spaceKey}/state/settings

Get object describing whether content states are allowed at all, if custom content states or space content states are restricted, and a list of space content states allowed for the space if they are not restricted.

Permissions required: Space admin permission

Connect app scope requiredREAD

Request

Path parameters
spaceKey Required

string

The key of the space to be queried for its content state settings.

Example

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// This sample uses Atlassian Forge
// https://developer.atlassian.com/platform/forge/
//
// This API resource doesn't support Oauth2 (3LO). See alternate authorization methods:
// https://developer.atlassian.com/cloud/confluence/rest/#auth
import api, { route } from "@forge/api";

const response = await api.requestConfluence(route`/wiki/rest/api/space/{spaceKey}/state/settings`, {
  headers: {
    'Accept': 'application/json'
  }
});

console.log(`Response: ${response.status} ${response.statusText}`);
console.log(await response.json());

Responses

Returned if the requested space exists, and user has space admin permission.

Content typeValue
application/json

ContentStateSettings

Rate this page: