# Log API – Filtering and Error Monitoring

The **Log API** allows you to retrieve and filter logs for flows and steps. This is useful for setting up monitoring and alerts (e.g., sending Slack notifications when errors occur).

### Endpoints

#### 1. Filter by Flow and Step

```http
GET https://api.platform.openintegrationhub.com/logs?filter[flowId]={flowId}&filter[stepId]={stepId}
```

* Returns logs for a specific flow and step.
* Use query parameters instead of path parameters.

#### 2. Filter by Tenant

```http
GET https://api.platform.openintegrationhub.com/logs?filter[tenant]={tenantId}
```

* Returns logs for all flows belonging to the specified tenant.
* Useful for tenant-wide monitoring.

#### 3. Show Only Errors

```http
GET https://api.platform.openintegrationhub.com/logs?filter[flowId]={flowId}&showErrors=true
```

* Adds an error filter.
* Only logs containing the word `"Error"` will be returned.

### Query Parameters

| Parameter        | Description                                        |
| ---------------- | -------------------------------------------------- |
| `filter[flowId]` | ID of the flow to fetch logs for.                  |
| `filter[stepId]` | ID of the step to fetch logs for.                  |
| `filter[tenant]` | Tenant ID to fetch all logs for a tenant.          |
| `showErrors`     | Set to `true` to filter logs containing `"Error"`. |

### Example Use Cases

1. **Monitor a specific flow step for errors**

   ```http
   GET /logs?filter[flowId]=123&filter[stepId]=abc&showErrors=true
   ```
2. **Get all tenant logs, only errors**

   ```http
   GET /logs?filter[tenant]=456&showErrors=true
   ```
3. **Fetch all logs for a tenant without filtering**

   ```http
   GET /logs?filter[tenant]=456
   ```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://flowmate.gitbook.io/flowmate-documentation/using-the-flowmate-api/log-api-filtering-and-error-monitoring.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
