> ## 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.

# Save missing Action mock

> Save a missing Action response into the original conversation case setup.

Save a missing Action response into the original conversation case setup.

Use the case-run item ID, not the parent run ID. Requires a finished execution failure with an Action whose `source` is `missing` and a recorded request. The original conversation case and current Action fixture must still exist. Changed setup or Action definitions can return `409`. The saved mock affects future runs; start another run to verify it.

## Headers

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

## Path parameters

<ParamField path="id" type="string" required>
  Failed case-run item UUID.
</ParamField>

## Body parameters

<ParamField body="actionIndex" type="number" required>
  Zero-based index in the failed case run's `result.actions`, from 0 to 1000.
</ParamField>

<ParamField body="success" type="boolean" required>
  Whether the mock Action succeeds.
</ParamField>

<ParamField body="output" type="object" required>
  Mock JSON output, up to 100 KB.
</ParamField>

## Response

Returns the updated case detail. The history retains the previous failed execution; saving the mock does not rewrite that result. Its empty array of criterion results is intentional because execution stopped before grading.

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST \
    --url 'https://api-prod.usefini.com/v2/test-suite/case-runs/00000000-0000-4000-8000-000000000013/action-mocks/public' \
    --header 'Authorization: Bearer fini_your_api_key' \
    --header 'Content-Type: application/json' \
    --data '{
    "actionIndex": 0,
    "success": true,
    "output": {
      "eligible": true
    }
  }'
  ```

  ```javascript Node.js theme={null}
  const body = {
    "actionIndex": 0,
    "success": true,
    "output": {
      "eligible": true
    }
  };

  const response = await fetch("https://api-prod.usefini.com/v2/test-suite/case-runs/00000000-0000-4000-8000-000000000013/action-mocks/public", {
    method: "POST",
    headers: {
      Authorization: "Bearer fini_your_api_key",
      "Content-Type": "application/json",
    },
    body: JSON.stringify(body),
  });
  if (!response.ok) throw new Error(await response.text());
  const result = await response.json();
  ```

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

  body = json.loads('''
  {
    "actionIndex": 0,
    "success": true,
    "output": {
      "eligible": true
    }
  }
  ''')

  response = requests.request(
      "POST",
      "https://api-prod.usefini.com/v2/test-suite/case-runs/00000000-0000-4000-8000-000000000013/action-mocks/public",
      headers={"Authorization": "Bearer fini_your_api_key"},
      json=body,
  )
  response.raise_for_status()
  result = response.json()
  ```
</RequestExample>

