REST API - Templates

General informations

Available since v. 1.3.*


Get all global templates

Available for all confluence users

Method type - GET

URL:

  • {CONFLUENCE_URL}/rest/extender/1.0/template/global

Response format - JSON

Example response:

{
  "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 - GET

URL:

  • {CONFLUENCE_URL}/rest/extender/1.0/template/global/{TEMPLATE_NAME}

Response format - JSON

Example response:

Example 1
{
  "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>"
  }
}


Get space templates

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

Method type - GET

URL:

  • {CONFLUENCE_URL}/rest/extender/1.0/template/space/{SPACE_ID_OR_KEY}

Response format - JSON

Example response:

Example 1
{
  "templates": [
    {
      "name": "Space template title",
      "description": null,
      "title": "Space template title",
      "content": "<at:declarations /><p>Space template body</p>"
    }
  ]
}




Get template by id

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

Method type - GET

URL:

  • {CONFLUENCE_URL}/rest/extender/1.0/template/page/{TEMPLATE_ID}

Response format - JSON

Example response:

Example 1
{
  "template": {
    "name": "Space template title",
    "description": null,
    "title": "Space template title",
    "content": "<at:declarations /><p>Space template body</p>"
  }
}




Delete template by id

Global template - available for confluence Administrators

Page template - available for space Administrators

Method type - DELETE

URL:

  • {CONFLUENCE_URL}/rest/extender/1.0/template/page/{TEMPLATE_ID}

Response format - JSON

Example response:

Example 1
{
  "message": "Template with id '123411' has been deleted",
  "status": "success"
}