# Activity Log Endpoints {#activity-log-endpoints}


Query activity logs and API call logs for auditing and debugging purposes.


## Base Paths {#base-paths}


| Resource      | Path                |
| ------------- | ------------------- |
| Activity Logs | `/api/activity-log` |
| API Call Logs | `/api/api-call-log` |


## Activity Log Endpoints {#activity-log-endpoints-1}



### List Activity Logs {#list-activity-logs}


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

**Query Parameters:**

| Parameter   | Type   | Description           |
| ----------- | ------ | --------------------- |
| `entity`    | string | Filter by entity type |
| `entityId`  | string | Filter by entity ID   |
| `action`    | string | Filter by action type |
| `actorType` | string | Filter by actor type  |


### Get Activity Log by ID {#get-activity-log-by-id}


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


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



### List API Call Logs {#list-api-call-logs}


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


### Create API Call Log {#create-api-call-log}


```
POST /api/api-call-log
Authorization: Bearer {token}
Content-Type: application/json

{
  "url": "/api/tasks",
  "method": "GET",
  "statusCode": 200,
  "requestHeaders": "{}",
  "responseBody": "{}",
  "ipAddress": "127.0.0.1"
}
```


## Action Types {#action-types}


| Action    | Description        |
| --------- | ------------------ |
| `CREATED` | Entity was created |
| `UPDATED` | Entity was updated |
| `DELETED` | Entity was deleted |


## Actor Types {#actor-types}


| Actor Type | Description             |
| ---------- | ----------------------- |
| `User`     | Human user action       |
| `System`   | System/automated action |


## Data Model {#data-model}


```typescript
interface IActivityLog {
  id: string;
  entity: string;
  entityId: string;
  action: ActionTypeEnum;
  actorType?: ActorTypeEnum;
  description?: string;
  updatedFields?: string[];
  updatedValues?: Record<string, any>;
  previousValues?: Record<string, any>;

  // Relations
  creatorId?: string;
  organizationId: string;
  tenantId: string;
}

interface IApiCallLog {
  id: string;
  url: string;
  method: string;
  statusCode: number;
  requestHeaders?: string;
  requestBody?: string;
  responseBody?: string;
  ipAddress?: string;
  organizationId?: string;
  tenantId: string;
}
```


## Related Pages {#related-pages}


- [Audit Logging](https://sourcey-gauzy.pages.dev/security/audit-logging/index.md) — security audit
- [API Call Logging](https://sourcey-gauzy.pages.dev/api/api-call-log-endpoints/index.md) — logging deep dive
- [Monitoring](https://sourcey-gauzy.pages.dev/performance/monitoring/index.md) — observability
