## Documentation Index

Fetch the complete documentation index at: [/llms.txt](https://docs.cognigy.com/llms.txt)

Use this file to discover all available pages before exploring further.

---

### Reset a Context

**POST**  
`/v2.0/sessions/{sessionId}/context/reset`

#### Example Request

**cURL**
```bash
curl --request POST \
  --url https://api-trial.cognigy.ai/new/v2.0/sessions/{sessionId}/context/reset \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "flowReferenceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "entryPoint": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "userId": "mail@example.com"
}
'```

**Python**  
```python
import requests

url = "https://api-trial.cognigy.ai/new/v2.0/sessions/{sessionId}/context/reset"

payload = {
    "flowReferenceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "entryPoint": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "userId": "mail@example.com"
}
headers = {
    "X-API-Key": "<api-key>",
    "Content-Type": "application/json"
}

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

print(response.text)
```

**JavaScript (Fetch)**  
```javascript
const options = {
  method: 'POST',
  headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
  body: JSON.stringify({
    flowReferenceId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
    entryPoint: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
    userId: 'mail@example.com'
  })
};

fetch('https://api-trial.cognigy.ai/new/v2.0/sessions/{sessionId}/context/reset', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
```

#### Response Codes

- **200**: Returns the reset context.
- **400**: Bad Request - Validation failed. Missing payload.
- **401**: Unauthorized - Please provide a valid API Key.
- **404**: Not Found - The specified session ID does not exist.

---

#### Authorizations

| Name        | Type   | Required | Description                                      |
|-------------|--------|----------|--------------------------------------------------|
| X-API-Key   | header | Yes      | Supply the API Key in the HTTP header.

#### Headers

| Name    | Type          | Description                                     |
|---------|---------------|-------------------------------------------------|
| Accept  | enum<string>  | Media types that the client expects in the response.  Default: `application/json`.

Available options:
- `application/json`
- `application/xml`
- `text/xml`
- `text/csv`

#### Path Parameters

| Name       | Type   | Required | Description                 |
|------------|--------|----------|-----------------------------|
| sessionId  | string | Yes      | The Id of the Session

#### Body

Payload (application/json):

- `flowReferenceId`: string <uuid> (required)
- `entryPoint`: string <uuid> (required)
- `userId`: string (required)

**Example Body**:
```json
{
  "flowReferenceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "entryPoint": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "userId": "mail@example.com"
}
```

---

### Response Structure

Successful response returns an object.

---

#### Error Responses

- **400 - Bad Request**  
```json
{
  "type": "Bad Request",
  "title": "Bad Request Error",
  "status": 400,
  "detail": "Validation failed. Missing payload.",
  "instance": "/v2.0/flows/5ce7c2d833ea1e04d7e6c432",
  "code": 1000,
  "traceId": "api--f84324f4-98eb-4f02-abdd-375a2e6c3c1f"
}
```

- **401 - Unauthorized**  
```json
{
  "type": "Unauthorized",
  "title": "Unauthorized Error",
  "status": 401,
  "detail": "<string>",
  "instance": "/v2.0/flows/5ce7c2d833ea1e04d7e6c432",
  "code": 401,
  "traceId": "api--f84324f4-98eb-4f02-abdd-375a2e6c3c1f"
}
```

- Additional status codes include **402**, **403**, **404**, **405**, **409**, **413**, **500**, **501**, **502**, **503**, **504**.
