> ## Documentation Index
> Fetch the complete documentation index at: https://docs.usefini.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create replay

> Run an existing conversation turn against the current agent configuration.

Creates a replay conversation from an existing conversation and target Fini response event. The replay runs immediately, stores its result as a separate conversation, and returns the replay conversation.

<Info>
  This endpoint needs `write` scope. It creates a replay record, but it does not change the original conversation or publish any configuration changes.
</Info>

Use [List conversations](/en/api-reference/list-conversations) or [Get conversation](/en/api-reference/get-conversation) to find the original conversation ID and the Fini response event ID.

## Headers

<ParamField header="Authorization" type="string" required>
  Bearer token containing your Fini workspace API key. Format: `Bearer fini_...` The key needs `write` scope.
</ParamField>

<ParamField header="Content-Type" type="string" required>
  Send `application/json`.
</ParamField>

## Body parameters

<ParamField body="interactionId" type="string" required>
  ID of the original conversation to replay.
</ParamField>

<ParamField body="eventId" type="string" required>
  ID of the Fini response event to replay. The response must have a linked user event in the same conversation.
</ParamField>

<ParamField body="mode" type="enum">
  Replay mode. Use `until` to replay up to the selected response, or `single` to replay only that response. Defaults to `until`.
</ParamField>

<ParamField body="mlModels" type="object">
  Optional model overrides for this replay run. Supported keys are `performPlanning`, `searchKnowledge`, `generateAnswer`, and `tagSelection`; each value must be a non-empty model name.
</ParamField>

<ParamField body="artifacts" type="object">
  Optional answer-generation artifacts to inject into the replay. Use this only when you have validated artifact data from Fini's conversation tooling.
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST \
    --url 'https://api-prod.usefini.com/v2/replays/public' \
    --header 'Authorization: Bearer fini_your_api_key' \
    --header 'Content-Type: application/json' \
    --data '{
      "interactionId": "0b8626b0-4cc8-4a3d-8fc2-f18ad1a4a1a8",
      "eventId": "f61a9a11-2c3b-4704-8f57-7078854d87cf",
      "mode": "until",
      "mlModels": {
        "generateAnswer": "gpt-4.1"
      }
    }'
  ```

  ```python Python theme={null}
  import requests

  response = requests.post(
      "https://api-prod.usefini.com/v2/replays/public",
      headers={"Authorization": "Bearer fini_your_api_key"},
      json={
          "interactionId": "0b8626b0-4cc8-4a3d-8fc2-f18ad1a4a1a8",
          "eventId": "f61a9a11-2c3b-4704-8f57-7078854d87cf",
          "mode": "until",
          "mlModels": {"generateAnswer": "gpt-4.1"},
      },
  )
  replay = response.json()
  ```

  ```javascript Node.js theme={null}
  const response = await fetch("https://api-prod.usefini.com/v2/replays/public", {
    method: "POST",
    headers: {
      Authorization: "Bearer fini_your_api_key",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      interactionId: "0b8626b0-4cc8-4a3d-8fc2-f18ad1a4a1a8",
      eventId: "f61a9a11-2c3b-4704-8f57-7078854d87cf",
      mode: "until",
      mlModels: { generateAnswer: "gpt-4.1" },
    }),
  });
  const replay = await response.json();
  ```
</RequestExample>

## Response

Returns the replay conversation record.

<ResponseField name="id" type="string">
  Replay conversation ID.
</ResponseField>

<ResponseField name="parentInteractionId" type="string">
  Original conversation ID this replay was created from.
</ResponseField>

<ResponseField name="replay" type="object">
  Replay metadata, including `target_event_id`, `status`, and optional `ml_models`.
</ResponseField>

<ResponseExample>
  ```json 200 OK theme={null}
  {
    "id": "9d4bbcf7-e7e1-44a6-9a64-ff0a12dfe625",
    "companyId": "6bc9f4f8-3564-4a9c-8cc0-ea1f1dd66c2d",
    "botId": "2a1cf0f0-f35d-46ad-8e61-a15c86b2b312",
    "source": "replay",
    "channel": "widget",
    "status": "resolved",
    "createdAt": "2026-07-30T12:18:03.211Z",
    "updatedAt": "2026-07-30T12:18:14.904Z",
    "parentInteractionId": "0b8626b0-4cc8-4a3d-8fc2-f18ad1a4a1a8",
    "replay": {
      "target_event_id": "f61a9a11-2c3b-4704-8f57-7078854d87cf",
      "status": "done",
      "ml_models": {
        "generateAnswer": "gpt-4.1"
      }
    }
  }
  ```
</ResponseExample>

## Errors

<AccordionGroup>
  <Accordion title="400 Bad Request" icon="circle-exclamation">
    The body failed validation. `interactionId` and `eventId` must be UUIDs, `mode` must be `until` or `single`, and `mlModels` can only include supported operation keys with non-empty string values.
  </Accordion>

  <Accordion title="401 Unauthorized" icon="lock">
    The API key is missing, malformed, revoked, or invalid.
  </Accordion>

  <Accordion title="403 Forbidden" icon="shield-halved">
    The API key does not include the `write` scope required for this route.
  </Accordion>

  <Accordion title="404 Not Found" icon="circle-question">
    The target event does not exist in the workspace, or the event does not belong to the supplied conversation.
  </Accordion>

  <Accordion title="500 Internal Server Error" icon="triangle-exclamation">
    The target event is not a Fini response, the response has no linked user event to replay, or the replay run failed.
  </Accordion>
</AccordionGroup>
