# API Call Log Endpoints {#api-call-log-endpoints}


Query the API request audit log for monitoring and debugging.


## Base Path {#base-path}


```
/api/api-call-log
```


## Endpoints {#endpoints}



### List API Calls {#list-api-calls}


```
GET /api/api-call-log
Authorization: Bearer {token}
```

**Query Parameters:**

| Parameter    | Type   | Description            |
| ------------ | ------ | ---------------------- |
| `page`       | number | Page number            |
| `limit`      | number | Items per page         |
| `method`     | string | HTTP method (GET,POST) |
| `url`        | string | URL pattern filter     |
| `statusCode` | number | Response status code   |
| `startDate`  | date   | From date              |
| `endDate`    | date   | To date                |

**Response:**

```json
{
  "items": [
    {
      "id": "uuid",
      "method": "GET",
      "url": "/api/employee",
      "statusCode": 200,
      "requestTime": 45,
      "ipAddress": "192.168.1.1",
      "userId": "uuid",
      "createdAt": "2025-01-15T10:30:00Z"
    }
  ],
  "total": 1250
}
```


### Get Call by ID {#get-call-by-id}


```
GET /api/api-call-log/:id
Authorization: Bearer {token}
```


### Delete Old Logs {#delete-old-logs}


```
DELETE /api/api-call-log/older-than/:days
Authorization: Bearer {token}
```

Requires admin permissions.


## Use Cases {#use-cases}


- API performance monitoring
- Security auditing
- Debugging failed requests
- Rate limiting analysis


## Related Pages {#related-pages}


- [Monitoring & Observability](https://sourcey-gauzy.pages.dev/devops/monitoring/index.md) — monitoring setup
- [Audit Logging](https://sourcey-gauzy.pages.dev/architecture/audit-logging/index.md) — audit architecture
