Audit
Content
Content - attachments
Content body
Content - children and descendants
Content - macro body
Content comments
Content labels
Content permissions
Content properties
Content restrictions
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:

Template

Update content template

PUT /wiki/rest/api/template

Updates a content template. Note, blueprint templates cannot be updated via the REST API.

Permissions required: 'Admin' permission for the space to create a space template or 'Confluence Administrator' global permission to create a global template.

Connect app scope requiredWRITE

OAuth scopes required
write:confluence-content

Request

Body parameters

This object is used to update content templates.

templateId Required

string

The ID of the template being updated.

name Required

string

The name of the template. Set to the current name if this field is not being updated.

templateType Required

string

The type of the template. Set to page.

Valid values: page

body Required

ContentTemplateBodyCreate

The body of the new content. Does not apply to attachments. Only one body format should be specified as the property for this object, e.g. storage.

Note, editor2 format is used by Atlassian only. anonymous_export_view is the same as export_view format but only content viewable by an anonymous user is included.

description

string

A description of the template.

Max length: 100
labels

Array<Label>

Labels for the template.

space

object

The key for the space of the template. Required if the template is a space template. Set this to the current space.key.

Nullable: true
Additional Properties

anything

Extra properties of any type may be provided to this object.

Example

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
curl --request PUT \
  --url 'https://your-domain.atlassian.net/wiki/rest/api/template' \
  --header 'Authorization: Bearer <access_token>' \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --data '{
  "templateId": "<string>",
  "name": "<string>",
  "templateType": "page",
  "body": {
    "view": {
      "value": "<string>",
      "representation": "view"
    },
    "export_view": {
      "value": "<string>",
      "representation": "view"
    },
    "styled_view": {
      "value": "<string>",
      "representation": "view"
    },
    "storage": {
      "value": "<string>",
      "representation": "view"
    },
    "editor": {
      "value": "<string>",
      "representation": "view"
    },
    "editor2": {
      "value": "<string>",
      "representation": "view"
    },
    "wiki": {
      "value": "<string>",
      "representation": "view"
    },
    "atlas_doc_format": {
      "value": "<string>",
      "representation": "view"
    },
    "anonymous_export_view": {
      "value": "<string>",
      "representation": "view"
    }
  },
  "description": "<string>",
  "labels": [
    {
      "prefix": "<string>",
      "name": "<string>",
      "id": "<string>",
      "label": "<string>"
    }
  ],
  "space": {
    "key": "<string>"
  }
}'

Responses

Returned if the template is updated.

Content typeValue
application/json

ContentTemplate

Create content template

POST /wiki/rest/api/template

Creates a new content template. Note, blueprint templates cannot be created via the REST API.

Permissions required: 'Admin' permission for the space to create a space template or 'Confluence Administrator' global permission to create a global template.

Connect app scope requiredWRITE

OAuth scopes required
write:confluence-content

Request

Body parameters

This object is used to create content templates.

name Required

string

The name of the new template.

templateType Required

string

The type of the new template. Set to page.

body Required

ContentTemplateBodyCreate

The body of the new content. Does not apply to attachments. Only one body format should be specified as the property for this object, e.g. storage.

Note, editor2 format is used by Atlassian only. anonymous_export_view is the same as export_view format but only content viewable by an anonymous user is included.

description

string

A description of the new template.

Max length: 255
labels

Array<Label>

Labels for the new template.

space

object

The key for the space of the new template. Only applies to space templates. If the spaceKey is not specified, the template will be created as a global template.

Nullable: true
Additional Properties

anything

Extra properties of any type may be provided to this object.

Example

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
curl --request POST \
  --url 'https://your-domain.atlassian.net/wiki/rest/api/template' \
  --header 'Authorization: Bearer <access_token>' \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --data '{
  "name": "<string>",
  "templateType": "<string>",
  "body": {
    "view": {
      "value": "<string>",
      "representation": "view"
    },
    "export_view": {
      "value": "<string>",
      "representation": "view"
    },
    "styled_view": {
      "value": "<string>",
      "representation": "view"
    },
    "storage": {
      "value": "<string>",
      "representation": "view"
    },
    "editor": {
      "value": "<string>",
      "representation": "view"
    },
    "editor2": {
      "value": "<string>",
      "representation": "view"
    },
    "wiki": {
      "value": "<string>",
      "representation": "view"
    },
    "atlas_doc_format": {
      "value": "<string>",
      "representation": "view"
    },
    "anonymous_export_view": {
      "value": "<string>",
      "representation": "view"
    }
  },
  "description": "<string>",
  "labels": [
    {
      "prefix": "<string>",
      "name": "<string>",
      "id": "<string>",
      "label": "<string>"
    }
  ],
  "space": {
    "key": "<string>"
  }
}'

