# Delete memories by scope

`POST /memory_stores/{name}:delete_scope`

Deletes all memories in the specified memory store that are associated with the provided scope.

## Parameters

### Path parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `name` | `string` | Yes | The name of the memory store. |

### Query parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `api-version` | `string` | Yes | The API version to use for this operation. |

### Header parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `Foundry-Features` | `enum` | Yes | A feature flag opt-in required when using preview operations or modifying persisted preview resources. _Constant:_ `MemoryStores=V1Preview` |

## Request Body

Content-Type: `application/json` *(required)*

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `scope` | `string` | Yes | The namespace that logically groups and isolates memories to delete, such as a user ID. |

## Responses

### 200 — The request has succeeded.

Content-Type: `application/json`

Response for deleting memories from a scope.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `object` | `enum` | Yes | The object type. Always 'memory_store.scope.deleted'. _Constant:_ `memory_store.scope.deleted` |
| `name` | `string` | Yes | The name of the memory store. |
| `scope` | `string` | Yes | The scope from which memories were deleted. |
| `deleted` | `boolean` | Yes | Whether the deletion operation was successful. |

### 4XX — Client error

Content-Type: `application/json`

Error response for API failures.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `error` | `OpenAI.Error` | Yes |  |

#### `error` — `OpenAI.Error`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `code` | `string \| null` | Yes |  |
| `message` | `string` | Yes |  |
| `param` | `string \| null` | No |  |
| `type` | `string` | No |  |
| `details` | `OpenAI.Error[]` | No |  |
| `additionalInfo` | `object` | No |  |
| `debugInfo` | `object` | No |  |

### 5XX — Server error

Content-Type: `application/json`

Error response for API failures.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `error` | `OpenAI.Error` | Yes |  |

#### `error` — `OpenAI.Error`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `code` | `string \| null` | Yes |  |
| `message` | `string` | Yes |  |
| `param` | `string \| null` | No |  |
| `type` | `string` | No |  |
| `details` | `OpenAI.Error[]` | No |  |
| `additionalInfo` | `object` | No |  |
| `debugInfo` | `object` | No |  |
