> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dscloud.pt/llms.txt
> Use this file to discover all available pages before exploring further.

# Mover ou renomear arquivo

> Move o arquivo ou altera seu nome.

Move o arquivo ou altera seu nome. Se `to` não tiver extensão, a API o interpreta como diretório e mantém o nome original.

## Parâmetros

**appId** `string` *required*

ID da aplicação, obtido no painel ou em `response.applications[].id` ao [consultar a conta](https://docs.dscloud.pt/api-reference/endpoint/users/me.md).

**path** `string` *required*

Caminho de origem.

**to** `string` *required*

Caminho de destino.

## Resposta

HTTP 200. `response` é um objeto. Seus campos também podem aparecer no nível superior por compatibilidade.

```json HTTP 200 theme={null}
{
  "status": "success",
  "code": "SUCCESS",
  "response": {
    "from": "notas.txt",
    "to": "release.txt"
  },
  "from": "notas.txt",
  "to": "release.txt",
  "success": true
}
```

## Erros desta operação

| HTTP | Código | Quando ocorre |
| - | - | - |
| 400 | `MISSING_PARAMETERS` | Informe `path` e `to`. |
| 403 | `RESTRICTED_FILE` | Arquivo protegido. |

```bash cURL theme={null}
: "${DSCLOUD_API_BASE_URL:=https://api.dscloud.pt/v3}"
curl --proto '=https' --fail-with-body --request PATCH \
  --header "Authorization: ${DSCLOUD_API_KEY:?Defina DSCLOUD_API_KEY}" \
  --header "Content-Type: application/json" \
  --data '{"path":"/notas.txt","to":"/release.txt"}' \
  "${DSCLOUD_API_BASE_URL%/}/apps/${DSCLOUD_APP_ID:?Defina DSCLOUD_APP_ID}/files"
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.