Skip to content
atlassian-dc-mcp
Esc
↑↓navigate↵open⌘Jpreview

Update content

Updates a piece of Content, including changes to content status.

To update a piece of content you must increment the version.number, supplying the number of the version you are creating. The title property can be updated on all content, body can be updated on all content that has a body (not attachments). For instance to update the content of a blogpost that currently has version 1:

PUT /rest/api/content/456

{
   "version":{
       "number": 2
   },
   "title":"My new title",
   "type":"page",
   "body":{
        "storage":{
           "value":"<p>New page data.</p>",
           "representation":"storage"
      }
   }
}

To update a page and change its parent page, supply the ancestors property with the request with the parent as the first ancestor i.e. to move a page to be a child of page with ID 789:

PUT /rest/api/content/456

{
   "version":{
       "number": 2
   },
   "ancestors": [{"id":789}],
   "type":"page",
   "body":{
        "storage":{
           "value":"<p>New page data.</p>",
           "representation":"storage"
      }
   }
}

Changing status

To restore a piece of content that has the status of trashed the content must have it’s version incremented, and status set to current. No other field modifications will be performed when restoring a piece of content from the trash.

Request example to restore from trash: {"id": "557059","status": "current","version": {"number": 2}}

If the content you’re updating has a draft, specifying status=draft will delete that draft and the body of the content will be replaced with the body specified in the request.

Request example to delete a draft:

PUT: http://localhost:9096/confluence/rest/api/content/2149384202?status=draft

{
   "id":"2149384202",
   "status":"current",
   "version":{
      "number":4
   },
   "space":{
      "key":"TST"
   },
   "type":"page",
   "title":"page title",
   "body":{
      "storage":{
         "value":"<p>New page data.</p>",
         "representation":"storage"
      }
   }
}

Changing page position

To set page position, supply the position property in the request body with a positive integer. Content with unset positions will have a position value of -1. To unset a content position, supply position property with -1.

Request example to set page position to 1

PUT /rest/api/content/2149384202

{
   "id":"2149384202",
   "version":{
      "number":2
   },
   "type":"page",
   "title":"page title",
   "position":1
}

Request example to unset page position

PUT /rest/api/content/2149384202

{
   "id":"2149384202",
   "version":{
      "number":2
   },
   "type":"page",
   "position":-1
}
PUT/rest/api/content/{contentId}
Path parameters
contentIdstringrequired

the id of the content.

Query parameters
asyncReconciliationboolean
default: false
conflictPolicystring

the conflict policy, default value: <code>abort<code>

statusstring

the existing status of the content to be updated.

Request body
requiredapplication/json

new content to be created.

idstring
typestring
statusstring
titlestring
linksobject
spaceSpace
Show properties
idinteger<int64>
keystring
namestring
statusstring
iconReferenceIcon
Show properties
expandedboolean
idPropertiesobject
descriptionobject
homepageReferenceContent
Show properties
expandedboolean
idPropertiesobject
linksobject
typestring
metadataobject
retentionPolicyReferenceSpaceRetentionPolicy
Show properties
expandedboolean
idPropertiesobject
historyHistory
Show properties
previousVersionReferenceVersion
Show properties
expandedboolean
idPropertiesobject
nextVersionReferenceVersion
Show properties
expandedboolean
idPropertiesobject
lastUpdatedReferenceVersion
Show properties
expandedboolean
idPropertiesobject
latestboolean
createdByPerson
Show properties
profilePictureIcon
Show properties
pathstring
widthinteger<int32>
heightinteger<int32>
isDefaultboolean
displayNamestring
typestring
createdDatestring<date-time>
contributorsReferenceContributors
Show properties
expandedboolean
idPropertiesobject
lastUpdatedRefReferenceVersion
Show properties
expandedboolean
idPropertiesobject
nextVersionRefReferenceVersion
Show properties
expandedboolean
idPropertiesobject
previousVersionRefReferenceVersion
Show properties
expandedboolean
idPropertiesobject
contentParentRefReferenceContent
Show properties
expandedboolean
idPropertiesobject
versionVersion
Show properties
byPerson
Show properties
profilePictureIcon
displayNamestring
typestring
whenstring<date-time>
messagestring
numberinteger<int32>
minorEditboolean
hiddenboolean
syncRevstring
contentReferenceContent
Show properties
expandedboolean
idPropertiesobject
contentRefReferenceContent
Show properties
expandedboolean
idPropertiesobject
ancestorsContent[]
Show properties
Array of Content
Circular reference to Content.
positioninteger<int32>
operationsOperationCheckResult[]
Show properties
Array of OperationCheckResult
operationstring
targetTypestring
childrenobject
descendantsobject
containerContainer
bodyobject
metadataobject
extensionsobject
restrictionsobject
historyRefReferenceHistory
Show properties
expandedboolean
idPropertiesobject
spaceRefReferenceSpace
Show properties
expandedboolean
idPropertiesobject
containerRefReferenceContainer
Show properties
expandedboolean
idPropertiesobject
versionRefReferenceVersion
Show properties
expandedboolean
idPropertiesobject
Responses
200

