> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.loreos.app/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.loreos.app/_mcp/server.

# Delete a character

DELETE https://api.loreos.app/v1/characters/{slug}

Irreversibly delete one app-owned character.

The canonical row becomes a tombstone and the slug remains reserved. Authored
versions, locale versions, visual inventory, session rows, and background
ledgers are purged/redacted by an async deletion request.

Reference: https://docs.loreos.app/api-reference/characters/delete-character

## Authentication

- `Authorization` header (bearer token, required) — LoreOS runtime API key (`ck_...`), sent as `Authorization: Bearer <key>`.

## Servers

- `https://api.loreos.app` (Production, default)
- `http://127.0.0.1:8000` (Local development)

## Request

### Path parameters

- `slug` (string, required)

### Query parameters

- `confirm_slug` (string, required) — Required exact canonical slug confirmation for irreversible delete.
- `force` (boolean, optional, default: false) — When false, the character must be archived before deletion.
- `reason` (string, optional, nullable) — Optional developer-visible deletion reason for audit/history.

## Response

### 202

Successful Response

- `schema_version` ("v0", required) — LoreOS success-envelope version.
- `data` (CharacterDeleteData, required) — Accepted permanent-delete request (HTTP 202). ``status`` is always ``deleted`` because the canonical row is tombstoned synchronously; ``request_status`` carries the asynchronous purge state. The timestamp and error fields are absent when the character was already purged.
- `next_actions` (list of V1NextAction, required) — Concrete follow-up API actions; empty when no action is required.

## Errors

### 404 Not Found Error

Character not found in the caller's app.

- `detail` (V1ErrorDetail, required) — Stable public error core; domain-specific fields may be added alongside it.

### 409 Conflict Error

Character must be archived first unless force=true.

- `detail` (V1ErrorDetail, required) — Stable public error core; domain-specific fields may be added alongside it.

### 422 Unprocessable Entity Error

confirm_slug does not match the canonical slug.

- `detail` (V1ErrorDetail, required) — Stable public error core; domain-specific fields may be added alongside it.

## Types

### CharacterDeleteData

Accepted permanent-delete request (HTTP 202). ``status`` is always ``deleted`` because the canonical row is tombstoned synchronously; ``request_status`` carries the asynchronous purge state. The timestamp and error fields are absent when the character was already purged.

- `character_id` (string, required)
- `slug` (string, required)
- `canonical_slug` (string, required)
- `requested_slug` (string, required)
- `lifecycle_state` ("deleted", required)
- `status` ("deleted", required)
- `request_status` (enum, required) — Asynchronous purge state; poll until 'completed' or terminal 'failed'.
  - Allowed values: `requested`, `running`, `completed`, `failed`
- `purge_summary` (map from string to any, required)
- `background_features` (CharacterFeatureDeactivation, required) — Best-effort background schedule teardown reported alongside lifecycle state. Deactivation is best-effort by design: the lifecycle transition is already committed when this runs, so a Temporal outage populates ``failed`` instead of failing the request.
- `deletion_request_id` (string, optional, nullable) — Absent when the character was already fully purged.
- `error_message` (string, optional, nullable)
- `requested_at` (datetime, optional, nullable)
- `started_at` (datetime, optional, nullable)
- `completed_at` (datetime, optional, nullable)

### V1NextAction

- `command` (string, required) — The next API command an agent can execute.
- `description` (string, required) — Why or when to execute the command.

### V1ErrorDetail

Stable public error core; domain-specific fields may be added alongside it.

- `code` (string, required)
- `message` (string, required)
- `fix` (string, required)

### CharacterFeatureDeactivation

Best-effort background schedule teardown reported alongside lifecycle state. Deactivation is best-effort by design: the lifecycle transition is already committed when this runs, so a Temporal outage populates ``failed`` instead of failing the request.

- `deactivated` (list of CharacterFeatureSchedule, required)
- `already_off` (list of CharacterFeatureSchedule, required) — Schedules that were already absent; off is the desired state.
- `failed` (list of CharacterFeatureFailure, required)

### CharacterFeatureSchedule

- `feature` (string, required)
- `schedule_id` (string, required)

### CharacterFeatureFailure

- `feature` (string, required)
- `schedule_id` (string, required)
- `error` (string, required) — Exception type and truncated message.

## Examples

**Response**

```json
{
  "schema_version": "string",
  "data": {
    "character_id": "string",
    "slug": "string",
    "canonical_slug": "string",
    "requested_slug": "string",
    "lifecycle_state": "string",
    "status": "string",
    "request_status": "requested",
    "purge_summary": {},
    "background_features": {
      "deactivated": [
        {
          "feature": "string",
          "schedule_id": "string"
        }
      ],
      "already_off": [
        {
          "feature": "string",
          "schedule_id": "string"
        }
      ],
      "failed": [
        {
          "feature": "string",
          "schedule_id": "string",
          "error": "string"
        }
      ]
    },
    "deletion_request_id": "string",
    "error_message": "string",
    "requested_at": "2024-01-15T09:30:00Z",
    "started_at": "2024-01-15T09:30:00Z",
    "completed_at": "2024-01-15T09:30:00Z"
  },
  "next_actions": [
    {
      "command": "string",
      "description": "string"
    }
  ]
}
```

**SDK Code**

```python
import requests

url = "https://api.loreos.app/v1/characters/slug"

querystring = {"confirm_slug":"confirm_slug"}

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

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

print(response.json())
```

```javascript
const url = 'https://api.loreos.app/v1/characters/slug?confirm_slug=confirm_slug';
const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.loreos.app/v1/characters/slug?confirm_slug=confirm_slug"

	req, _ := http.NewRequest("DELETE", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.loreos.app/v1/characters/slug?confirm_slug=confirm_slug")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.delete("https://api.loreos.app/v1/characters/slug?confirm_slug=confirm_slug")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('DELETE', 'https://api.loreos.app/v1/characters/slug?confirm_slug=confirm_slug', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.loreos.app/v1/characters/slug?confirm_slug=confirm_slug");
var request = new RestRequest(Method.DELETE);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.loreos.app/v1/characters/slug?confirm_slug=confirm_slug")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "DELETE"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```