# Chatbot examples

## Lists and filters training examples

> \
> \
> \*\*Required Permission:\*\* \`chatbots.examples.list\`\
> \
> \*\*Resource:\*\* \`chatbots/:chatbotId\`

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"tags":[{"name":"Chatbot examples","description":""}],"servers":[{"url":"https://api.chatcaptain.com","description":"Production"}],"security":[{},{}],"paths":{"/v1/chatbots/{chatbotId}/examples":{"get":{"operationId":"ChatbotExampleController_listExamples[1]_v1","parameters":[{"name":"chatbotId","required":true,"in":"path","description":"The ID of the chatbot.","schema":{"type":"string"}},{"name":"limit","required":false,"in":"query","description":"The limit for how many examples should be fetched.","schema":{"type":"number"}},{"name":"pageToken","required":false,"in":"query","description":"The date after which to filter examples. Only examples after this date will be fetched.","schema":{"type":"string"}},{"name":"intentId","required":false,"in":"query","description":"The Id of the intent the examples belong to.","schema":{"type":"string"}},{"name":"entityId","required":false,"in":"query","description":"The Id of the intent the examples belong to.","schema":{"type":"string"}},{"name":"language","required":false,"in":"query","description":"The language of the examples.","schema":{"type":"string"}}],"responses":{"200":{"description":"List of training examples.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListExamplesResponseDto"}}}},"403":{"description":"Insufficient permissions."}},"summary":"Lists and filters training examples","tags":["Chatbot examples"],"description":"\n\n**Required Permission:** `chatbots.examples.list`\n\n**Resource:** `chatbots/:chatbotId`"}}},"components":{"schemas":{"ListExamplesResponseDto":{"type":"object","properties":{"pageToken":{"type":"string","description":"The date of the latest fetched example."},"error":{"type":"string","description":"Optional error message."}},"required":["pageToken","examples"]}}}}
```

## Creates a new training example

> \
> \
> \*\*Required Permission:\*\* \`chatbots.examples.create\`\
> \
> \*\*Resource:\*\* \`chatbots/:chatbotId\`

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"tags":[{"name":"Chatbot examples","description":""}],"servers":[{"url":"https://api.chatcaptain.com","description":"Production"}],"security":[{},{}],"paths":{"/v1/chatbots/{chatbotId}/examples":{"post":{"operationId":"ChatbotExampleController_createExample[1]_v1","parameters":[{"name":"chatbotId","required":true,"in":"path","description":"The ID of the chatbot.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateExampleRequestDto"}}}},"responses":{"201":{"description":"Example created successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExampleResponseDto"}}}},"400":{"description":"Invalid input data."},"403":{"description":"Insufficient permissions."}},"summary":"Creates a new training example","tags":["Chatbot examples"],"description":"\n\n**Required Permission:** `chatbots.examples.create`\n\n**Resource:** `chatbots/:chatbotId`"}}},"components":{"schemas":{"CreateExampleRequestDto":{"type":"object","properties":{"intentId":{"type":"string","description":"The ID of the Intent to which this example is assigned."},"text":{"type":"string","description":"The text of the training example."},"language":{"type":"string","description":"The language of the example."},"entityIds":{"description":"A list of entity Id's that are marked in this example.","default":[],"type":"array","items":{"type":"string"}},"entities":{"description":"The entities marked in this example.","default":[],"type":"array","items":{"$ref":"#/components/schemas/ExampleEntityDto"}},"translate":{"type":"boolean","description":"Indicates whether the example should be translated into other languages."},"conversationId":{"type":"string","description":"Optional ID of the conversation from which the example originated."}},"required":["intentId","text","entityIds","entities"]},"ExampleEntityDto":{"type":"object","properties":{"entityId":{"type":"string","description":"The Id of the entity."},"value":{"type":"string","description":"The value of the entitiy"},"start":{"type":"number","description":"The position on which the entity starts."},"end":{"type":"number","description":"The position on which the entity ends."}},"required":["entityId","value","start","end"]},"ExampleResponseDto":{"type":"object","properties":{"error":{"type":"string","description":"Optional error message."}},"required":["example"]}}}}
```

## Deletes a training example

