Create Scenario
Create a new scenario. The scenario will be associated with the organization of the API key.
Authorization
bearerAuth Bearer token authentication for API access.
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
curl -X POST "https://api.sophiie.ai/v1/scenarios" \ -H "Content-Type: application/json" \ -d '{ "name": "Pricing Inquiry", "prompt": "When a customer asks about pricing, follow this scenario.", "response": "I would be happy to help you with pricing." }'{
"scenario": {
"id": 42,
"name": "Pricing Inquiry",
"prompt": "When a customer asks about pricing, follow this scenario.",
"response": "I would be happy to help you with pricing information. Let me walk you through our options.",
"isActive": true,
"questions": [
{
"question": "Are you an existing customer?",
"answerOptions": [
{
"answer": "Yes",
"followUps": [
{
"question": "Can you tell me more about that?"
}
]
}
]
}
],
"outcome": {
"type": "continueCall",
"property1": null,
"property2": null
},
"tradeServiceId": null,
"createdAt": "2026-01-15T10:30:00.000Z",
"updatedAt": "2026-01-20T14:00:00.000Z"
}
}{
"success": false,
"message": "Invalid or expired token",
"error": {
"status": 401,
"message": "Invalid or expired token"
}
}{
"success": false,
"message": "Conflict",
"error": {
"status": 409,
"message": "Conflict"
}
}{
"success": false,
"message": "Internal server error",
"error": {
"status": 500,
"message": "Internal server error"
}
}Update Policy PUT
Update an existing policy entry. Only policies belonging to the organization associated with the API key can be updated.
Delete Scenario DELETE
Delete an existing scenario. Only scenarios belonging to the organization associated with the API key can be deleted. This performs a soft delete.