<ResponseExample>
  ```json 201 Created theme={null}
  {
    "id": "00000000-0000-4000-8000-000000000002",
    "companyId": "00000000-0000-4000-8000-000000000011",
    "botId": "00000000-0000-4000-8000-000000000001",
    "name": "Refund policy",
    "sourceType": "conversation",
    "sourceInteractionId": "00000000-0000-4000-8000-000000000021",
    "criteria": [
      {
        "id": "2995012b-d9bf-58e9-c6c7-672205196681",
        "companyId": "00000000-0000-4000-8000-000000000011",
        "defaultCriterionId": null,
        "name": "No handoff",
        "type": "deterministic",
        "condition": {
          "scope": "SCALAR",
          "predicate": {"left": {"path": "escalated", "dataType": "boolean"}, "operator": "==", "right": {"value": false}}
        },
        "blocking": true,
        "judgePrompt": null,
        "passPrompt": null,
        "failPrompt": null,
        "isActive": true,
        "createdAt": "2026-10-12T10:00:00.000Z",
        "updatedAt": "2026-10-12T10:00:00.000Z"
      },
      {
        "id": "00000000-0000-4000-8000-000000000012",
        "companyId": "00000000-0000-4000-8000-000000000011",
        "defaultCriterionId": null,
        "name": "No handoff",
        "type": "deterministic",
        "condition": {
          "scope": "SCALAR",
          "predicate": {"left": {"path": "escalated", "dataType": "boolean"}, "operator": "==", "right": {"value": false}}
        },
        "blocking": true,
        "judgePrompt": null,
        "passPrompt": null,
        "failPrompt": null,
        "isActive": true,
        "createdAt": "2026-10-12T10:00:00.000Z",
        "updatedAt": "2026-10-12T10:00:00.000Z"
      }
    ],
    "artifacts": [{"kind": "rule", "id": "00000000-0000-4000-8000-000000000005", "name": "Refund workflow", "origin": "manual"}],
    "criteriaGroupId": "00000000-0000-4000-8000-000000000003",
    "criteriaGroupIds": ["00000000-0000-4000-8000-000000000003"],
    "criteriaGroup": {
      "id": "00000000-0000-4000-8000-000000000003",
      "companyId": "00000000-0000-4000-8000-000000000011",
      "botId": "00000000-0000-4000-8000-000000000001",
      "name": "Refund checks",
      "criteria": [
        {
          "id": "00000000-0000-4000-8000-000000000012",
          "companyId": "00000000-0000-4000-8000-000000000011",
          "defaultCriterionId": null,
          "name": "No handoff",
          "type": "deterministic",
          "condition": {
            "scope": "SCALAR",
            "predicate": {"left": {"path": "escalated", "dataType": "boolean"}, "operator": "==", "right": {"value": false}}
          },
          "blocking": true,
          "judgePrompt": null,
          "passPrompt": null,
          "failPrompt": null,
          "isActive": true,
          "createdAt": "2026-10-12T10:00:00.000Z",
          "updatedAt": "2026-10-12T10:00:00.000Z"
        }
      ],
      "revision": 1,
      "createdAt": "2026-10-12T10:00:00.000Z",
      "updatedAt": "2026-10-12T10:00:00.000Z"
    },
    "criteriaGroups": [
      {
        "id": "00000000-0000-4000-8000-000000000003",
        "companyId": "00000000-0000-4000-8000-000000000011",
        "botId": "00000000-0000-4000-8000-000000000001",
        "name": "Refund checks",
        "criteria": [
          {
            "id": "00000000-0000-4000-8000-000000000012",
            "companyId": "00000000-0000-4000-8000-000000000011",
            "defaultCriterionId": null,
            "name": "No handoff",
            "type": "deterministic",
            "condition": {
              "scope": "SCALAR",
              "predicate": {"left": {"path": "escalated", "dataType": "boolean"}, "operator": "==", "right": {"value": false}}
            },
            "blocking": true,
            "judgePrompt": null,
            "passPrompt": null,
            "failPrompt": null,
            "isActive": true,
            "createdAt": "2026-10-12T10:00:00.000Z",
            "updatedAt": "2026-10-12T10:00:00.000Z"
          }
        ],
        "revision": 1,
        "createdAt": "2026-10-12T10:00:00.000Z",
        "updatedAt": "2026-10-12T10:00:00.000Z"
      }
    ],
    "criterionOrigins": {
      "2995012b-d9bf-58e9-c6c7-672205196681": {"groupId": "00000000-0000-4000-8000-000000000003", "groupName": "Refund checks"}
    },
    "localCriteria": [
      {
        "id": "00000000-0000-4000-8000-000000000012",
        "companyId": "00000000-0000-4000-8000-000000000011",
        "defaultCriterionId": null,
        "name": "No handoff",
        "type": "deterministic",
        "condition": {
          "scope": "SCALAR",
          "predicate": {"left": {"path": "escalated", "dataType": "boolean"}, "operator": "==", "right": {"value": false}}
        },
        "blocking": true,
        "judgePrompt": null,
        "passPrompt": null,
        "failPrompt": null,
        "isActive": true,
        "createdAt": "2026-10-12T10:00:00.000Z",
        "updatedAt": "2026-10-12T10:00:00.000Z"
      }
    ],
    "createdAt": "2026-10-12T10:00:00.000Z",
    "updatedAt": "2026-10-12T10:00:00.000Z",
    "messages": [{"id": "00000000-0000-4000-8000-000000000010", "role": "user", "content": "Am I eligible for a refund?"}],
    "conversationName": "Refund policy",
    "attributeOverrides": {"plan": "standard"},
    "history": [
      {
        "id": "00000000-0000-4000-8000-000000000013",
        "runId": "00000000-0000-4000-8000-000000000015",
        "status": "failed",
        "verdict": "fail",
        "error": "A required mock action response is missing. Add a response to this test case setup, then rerun. No live action was called.",
        "createdAt": "2026-10-12T10:00:00.000Z",
        "criteriaGroupId": null,
        "criteriaGroupName": null,
        "criteriaResults": [],
        "needsRerun": true
      }
    ],
    "latestIndividualRun": {
      "id": "00000000-0000-4000-8000-000000000013",
      "runId": "00000000-0000-4000-8000-000000000015",
      "status": "failed",
      "verdict": "fail",
      "error": "A required mock action response is missing. Add a response to this test case setup, then rerun. No live action was called.",
      "createdAt": "2026-10-12T10:00:00.000Z",
      "criteriaGroupId": null,
      "criteriaGroupName": null,
      "criteriaResults": [],
      "needsRerun": true
    },
    "actionResponses": [
      {
        "fingerprint": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
        "eventId": "00000000-0000-4000-8000-000000000010",
        "resultIndex": 0,
        "turn": 1,
        "name": "Check eligibility",
        "nodeId": "lookup",
        "ruleId": "00000000-0000-4000-8000-000000000005",
        "toolId": "00000000-0000-4000-8000-000000000006",
        "requestHash": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
        "added": true,
        "inputs": {"orderId": "DEMO-1001"},
        "success": true,
        "output": {"eligible": true},
        "recordedSuccess": true,
        "recordedOutput": {"eligible": true}
      }
    ],
    "turns": [
      {
        "message": "Am I eligible for a refund?",
        "actions": [
          {
            "ruleId": "00000000-0000-4000-8000-000000000005",
            "nodeId": "lookup",
            "toolId": "00000000-0000-4000-8000-000000000006",
            "success": true,
            "output": {"eligible": true}
          }
        ]
      }
    ],
    "userAttributes": {"plan": "standard"},
    "createdBy": null,
    "deletedAt": null
  }
  ```
</ResponseExample>


## Related topics

- [Overview](/en/api-reference/test-suite.md)
- [Test Suite](/en/testing/test-suite.md)
- [Best practices for testing your agent](/en/testing/best-practices.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.