Returns a full JSON representation of a piece of content.

idstring
typestring
statusstring
titlestring
linksobject
spaceSpace
Show properties
idinteger<int64>
keystring
namestring
statusstring
iconReferenceIcon
Show properties
expandedboolean
idPropertiesobject
descriptionobject
homepageReferenceContent
Show properties
expandedboolean
idPropertiesobject
linksobject
typestring
metadataobject
retentionPolicyReferenceSpaceRetentionPolicy
Show properties
expandedboolean
idPropertiesobject
historyHistory
Show properties
previousVersionReferenceVersion
Show properties
expandedboolean
idPropertiesobject
nextVersionReferenceVersion
Show properties
expandedboolean
idPropertiesobject
lastUpdatedReferenceVersion
Show properties
expandedboolean
idPropertiesobject
latestboolean
createdByPerson
Show properties
profilePictureIcon
Show properties
pathstring
widthinteger<int32>
heightinteger<int32>
isDefaultboolean
displayNamestring
typestring
createdDatestring<date-time>
contributorsReferenceContributors
Show properties
expandedboolean
idPropertiesobject
lastUpdatedRefReferenceVersion
Show properties
expandedboolean
idPropertiesobject
nextVersionRefReferenceVersion
Show properties
expandedboolean
idPropertiesobject
previousVersionRefReferenceVersion
Show properties
expandedboolean
idPropertiesobject
contentParentRefReferenceContent
Show properties
expandedboolean
idPropertiesobject
versionVersion
Show properties
byPerson
Show properties
profilePictureIcon
displayNamestring
typestring
whenstring<date-time>
messagestring
numberinteger<int32>
minorEditboolean
hiddenboolean
syncRevstring
contentReferenceContent
Show properties
expandedboolean
idPropertiesobject
contentRefReferenceContent
Show properties
expandedboolean
idPropertiesobject
ancestorsContent[]
Show properties
Array of Content
Circular reference to Content.
positioninteger<int32>
operationsOperationCheckResult[]
Show properties
Array of OperationCheckResult
operationstring
targetTypestring
childrenobject
descendantsobject
containerContainer
bodyobject
metadataobject
extensionsobject
restrictionsobject
historyRefReferenceHistory
Show properties
expandedboolean
idPropertiesobject
spaceRefReferenceSpace
Show properties
expandedboolean
idPropertiesobject
containerRefReferenceContainer
Show properties
expandedboolean
idPropertiesobject
versionRefReferenceVersion
Show properties
expandedboolean
idPropertiesobject
400

Returned if no space or no content type, or setup a wrong version type set to content, or status param is not draft and status content is current

statusCodeinteger<int32>
dataValidationResult
Show properties
authorizedboolean
validboolean
errorsobject
successfulboolean
allowedInReadOnlyModeboolean
messagestring
reasonstring
404

Returned if can not find draft with current content.

statusCodeinteger<int32>
dataValidationResult
Show properties
authorizedboolean
validboolean
errorsobject
successfulboolean
allowedInReadOnlyModeboolean
messagestring
reasonstring
Try it
Server
Parameters
Bodyapplication/json
Request
curl -X PUT 'http://example.com:7990/confluence/rest/api/content/string' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "id": "123456",
  "type": "page",
  "status": "current",
  "title": "My Page",
  "links": {},
  "space": {
    "id": 123456,
    "key": "TEST",
    "name": "Test Space",
    "status": "current",
    "icon": {
      "expanded": true,
      "idProperties": {}
    },
    "description": {},
    "homepage": {
      "expanded": true,
      "idProperties": {}
    },
    "links": {},
    "type": "global",
    "metadata": {
      "labels": [
        "label1",
        "label2"
      ]
    },
    "retentionPolicy": {
      "expanded": true,
      "idProperties": {}
    }
  },
  "history": {
    "previousVersion": {
      "expanded": true,
      "idProperties": {}
    },
    "nextVersion": {
      "expanded": true,
      "idProperties": {}
    },
    "lastUpdated": {
      "expanded": true,
      "idProperties": {}
    },
    "latest": true,
    "createdBy": {
      "profilePicture": {
        "path": "http://www.example.com/path/to/image.png",
        "width": 16,
        "height": 16,
        "isDefault": true
      },
      "displayName": "Joe Smith",
      "type": "string"
    },
    "createdDate": "2020-01-01T00:00:00Z",
    "contributors": {
      "expanded": true,
      "idProperties": {}
    },
    "lastUpdatedRef": {
      "expanded": true,
      "idProperties": {}
    },
    "nextVersionRef": {
      "expanded": true,
      "idProperties": {}
    },
    "previousVersionRef": {
      "expanded": true,
      "idProperties": {}
    },
    "contentParentRef": {
      "expanded": true,
      "idProperties": {}
    }
  },
  "version": {
    "by": {
      "profilePicture": {
        "path": "http://www.example.com/path/to/image.png",
        "width": 16,
        "height": 16,
        "isDefault": true
      },
      "displayName": "Joe Smith",
      "type": "string"
    },
    "when": "2020-01-01T00:00:00Z",
    "message": "A message",
    "number": 1,
    "minorEdit": true,
    "hidden": true,
    "syncRev": "123456",
    "content": {
      "expanded": true,
      "idProperties": {}
    },
    "contentRef": {
      "expanded": true,
      "idProperties": {}
    }
  },
  "ancestors": [
    {}
  ],
  "position": 1,
  "operations": [
    {
      "operation": "read",
      "targetType": "page"
    }
  ],
  "children": {},
  "descendants": {},
  "container": null,
  "body": {},
  "metadata": {
    "key": "value"
  },
  "extensions": {
    "key": "value"
  },
  "restrictions": {
    "use": {
      "operation": "use",
      "restrictions": []
    }
  },
  "historyRef": {
    "expanded": true,
    "idProperties": {}
  },
  "spaceRef": {
    "expanded": true,
    "idProperties": {}
  },
  "containerRef": {
    "expanded": true,
    "idProperties": {}
  },
  "versionRef": {
    "expanded": true,
    "idProperties": {}
  }
}'
Response
{
  "id": "123456",
  "type": "page",
  "status": "current",
  "title": "My Page",
  "links": {},
  "space": {
    "id": 123456,
    "key": "TEST",
    "name": "Test Space",
    "status": "current",
    "icon": {
      "expanded": true,
      "idProperties": {}
    },
    "description": {},
    "homepage": {
      "expanded": true,
      "idProperties": {}
    },
    "links": {},
    "type": "global",
    "metadata": {
      "labels": [
        "label1",
        "label2"
      ]
    },
    "retentionPolicy": {
      "expanded": true,
      "idProperties": {}
    }
  },
  "history": {
    "previousVersion": {
      "expanded": true,
      "idProperties": {}
    },
    "nextVersion": {
      "expanded": true,
      "idProperties": {}
    },
    "lastUpdated": {
      "expanded": true,
      "idProperties": {}
    },
    "latest": true,
    "createdBy": {
      "profilePicture": {
        "path": "http://www.example.com/path/to/image.png",
        "width": 16,
        "height": 16,
        "isDefault": true
      },
      "displayName": "Joe Smith",
      "type": "string"
    },
    "createdDate": "2020-01-01T00:00:00Z",
    "contributors": {
      "expanded": true,
      "idProperties": {}
    },
    "lastUpdatedRef": {
      "expanded": true,
      "idProperties": {}
    },
    "nextVersionRef": {
      "expanded": true,
      "idProperties": {}
    },
    "previousVersionRef": {
      "expanded": true,
      "idProperties": {}
    },
    "contentParentRef": {
      "expanded": true,
      "idProperties": {}
    }
  },
  "version": {
    "by": {
      "profilePicture": {
        "path": "http://www.example.com/path/to/image.png",
        "width": 16,
        "height": 16,
        "isDefault": true
      },
      "displayName": "Joe Smith",
      "type": "string"
    },
    "when": "2020-01-01T00:00:00Z",
    "message": "A message",
    "number": 1,
    "minorEdit": true,
    "hidden": true,
    "syncRev": "123456",
    "content": {
      "expanded": true,
      "idProperties": {}
    },
    "contentRef": {
      "expanded": true,
      "idProperties": {}
    }
  },
  "ancestors": [
    {}
  ],
  "position": 1,
  "operations": [
    {
      "operation": "read",
      "targetType": "page"
    }
  ],
  "children": {},
  "descendants": {},
  "container": null,
  "body": {},
  "metadata": {
    "key": "value"
  },
  "extensions": {
    "key": "value"
  },
  "restrictions": {
    "use": {
      "operation": "use",
      "restrictions": []
    }
  },
  "historyRef": {
    "expanded": true,
    "idProperties": {}
  },
  "spaceRef": {
    "expanded": true,
    "idProperties": {}
  },
  "containerRef": {
    "expanded": true,
    "idProperties": {}
  },
  "versionRef": {
    "expanded": true,
    "idProperties": {}
  }
}

Was this page helpful?