> Revox API docs for developers and AI agents. Index: https://www.getrevox.com/docs/api/llms.txt · Everything in one file: https://www.getrevox.com/docs/api/llms-full.txt · OpenAPI 3.1: https://www.getrevox.com/openapi.json · MCP server: https://www.getrevox.com/mcp
> Base URL https://www.getrevox.com/api · Auth: `Authorization: Bearer $REVOX_API_KEY`

# Replace a multi-step flow's transitions

`PUT https://www.getrevox.com/api/assistants/{id}/edges`

Replace the transitions of a multi-step assistant's flow. Every transition must reference assistants in your organization. To change one step's prompt or settings, [`PATCH /assistants/{id}`](https://www.getrevox.com/docs/api/assistants/update-an-assistant.md) on the step instead.

## Before you call

- The set you send replaces the flow's whole set: read it with [`GET /assistants/{id}/edges`](https://www.getrevox.com/docs/api/assistants/get-a-multi-step-flow.md) first, and send back every transition you keep.
- Pass the multi-step assistant's id. `source` is the flow's id or one of its steps, `target` one of its steps; a step never points to itself.
- Give every transition a condition: one with an empty condition is ignored on calls.
- A step that no transition reaches any more is left out of the flow, but not deleted: delete it with [`DELETE /assistants/{id}`](https://www.getrevox.com/docs/api/assistants/delete-an-assistant.md).

## Request

The flow's id is the start step. Every transition you keep must be sent again: the set is replaced.

```bash
curl -X PUT "https://www.getrevox.com/api/assistants/3f6c2a1e-8b4d-4c7a-9e2f-5d1b7a9c0e34/edges" \
  -H "Authorization: Bearer $REVOX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "edges": [
      {
        "source": "3f1c2a90-5b7e-4d21-9c3a-0e8f6b2d4a11",
        "target": "8a2d6e14-1c9b-4f73-a5e0-7b3c9d2f6e58",
        "condition": "la personne veut réserver une salle"
      },
      {
        "source": "3f1c2a90-5b7e-4d21-9c3a-0e8f6b2d4a11",
        "target": "c47e0b3a-92d5-4e18-b6f1-5a8c2e7d9b03",
        "condition": "la personne signale un incident dans son espace"
      }
    ]
  }'
```

## Path parameters

- `id` (string, required): ID of the assistant, as returned by [`GET /assistants`](https://www.getrevox.com/docs/api/assistants/get-assistants.md).

## Body

JSON.

- `edges` (array of object, required): Every transition of the flow, the ones you keep included.
  - `edges.source` (string, required): The step the call leaves: the flow's id (its start step) or one of its steps' ids.
  - `edges.target` (string, required): The step the call moves to, one of the flow's steps' ids.
  - `edges.condition` (string, required): When the call takes this transition, as one natural-language sentence the agent evaluates during the call, e.g. « la personne veut réserver une salle ». A transition with an empty condition is ignored on calls. Example: `"la personne veut réserver une salle"`.

## Response 200

```json
{
  "edges": [
    {
      "source": "source",
      "target": "target",
      "condition": "la personne veut réserver une salle"
    }
  ]
}
```

- `edges` (array of object)
  - `edges.source` (string): The step the call leaves: the flow's id (its start step) or one of its steps' ids.
  - `edges.target` (string): The step the call moves to, one of the flow's steps' ids.
  - `edges.condition` (string): When the call takes this transition, as one natural-language sentence the agent evaluates during the call, e.g. « la personne veut réserver une salle ». A transition with an empty condition is ignored on calls. Example: `"la personne veut réserver une salle"`.

## Errors

- `400` Invalid request: a field or parameter failed validation: `{"message":"Request validation failed","bodyErrors":{"issues":[{"path":["edges"],"message":"Invalid input: expected string, received undefined","code":"invalid_type"}]}}`
- `404` Not found in your organization: `{"error":"Not found"}`
- Every status is explained under Errors in https://www.getrevox.com/docs/api.md#errors.