Introducing Confident Monitor

Create Journey State

(v2)

POST

Adds a state to a journey and returns its id. Send fromStateId and when to connect it from an existing state in the same call; retrieve the journey to read the edge that creates. State names are unique within a journey; reusing one returns a 409.

POST/v2/journeys/{journeyId}/states
curl -X POST "https://api.confident-ai.com/v2/journeys/{journeyId}/states" \
  -H "CONFIDENT_API_KEY: <PROJECT-API-KEY>" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Verify identity",
  "instructions": "The agent asks for the order number and the email on the account, and checks they match before going further.",
  "fromStateId": "<JOURNEY-STATE-ID>",
  "when": "The customer asks for their money back on an order."
}'
200
{
  "success": true,
  "data": {
    "id": "<JOURNEY-STATE-ID>"
  },
  "link": "https://app.confident-ai.com/project/<PROJECT-ID>/journeys/<JOURNEY-ID>",
  "deprecated": false
}

Headers

  • CONFIDENT_API_KEYstringRequired

    The API key of your Confident AI project.

Path parameters

  • journeyIdstringRequired

    The id of the journey.

Request body

  • namestringRequired

    The name of the state, unique within the journey.

  • instructionsstringRequired

    What happens at this step of the conversation. When goldens are generated for a path, the instructions of its states, in order, are what the scenario is written from. May be empty.

  • fromStateIdstring

    The id of an existing state in this journey to connect the new state from. An edge from that state to the new one is created alongside it, and when is then required. Omit it to add an unconnected state.

  • whenstring

    The condition for the edge from fromStateId, in plain language. Required with fromStateId and ignored without it. An empty condition keeps the edge out of the journey's paths until it is given one.

Response

Create Journey State succeeded.

  • successboolean

    Indicates if the request was successful.

  • dataobject

    A reference to a journey state by its id.

    Show 1 propertyHide 1 property
    • idstring

      The id of the state, generated by Confident AI.

  • linkstring

    This is the URL of the resource on the Confident AI platform.

  • deprecatedboolean

    Indicates if this endpoint is deprecated.

Built byConfident AI