Build a small support agent in a new project, then send it a customer message. Use the Platform API or CLI to create and publish resources; use the Chat session API to run the published agent.

Before you begin

  • A Voiceflow account with permission to create a project in a workspace, edit its agent and Playbooks, publish its Environment and start a conversation. The workspace needs credits to run the agent.
  • A personal API key. From the workspace dashboard, open Settings → Personal keys → New key and follow the key-creation procedure. Set VF_TOKEN from your secret store. Keep the key on your server or development machine.
  • Bash with cURL and jq. For the CLI alternative, install vf.

These examples use Voiceflow’s default public-cloud API bases:

The following workflow creates and publishes a new test project. Use its returned project ID throughout; do not substitute a production project. The example replaces the new agent’s routing with one Playbook.

Create and publish the agent

Run the commands in the same Bash session. Choose one complete management workflow. Both leave VF_PROJECT_ID and VF_ENVIRONMENT set for the shared conversation steps below.

1

Choose a workspace

Choose an ID returned under workspaces. With a personal key, this list represents account membership; appearing in it does not prove the key can create or edit every resource there. See workspace discovery and permissions.

2

Create a test project and find its Environment

The project response wraps the ID in project. Read the main Environment’s alias from the returned list rather than guessing its display name.

3

Create a Playbook and register it with the agent

These agent and Playbook operations use the current /v2/stable contract, where instructions is Markdown text. Creating a Playbook does not make it reachable: playbooks registers it with the agent. That array replaces the existing registry; this example is for the new test project only.

4

Publish the Environment

Publishing creates a named release from this Environment’s draft. Check the returned release before starting the published session.

Start a session and send a message

Both management alternatives continue here. Use the Chat session API for the conversation, rather than a Platform API management command.

1

Create a published Chat session

The returned sessionKey belongs to this conversation. Keep it for both actions below; do not create another session between turns.

2

Launch the agent

Action requests use the session key directly, without a Bearer prefix. The personal key used for management does not replace it.

3

Send an order-support message

JSON encoding through jq preserves quotes and line breaks in customer messages. For incremental output in an application, use HTTP Streaming; this quickstart uses completed-turn JSON to make the result easy to inspect.

Verify the result

Confirm a release was returned, the session returned a non-empty sessionKey, and the customer message returned at least one text trace. Read the reply: it should follow the Order help instructions and avoid inventing an order status. A successful HTTP status alone does not establish that the agent followed the intended Playbook.

The new project and published release remain in your workspace. Keep them for further development, or remove the test project deliberately through project management when finished.

Troubleshooting

Use the up and down arrow keys to select a result, Enter to open it, and Escape to close the search.