---
title: "Delete a memory file"
---

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

# Delete a memory file

Path: CloudRaker Workspace API › Workspace Agents

`DELETE /agents/{agentRef}/memory/files`

Deletes one file. `expectBlob` is the blob you read; a changed file answers 409.

## Authentication

- `bearerAuth`, http, header `Authorization`

## Path parameters

- `agentRef` (`deleteAgentMemoryFile.path.agentRef`; string, required)

## Query parameters

- `path` (`deleteAgentMemoryFile.query.path`; string, required)
  - minLength 1; maxLength 512
- `expectBlob` (`deleteAgentMemoryFile.query.expectBlob`; string, required)
  - pattern `^[0-9a-f]{40}$`

## Code samples

### cURL

```bash
curl --request DELETE \
  --url 'https://api.cloudraker.com/agents/<agentRef>/memory/files?path=string&expectBlob=string' \
  --header 'Authorization: Bearer <token>'
```

### TypeScript

```typescript
const url = 'https://api.cloudraker.com/agents/<agentRef>/memory/files?path=string&expectBlob=string';
const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://api.cloudraker.com/agents/<agentRef>/memory/files?path=string&expectBlob=string"

headers = {"Authorization": "Bearer <token>"}

response = requests.delete(url, headers=headers)

print(response.text)
```

## Responses

### 200

Nothing changed; the unchanged head

#### Example

```json
{
  "data": {
    "sha": "string",
    "branch": "string",
    "changed": 0
  }
}
```

- `data` (`deleteAgentMemoryFile.response.200.data`; object, required)
  - `sha` (`deleteAgentMemoryFile.response.200.data.sha`; string | null, required)
  - `branch` (`deleteAgentMemoryFile.response.200.data.branch`; string, required)
  - `changed` (`deleteAgentMemoryFile.response.200.data.changed`; number, required) — How many files the version changed.

### 201

The new version

#### Example

```json
{
  "data": {
    "sha": "string",
    "branch": "string",
    "changed": 0
  }
}
```

- `data` (`deleteAgentMemoryFile.response.201.data`; object, required)
  - `sha` (`deleteAgentMemoryFile.response.201.data.sha`; string | null, required)
  - `branch` (`deleteAgentMemoryFile.response.201.data.branch`; string, required)
  - `changed` (`deleteAgentMemoryFile.response.201.data.changed`; number, required) — How many files the version changed.

### 400

Validation Error

#### Example

```json
{
  "success": false,
  "error": [
    null
  ],
  "data": null
}
```

- `success` (`deleteAgentMemoryFile.response.400.success`; boolean, required)
  - one of `false`
- `error` (`deleteAgentMemoryFile.response.400.error`; array<unknown>, required)
- `data` (`deleteAgentMemoryFile.response.400.data`; unknown, required)

### 403

`personal_account_required` — only the owner may open this memory.

#### Example

```json
{
  "error": "string",
  "error_code": "string",
  "issues": [
    {
      "path": "string",
      "code": "string",
      "message": "string"
    }
  ]
}
```

- `error` (`deleteAgentMemoryFile.response.403.error`; string, required) — The sentence a human reads.
- `error_code` (`deleteAgentMemoryFile.response.403.error_code`; string, required) — The stable snake_case branch key.
- `issues` (`deleteAgentMemoryFile.response.403.issues`; array<object>, optional) — Per-field detail, present only on a validation failure.
  - `path` (`deleteAgentMemoryFile.response.403.issues.path`; string, required)
  - `code` (`deleteAgentMemoryFile.response.403.issues.code`; string, required)
  - `message` (`deleteAgentMemoryFile.response.403.issues.message`; string, required)

### 404

`memory_not_available` — this memory does not exist for you.

#### Example

```json
{
  "error": "string",
  "error_code": "string",
  "issues": [
    {
      "path": "string",
      "code": "string",
      "message": "string"
    }
  ]
}
```

- `error` (`deleteAgentMemoryFile.response.404.error`; string, required) — The sentence a human reads.
- `error_code` (`deleteAgentMemoryFile.response.404.error_code`; string, required) — The stable snake_case branch key.
- `issues` (`deleteAgentMemoryFile.response.404.issues`; array<object>, optional) — Per-field detail, present only on a validation failure.
  - `path` (`deleteAgentMemoryFile.response.404.issues.path`; string, required)
  - `code` (`deleteAgentMemoryFile.response.404.issues.code`; string, required)
  - `message` (`deleteAgentMemoryFile.response.404.issues.message`; string, required)

### 409

`expect_failed` (`paths`) — the file changed since you read it; `stale_parent` or `conflict` — the history moved.

#### Example

```json
{
  "error": "string",
  "error_code": "string",
  "issues": [
    {
      "path": "string",
      "code": "string",
      "message": "string"
    }
  ]
}
```

- `error` (`deleteAgentMemoryFile.response.409.error`; string, required) — The sentence a human reads.
- `error_code` (`deleteAgentMemoryFile.response.409.error_code`; string, required) — The stable snake_case branch key.
- `issues` (`deleteAgentMemoryFile.response.409.issues`; array<object>, optional) — Per-field detail, present only on a validation failure.
  - `path` (`deleteAgentMemoryFile.response.409.issues.path`; string, required)
  - `code` (`deleteAgentMemoryFile.response.409.issues.code`; string, required)
  - `message` (`deleteAgentMemoryFile.response.409.issues.message`; string, required)

### 422

`lint_failed` — `violations` lists each file rule the change broke.

#### Example

```json
{
  "error": "string",
  "error_code": "string",
  "issues": [
    {
      "path": "string",
      "code": "string",
      "message": "string"
    }
  ]
}
```

- `error` (`deleteAgentMemoryFile.response.422.error`; string, required) — The sentence a human reads.
- `error_code` (`deleteAgentMemoryFile.response.422.error_code`; string, required) — The stable snake_case branch key.
- `issues` (`deleteAgentMemoryFile.response.422.issues`; array<object>, optional) — Per-field detail, present only on a validation failure.
  - `path` (`deleteAgentMemoryFile.response.422.issues.path`; string, required)
  - `code` (`deleteAgentMemoryFile.response.422.issues.code`; string, required)
  - `message` (`deleteAgentMemoryFile.response.422.issues.message`; string, required)


Source: https://docs.cloudraker.com/workspace/api/workspace-agents/delete-agent-memory-file/index.md
