---
title: "Revert a memory version"
---

> 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.

# Revert a memory version

Path: CloudRaker Workspace API › My assistant

`POST /me/assistant/memory-repo/history/{sha}/revert`

Saves a new version that undoes the given one. A later edit to the same files answers 409 `conflict`.

## Authentication

- `bearerAuth`, http, header `Authorization`

## Path parameters

- `sha` (`revertMyAssistantMemoryRepoCommit.path.sha`; string, required)
  - pattern `^[0-9a-f]{40}$`

## Code samples

### cURL

```bash
curl --request POST \
  --url 'https://api.cloudraker.com/me/assistant/memory-repo/history/<sha>/revert' \
  --header 'Authorization: Bearer <token>'
```

### TypeScript

```typescript
const url = 'https://api.cloudraker.com/me/assistant/memory-repo/history/<sha>/revert';
const options = {method: 'POST', 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/me/assistant/memory-repo/history/<sha>/revert"

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

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

print(response.text)
```

## Responses

### 200

Nothing changed; the unchanged head

#### Example

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

- `data` (`revertMyAssistantMemoryRepoCommit.response.200.data`; object, required)
  - `sha` (`revertMyAssistantMemoryRepoCommit.response.200.data.sha`; string | null, required)
  - `branch` (`revertMyAssistantMemoryRepoCommit.response.200.data.branch`; string, required)
  - `changed` (`revertMyAssistantMemoryRepoCommit.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` (`revertMyAssistantMemoryRepoCommit.response.201.data`; object, required)
  - `sha` (`revertMyAssistantMemoryRepoCommit.response.201.data.sha`; string | null, required)
  - `branch` (`revertMyAssistantMemoryRepoCommit.response.201.data.branch`; string, required)
  - `changed` (`revertMyAssistantMemoryRepoCommit.response.201.data.changed`; number, required) — How many files the version changed.

### 400

Validation Error

#### Example

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

- `success` (`revertMyAssistantMemoryRepoCommit.response.400.success`; boolean, required)
  - one of `false`
- `error` (`revertMyAssistantMemoryRepoCommit.response.400.error`; array<unknown>, required)
- `data` (`revertMyAssistantMemoryRepoCommit.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` (`revertMyAssistantMemoryRepoCommit.response.403.error`; string, required) — The sentence a human reads.
- `error_code` (`revertMyAssistantMemoryRepoCommit.response.403.error_code`; string, required) — The stable snake_case branch key.
- `issues` (`revertMyAssistantMemoryRepoCommit.response.403.issues`; array<object>, optional) — Per-field detail, present only on a validation failure.
  - `path` (`revertMyAssistantMemoryRepoCommit.response.403.issues.path`; string, required)
  - `code` (`revertMyAssistantMemoryRepoCommit.response.403.issues.code`; string, required)
  - `message` (`revertMyAssistantMemoryRepoCommit.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` (`revertMyAssistantMemoryRepoCommit.response.404.error`; string, required) — The sentence a human reads.
- `error_code` (`revertMyAssistantMemoryRepoCommit.response.404.error_code`; string, required) — The stable snake_case branch key.
- `issues` (`revertMyAssistantMemoryRepoCommit.response.404.issues`; array<object>, optional) — Per-field detail, present only on a validation failure.
  - `path` (`revertMyAssistantMemoryRepoCommit.response.404.issues.path`; string, required)
  - `code` (`revertMyAssistantMemoryRepoCommit.response.404.issues.code`; string, required)
  - `message` (`revertMyAssistantMemoryRepoCommit.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` (`revertMyAssistantMemoryRepoCommit.response.409.error`; string, required) — The sentence a human reads.
- `error_code` (`revertMyAssistantMemoryRepoCommit.response.409.error_code`; string, required) — The stable snake_case branch key.
- `issues` (`revertMyAssistantMemoryRepoCommit.response.409.issues`; array<object>, optional) — Per-field detail, present only on a validation failure.
  - `path` (`revertMyAssistantMemoryRepoCommit.response.409.issues.path`; string, required)
  - `code` (`revertMyAssistantMemoryRepoCommit.response.409.issues.code`; string, required)
  - `message` (`revertMyAssistantMemoryRepoCommit.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` (`revertMyAssistantMemoryRepoCommit.response.422.error`; string, required) — The sentence a human reads.
- `error_code` (`revertMyAssistantMemoryRepoCommit.response.422.error_code`; string, required) — The stable snake_case branch key.
- `issues` (`revertMyAssistantMemoryRepoCommit.response.422.issues`; array<object>, optional) — Per-field detail, present only on a validation failure.
  - `path` (`revertMyAssistantMemoryRepoCommit.response.422.issues.path`; string, required)
  - `code` (`revertMyAssistantMemoryRepoCommit.response.422.issues.code`; string, required)
  - `message` (`revertMyAssistantMemoryRepoCommit.response.422.issues.message`; string, required)


Source: https://docs.cloudraker.com/workspace/api/my-assistant/revert-my-assistant-memory-repo-commit/index.md
