Reset a Context - Cognigy Documentation

Documentation Index

Fetch the complete documentation index at: /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

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)

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


Authorizations

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

Headers

Name Type Description
Accept enum Media types that the client expects in the response. Default: application/json.

Available options:

Path Parameters

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

Body

Payload (application/json):

Example Body:

{
  "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

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