Quickstart
By the end of this guide, you will have verified a workspace key and created an agent with an initial draft using curl. You will also know how to retry the request without creating the agent twice.
Before you start
You need:
- a workspace in which you can open the Developers page;
- a workspace API key stored outside your source code; and
- curl.
The API is server-to-server. Do not put its key in browser or mobile application code.
1. Set the base URL and key
Create a key on the Developers page of the Rasen app, under API keys (Authentication). Then set two variables:
2. Verify access
The answer names the key’s workspace and the capabilities that operations use:
3. A safe retry, end to end
Every mutation takes an Idempotency-Key. Choose a new one for each intended action, and keep it
until you have the answer.
The identity and initial draft are stored atomically. If an initial field is refused, neither is
created. The repeat returns the original status and body with Idempotent-Replayed: true, and
nothing happens twice. A different body under the same key is refused with
409 idempotency_key_reused after an intent has been recorded.
Save the returned agent.id. You will use it to read and edit the draft, select a voice, validate
the result and publish a version in Agent lifecycle. To create an agent with its
voice already chosen, list GET /voices without agent_id first and send the ID in
initial_draft.voice.