> \
> \
> \*\*Required Permission:\*\* \`chatbots.examples.delete\`\
> \
> \*\*Resource:\*\* \`chatbots/:chatbotId\`

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"tags":[{"name":"Chatbot examples","description":""}],"servers":[{"url":"https://api.chatcaptain.com","description":"Production"}],"security":[{},{}],"paths":{"/v1/chatbots/{chatbotId}/examples/{exampleId}":{"delete":{"operationId":"ChatbotExampleController_deleteExample[1]_v1","parameters":[{"name":"chatbotId","required":true,"in":"path","description":"The ID of the chatbot.","schema":{"type":"string"}},{"name":"exampleId","required":true,"in":"path","description":"The ID of the example to delete.","schema":{"type":"string"}}],"responses":{"200":{"description":"Result of the deletion process.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteExampleResponseDto"}}}},"403":{"description":"Insufficient permissions."}},"summary":"Deletes a training example","tags":["Chatbot examples"],"description":"\n\n**Required Permission:** `chatbots.examples.delete`\n\n**Resource:** `chatbots/:chatbotId`"}}},"components":{"schemas":{"DeleteExampleResponseDto":{"type":"object","properties":{"deleted":{"type":"boolean","description":"Indicates whether the deletion was successful."},"error":{"type":"string","description":"Optional error message."}},"required":["deleted"]}}}}
```

## Updates an existing training example.

> \
> \
> \*\*Required Permission:\*\* \`chatbots.examples.edit\`\
> \
> \*\*Resource:\*\* \`chatbots/:chatbotId\`

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"tags":[{"name":"Chatbot examples","description":""}],"servers":[{"url":"https://api.chatcaptain.com","description":"Production"}],"security":[{},{}],"paths":{"/v1/chatbots/{chatbotId}/examples/{exampleId}":{"patch":{"operationId":"ChatbotExampleController_updateExample[1]_v1","parameters":[{"name":"chatbotId","required":true,"in":"path","description":"The ID of the chatbot.","schema":{"type":"string"}},{"name":"exampleId","required":true,"in":"path","description":"The ID of the example to update.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateExampleRequestDto"}}}},"responses":{"200":{"description":"Example updated successfully.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExampleResponseDto"}}}},"403":{"description":"Insufficient permissions."},"404":{"description":"Example not found."}},"summary":"Updates an existing training example.","tags":["Chatbot examples"],"description":"\n\n**Required Permission:** `chatbots.examples.edit`\n\n**Resource:** `chatbots/:chatbotId`"}}},"components":{"schemas":{"UpdateExampleRequestDto":{"type":"object","properties":{"text":{"type":"string","description":"The updated text of the training example."},"entityIds":{"default":[],"type":"array","items":{"type":"string"}},"entities":{"default":[],"type":"array","items":{"$ref":"#/components/schemas/ExampleEntityDto"}},"status":{"description":"Sets the indexing status of the example.\n\n- `0`: EXAMPLE_STATUS_PENDING\n- `1`: EXAMPLE_STATUS_INDEXING\n- `2`: EXAMPLE_STATUS_INDEXED\n- `3`: EXAMPLE_STATUS_ERROR","allOf":[{"$ref":"#/components/schemas/ExampleStatus"}]},"vector":{"description":"The manually set vector for this example.","default":[],"type":"array","items":{"type":"number"}}},"required":["text","entityIds","entities","vector"]},"ExampleEntityDto":{"type":"object","properties":{"entityId":{"type":"string","description":"The Id of the entity."},"value":{"type":"string","description":"The value of the entitiy"},"start":{"type":"number","description":"The position on which the entity starts."},"end":{"type":"number","description":"The position on which the entity ends."}},"required":["entityId","value","start","end"]},"ExampleStatus":{"type":"number","enum":[0,1,2,3,-1],"description":"The status of the example.\n\n- `0`: PENDING\n- `1`: INDEXING\n- `2`: INDEXED\n- `3`: ERROR"},"ExampleResponseDto":{"type":"object","properties":{"error":{"type":"string","description":"Optional error message."}},"required":["example"]}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.chatcaptain.com/api/api-dokumentation/chatbot-examples.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
