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"
/rest/api/content/{id}/child/attachment/{attachmentId}/moveattachmentIdstringrequiredthe id of the attachment to upload the new file for.
idstringrequiredThe id of the content the attachment is on.
newNamestringnewContentIdstringReturned if the operation is successful.
Returned if the attachment id is invalid.
statusCodeinteger<int32>dataValidationResultShow propertiesHide properties
authorizedbooleanvalidbooleanerrorsobjectsuccessfulbooleanallowedInReadOnlyModebooleanmessagestringreasonstringReturned if no attachment is found for the attachmentId.
statusCodeinteger<int32>dataValidationResultShow propertiesHide properties
authorizedbooleanvalidbooleanerrorsobjectsuccessfulbooleanallowedInReadOnlyModebooleanmessagestringreasonstring