# Rename or move a file

Renames or moves a file.

```http
PATCH https://api.pozy.ai/v1/files/{fileId}
```

- Area: Email, calendar & files / Files
- Auth: Authorization: Bearer pz_live_...

## Path parameters

- `fileId` (string, required)

## Request body

Content type: `application/json`

- `accountId`, string, required
- `name`, string: Up to 255 characters
- `parentId`, string

## Example request

```bash
curl -X PATCH "https://api.pozy.ai/v1/files/6035bf6bd3aac3067c336c50" \
  -H "Authorization: Bearer $POZY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "accountId": "696e0b682d0a31188e7a2ba9"
}'
```

```ts
const res = await fetch("https://api.pozy.ai/v1/files/6035bf6bd3aac3067c336c50", {
  method: "PATCH",
  headers: {
    Authorization: `Bearer ${process.env.POZY_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    accountId: "696e0b682d0a31188e7a2ba9"
  }),
});
const data = await res.json();
if (!res.ok) throw new Error(data?.error ?? `Request failed with status ${res.status}`);
console.log(data);
```

```python
import os
import requests

resp = requests.patch(
    "https://api.pozy.ai/v1/files/6035bf6bd3aac3067c336c50",
    headers={"Authorization": f"Bearer {os.environ['POZY_API_KEY']}"},
    json={
        "accountId": "696e0b682d0a31188e7a2ba9",
    },
    timeout=30,
)
resp.raise_for_status()
print(resp.json())
```

## Response 200

- `data`, object
  - `id`, string, required
  - `accountId`, string, required
  - `provider`, string, required: One of `google`, `microsoft`
  - `name`, string, required
  - `kind`, string, required: One of `file`, `folder`
  - `mimeType`, string, required: Can be null
  - `size`, integer, required: Can be null
  - `parentId`, string, required: Can be null
  - `webUrl`, string, required: Can be null
  - `downloadable`, boolean, required
  - `exportMimeType`, string: Can be null
  - `createdAt`, string (date-time), required: Can be null
  - `modifiedAt`, string (date-time), required: Can be null
  - `trashed`, boolean, required

```json
{
  "data": {
    "id": "6bfebd43ddc270f6d2c56fc5",
    "accountId": "696e0b682d0a31188e7a2ba9",
    "provider": "google",
    "name": "Acme",
    "kind": "file",
    "mimeType": "image/jpeg",
    "size": 482133,
    "parentId": "6009d4193e17fdf7d162c048",
    "webUrl": "https://pozy.ai/media/example-1.jpg",
    "downloadable": true,
    "exportMimeType": "image/jpeg",
    "createdAt": "2026-10-02T09:00:00.000Z",
    "modifiedAt": "2026-10-02T09:00:00.000Z",
    "trashed": true
  }
}
```
