---
ai:
  exclude: true
search:
  tags:
    - Attachments
    - POST
seo:
  description: >-
    Move an attachment to a… Reference for the POST
    /rest/api/content/{id}/child/attachment/{attachmentId}/move endpoint in the
    Confluence Data Center API.
sidebar:
  label: Move attachment
  badge: POST
title: Move attachment
type: openapi-operation
---
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`

**Responses**

- `204` — Returned if the operation is successful.
- `400` — Returned if the attachment id is invalid.
- `404` — Returned if no attachment is found for the attachmentId.
