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

Move attachment

Move an attachment to a different content entity object.

When moving the attachment, the name of the attachment can be updated as well.

In order to protect against XSRF attacks, because this method accepts multipart/form-data, it has XSRF protection on it. This means you must submit a header of X-Atlassian-Token: nocheck with the request, otherwise it will be blocked.

A simple example to move an attachment with id “456” in a container with id “123” to a container with “789”:

curl -D- -u admin:admin -X POST -H "X-Atlassian-Token: nocheck" "http://myhost/rest/api/content/123/child/attachment/456/move?newContentId=789"

An example to move the same file, while also renaming it to “my-new-name”:

curl -D- -u admin:admin -X POST -H "X-Atlassian-Token: nocheck" "http://myhost/rest/api/content/123/child/attachment/456/move?newContentId=789&newName=my-new-name"

This can also be used to only rename an attachment:

curl -D- -u admin:admin -X POST -H "X-Atlassian-Token: nocheck" "http://myhost/rest/api/content/123/child/attachment/456/move?newContentId=123&newName=my-new-name"

POST/rest/api/content/{id}/child/attachment/{attachmentId}/move
Path parameters
attachmentIdstringrequired

the id of the attachment to upload the new file for.

idstringrequired

The id of the content the attachment is on.

Query parameters
newNamestring
newContentIdstring
Responses
204

Returned if the operation is successful.

400

Returned if the attachment id is invalid.

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

Returned if no attachment is found for the attachmentId.

statusCodeinteger<int32>
dataValidationResult
Show properties
authorizedboolean
validboolean
errorsobject
successfulboolean
allowedInReadOnlyModeboolean
messagestring
reasonstring
Try it
Server
Parameters
Request
curl -X POST 'http://example.com:7990/confluence/rest/api/content/string/child/attachment/string/move' \
  -H 'Accept: application/json'
Response
Returned if the operation is successful.

Was this page helpful?