# Review and test an operation

Review an operation to check that its summary, schemas, kind and confirmation flag match what your API does. Test it to make a real call through one of the API's connections and see the response.

## Before you begin

- The API's analysis has finished.
- To test, the API has a connection that is not marked as production. See [Add a connection](https://docs.faustine.ai/apis/add-a-connection/).

## Review an operation

1. In the portal, go to [**APIs**](https://auth.faustine.ai/go?to=%2Fintegrations%2Fapis) and select your API.
2. Select the **Operations** tab.
3. Find the operation. **Search operations…** matches the key, the summary, the path and the method.
4. Select the operation's row. It unfolds to show the summary, the description, the endpoint, the kind and whether confirmation is required.
5. To see the schemas, select **Schema** in the row. The operation's dialog opens on the **Request** tab.

The dialog has four tabs:

| Tab | What it shows |
| --- | --- |
| **Request** | The JSON Schema of the input. |
| **Response** | The JSON Schema of the result, as the analysis inferred it. |
| **Details** | **Summary**, **Description**, **Kind**, **Requires confirmation** and **Identifying fields**. |
| **Test** | A form to call the operation. |

## Correct an operation

To change the kind or the confirmation flag from the table:

1. In the **Kind** column, select the pencil next to the badge to switch between `read` and `write`.
2. In the **Requires confirmation** column, turn the switch on or off.
3. Select **Save changes** in the bar that appears.

To change the summary, the description or a schema:

1. Open the operation's dialog.
2. Edit the **Request** or **Response** schema, or the fields of the **Details** tab.
3. Select **Save**.

The dialog confirms that the edit is saved to the draft. Your edit is stored over the value from the analysis, and a later re-analysis keeps your kind and confirmation flag. To go back to what the analysis wrote, select **Reset to analysis**.

Agents see the change after you select **Publish** in the API's header.

## Test an operation

1. In the operation's row, select **Test**.
2. In **Connection**, select the connection to call. A connection marked as production is listed and cannot be selected.
3. In **Input**, edit the JSON. The form starts with an example built from the request schema, and **Reset to example** restores it.
4. Select **Run test**, then confirm with **Run test**.

> **Warning:** A test is a real call to your API through the selected connection. A write operation changes data in that deployment.

**Result** shows the status, the duration, the connection and the response body. The row's **Last test** then reads **Passed** or **Failed** for the rest of your session.

A test calls your API through the connection and not through a gateway, so a gateway's scopes, limits and confirmation do not apply to it. The API's **Activity** tab lists the test with its connection, its status and its duration.

If the API signs in with pass-through credentials, the form adds **Upstream Authorization**. Enter the header value an agent would send, such as `Bearer …`. Faustine forwards it and does not store it.

## Troubleshooting

| Symptom | Cause | Fix |
| --- | --- | --- |
| `No connections yet — add one in the Connections tab.` | The API has no connection. | [Add a connection](https://docs.faustine.ai/apis/add-a-connection/). |
| `Production connection — tests are blocked.` | Every connection of the API is marked as production. | Add a staging or sandbox connection. |
| The test fails on input validation | The input does not match the operation's request schema. | Correct the input. To change what the operation accepts, edit the schema in the **Request** tab. |

## Next steps

- [Mark an operation as requiring confirmation](https://docs.faustine.ai/apis/require-confirmation/): decide which writes need a person.
- [Generate and run API tests](https://docs.faustine.ai/apis/tests/): test every operation in one run.
- [The AI editor](https://docs.faustine.ai/apis/ai-editor/): fix schemas from the code in conversation.