Responses

Returned if the template is created.

Content typeValue
application/json

ContentTemplate

Get blueprint templates

GET /wiki/rest/api/template/blueprint

Returns all templates provided by blueprints. Use this method to retrieve all global blueprint templates or all blueprint templates in a space.

Note, all global blueprints are inherited by each space. Space blueprints can be customised without affecting the global blueprints.

Permissions required: Permission to access the Confluence site ('Can use' global permission).

Connect app scope requiredREAD

OAuth scopes required
read:confluence-content.summary

Request

Query parameters
spaceKey

string

The key of the space to be queried for templates. If the spaceKey is not specified, global blueprint templates will be returned.

start

integer

The starting index of the returned templates.

Default: 0, Minimum: 0, Format: int32
limit

integer

The maximum number of templates to return per page. Note, this may be restricted by fixed system limits.

Default: 25, Minimum: 0, Format: int32
expand

Array<string>

A multi-value parameter indicating which properties of the template to expand.

  • body returns the content of the template in storage format.
Style: form

Valid values: body

Example

1
2
3
4
curl --request GET \
  --url 'https://your-domain.atlassian.net/wiki/rest/api/template/blueprint' \
  --header 'Authorization: Bearer <access_token>' \
  --header 'Accept: application/json'

Responses

Returned if the requested templates are returned.

Content typeValue
application/json

BlueprintTemplateArray

Get content templates

GET /wiki/rest/api/template/page

Returns all content templates. Use this method to retrieve all global content templates or all content templates in a space.

Permissions required: 'Admin' permission for the space to view space templates and 'Confluence Administrator' global permission to view global templates.

Connect app scope requiredREAD

OAuth scopes required
read:confluence-content.summary

Request

Query parameters
spaceKey

string

The key of the space to be queried for templates. If the spaceKey is not specified, global templates will be returned.

start

integer

The starting index of the returned templates.

Default: 0, Minimum: 0, Format: int32
limit

integer

The maximum number of templates to return per page. Note, this may be restricted by fixed system limits.

Default: 25, Minimum: 0, Format: int32
expand

Array<string>

A multi-value parameter indicating which properties of the template to expand.

  • body returns the content of the template in storage format.
Style: form

Valid values: body

Example

1
2
3
4
curl --request GET \
  --url 'https://your-domain.atlassian.net/wiki/rest/api/template/page' \
  --header 'Authorization: Bearer <access_token>' \
  --header 'Accept: application/json'

Responses

Returned if the requested templates are returned.

Content typeValue
application/json

ContentTemplateArray

Get content template

GET /wiki/rest/api/template/{contentTemplateId}

Returns a content template. This includes information about template, like the name, the space or blueprint that the template is in, the body of the template, and more.

Permissions required: 'Admin' permission for the space to view space templates and 'Confluence Administrator' global permission to view global templates.

Connect app scope requiredREAD

OAuth scopes required
read:confluence-content.summary

Request

Path parameters
contentTemplateId Required

string

The ID of the content template to be returned.

Example

1
2
3
4
curl --request GET \
  --url 'https://your-domain.atlassian.net/wiki/rest/api/template/{contentTemplateId}' \
  --header 'Authorization: Bearer <access_token>' \
  --header 'Accept: application/json'

Responses

Returned if the requested template is returned.

Content typeValue
application/json

ContentTemplate

Remove template

DELETE /wiki/rest/api/template/{contentTemplateId}

Deletes a template. This results in different actions depending on the type of template:

  • If the template is a content template, it is deleted.
  • If the template is a modified space-level blueprint template, it reverts to the template inherited from the global-level blueprint template.
  • If the template is a modified global-level blueprint template, it reverts to the default global-level blueprint template.

    Note, unmodified blueprint templates cannot be deleted.

Connect app scope requiredDELETE

OAuth scopes required
write:confluence-content

Request

Path parameters
contentTemplateId Required

string

The ID of the template to be deleted.

Example

1
2
3
curl --request DELETE \
  --url 'https://your-domain.atlassian.net/wiki/rest/api/template/{contentTemplateId}' \
  --header 'Authorization: Bearer <access_token>'

Responses

Returned if the template has been successfully been deleted.

A schema has not been defined for this response code.

Rate this page: