> For the complete documentation index, see [llms.txt](https://flowmate.gitbook.io/flowmate-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://flowmate.gitbook.io/flowmate-documentation/using-the-flowmate-api/log-api-filtering-and-error-monitoring.md).

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