Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

General informations

Table of Contents
excludeGeneral.*
Info

REST API - Templates is available since v. 1.3.*

Available since v. 2.27.0


Get all global templates

Available for all Confluence Users

Method type -

Status
colourGreen
titleGET

URL: {CONFLUENCE_URL}/rest/extender/1.0/template/global

Response format:

Status
titleJSON

Code Block
breakoutModewide
languagejs
{
  "templates": [
    {
      "name": "test global templates",
      "description": null,
      "title": "test global templates",
      "content": "<at:declarations /><ac:layout><ac:layout-section ac:type=\"single\"><ac:layout-cell><p>global templates body</p></ac:layout-cell></ac:layout-section><ac:layout-section ac:type=\"single\"><ac:layout-cell><table><tbody><tr><th>Row 1</th><th>Row 2</th><th>Row 3</th></tr><tr><td>A</td><td>B</td><td>C</td></tr><tr><td>Q</td><td>W</td><td>E</td></tr></tbody></table></ac:layout-cell></ac:layout-section></ac:layout>"
    }
  ]
}


Get global template by name

Available for all Confluence Users

Method type - 

Status
colourGreen
titleGET

URL: {CONFLUENCE_URL}/rest/extender/1.0/template/global/{TEMPLATE_NAME}

Response format:

Status
titleJSON

Code Block
breakoutModewide
languagejs
{
  "template": {
    "name": "test global templates",
    "description": null,
    "title": "test global templates",
    "content": "<at:declarations /><ac:layout><ac:layout-section ac:type=\"single\"><ac:layout-cell><p>global templates body</p></ac:layout-cell></ac:layout-section><ac:layout-section ac:type=\"single\"><ac:layout-cell><table><tbody><tr><th>Row 1</th><th>Row 2</th><th>Row 3</th></tr><tr><td>A</td><td>B</td><td>C</td></tr><tr><td>Q</td><td>W</td><td>E</td></tr></tbody></table></ac:layout-cell></ac:layout-section></ac:layout>"
  }
}


Create global template

Available for Confluence Administrators

Method type: 

Status
colourYellow
titlePUT

URL: {CONFLUENCE_URL}/rest/extender/1.0/template/global/create

Request format:

Status
titleJSON

Code Block
breakoutModewide
languagejs
{
	"title": "Template title",
	"description": "Template description",
	"content": "<p>Template content</p>"
}
  • title - required - template title

  • description - optional - template description

  • content - optional - template content in Confluence Storage Format


Edit global template

Available for Confluence Administrators

Method type - 

Status
colourYellow
titlePUT

URL: {CONFLUENCE_URL}/rest/extender/1.0/template/global/edit/{TEMPLATE_ID}

Request format:

Status
titleJSON

Code Block
breakoutModewide
languagejs
{
	"title": "Template title",
	"description": "Template description",
	"content": "<p>Template content</p>"
}
  • title - optional - template title

  • description - optional - template description

  • content - optional - template content in Confluence Storage Format


Get space templates

Available for Confluence Administrators, space Administrators and all users with VIEW and CREATE PAGE permission in this specific space

Method type -

Status
colourGreen
titleGET

URL: {CONFLUENCE_URL}/rest/extender/1.0/template/space/{SPACE_ID_OR_KEY}

Response format:

Status
titleJSON

Code Block
breakoutModewide
languagejs
{
  "templates": [
    {
      "name": "Space template title",
      "description": null,
      "title": "Space template title",
      "content": "<at:declarations /><p>Space template body</p>"
    }
  ]
}


Create space template

Available for Confluence Administrators and space Administrators

Method type: 

Status
colourYellow
titlePUT

URL: {CONFLUENCE_URL}/rest/extender/1.0/template/space/{SPACE_ID_OR_KEY}/create

Request format:

Status
titleJSON

Code Block
breakoutModewide
languagejs
{
	"title": "Template title",
	"description": "Template description",
	"content": "<p>Template content</p>"
}
  • title - required - template title

  • description - optional - template description

  • content - optional - template content in Confluence Storage Format


Edit space template

Available for Confluence Administrators and space Administrators

Method type: 

Status
colourYellow
titlePUT

URL: {CONFLUENCE_URL}/rest/extender/1.0/template/space/{SPACE_ID_OR_KEY}/edit/{TEMPLATE_ID}

Request format:

Status
titleJSON

Code Block
breakoutModewide
languagejs
{
	"title": "Template title",
	"description": "Template description",
	"content": "<p>Template content</p>"
}
  • title - optional - template title

  • description - optional - template description

  • content - optional - template content in Confluence Storage Format


Get template by

id

ID

Available for Confluence Administrators, space Administrators and all users with VIEW and CREATE PAGE permission in space of this template

Method type - 

Status
colourGreen
titleGET

URL: {CONFLUENCE_URL}/rest/extender/1.0/template/page/{TEMPLATE_ID}

Response format:

Status
titleJSON

Code Block
breakoutModewide
languagejs
{
  "template": {
    "name": "Space template title",
    "description": null,
    "title": "Space template title",
    "content": "<at:declarations /><p>Space template body</p>"
  }
}


Delete template by

id

ID

Global template - available for Confluence Administrators

Page template - available for space Administrators

Method type - 

Status
colourRed
titleDELETE

URL: {CONFLUENCE_URL}/rest/extender/1.0/template/page/{TEMPLATE_ID}

Response format:

Status
titleJSON

Code Block
breakoutModewide
languagejs
{
  "message": "Template with id '123411' has been deleted",
  "status": "success"
}