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.

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

ContentBodyCreate

This object is used when creating or updating content.

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.

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
curl --request PUT \
  --url 'https://your-domain.atlassian.net/wiki/rest/api/template' \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --data '{
  "templateId": "<string>",
  "name": "<string>",
  "templateType": "page",
  "body": {
    "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.

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

ContentBodyCreate

This object is used when creating or updating content.

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.

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
curl --request POST \
  --url 'https://your-domain.atlassian.net/wiki/rest/api/template' \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --data '{
  "name": "<string>",
  "templateType": "<string>",
  "body": {
    "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).

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
curl --request GET \
  --url 'https://your-domain.atlassian.net/wiki/rest/api/template/blueprint' \
  --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.

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
curl --request GET \
  --url 'https://your-domain.atlassian.net/wiki/rest/api/template/page' \
  --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.

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
curl --request GET \
  --url 'https://your-domain.atlassian.net/wiki/rest/api/template/{contentTemplateId}' \
  --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.

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
curl --request DELETE \
  --url 'https://your-domain.atlassian.net/wiki/rest/api/template/{contentTemplateId}'

Responses

Returned if the template has been successfully been deleted.

Rate this page: