Introducing Confident Voice: Watch the Launch Video Now

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": "Share Order Details",
  "instructions": "Give order number 48213 and the email jane@example.com.",
  "fromStateId": "<JOURNEY-STATE-ID>",
  "when": "The assistant asks for your order number or email."
}'
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. Name it for what the user does, in a few words.

  • instructionsstringRequired

    What the simulated user says or does in this state, written to them in the second person. They keep acting it out until the app's reply matches an edge leaving the state.

  • 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

    What the app does or says in its reply that moves the simulated user from fromStateId into the new state; describe the app's reply, not the user. Required with fromStateId and ignored without it. An empty when 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