# Logs and HTTP requests over time

`GET /v1/projects/{project_id}/activity`

Requires role member or higher.

`24h` and `7d` return UTC hours; `30d` and `90d` return days cut in the project's timezone. Requests are HTTP access logs.

## Authentication

A session token: `Authorization: Bearer <session token>`, or the session cookie in the browser. Requires role `member` or higher.

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `range` | query |  | no |  |
| `project_id` | path | string | yes |  |

## Responses

### 200

Logs and HTTP requests of a project over a range, zero-filled. The last point is the current, partial one.

`application/json`

```json
{
  "additionalProperties": false,
  "description": "Logs and HTTP requests of a project over a range, zero-filled. The last point is the current, partial one.",
  "properties": {
    "points": {
      "items": {
        "additionalProperties": false,
        "description": "Activity of one hour (UTC) or one day (in the project's timezone) starting at `at`.",
        "properties": {
          "at": {
            "format": "date-time",
            "type": "string"
          },
          "logs": {
            "additionalProperties": false,
            "description": "Logs received, by level.",
            "properties": {
              "debug": {
                "description": "trace and debug logs.",
                "minimum": 0,
                "type": "integer"
              },
              "error": {
                "description": "error logs.",
                "minimum": 0,
                "type": "integer"
              },
              "fatal": {
                "description": "fatal logs.",
                "minimum": 0,
                "type": "integer"
              },
              "info": {
                "description": "info logs.",
                "minimum": 0,
                "type": "integer"
              },
              "warn": {
                "description": "warn logs.",
                "minimum": 0,
                "type": "integer"
              }
            },
            "required": [
              "debug",
              "info",
              "warn",
              "error",
              "fatal"
            ],
            "type": "object"
          },
          "requests": {
            "additionalProperties": false,
            "description": "HTTP requests seen through access logs, by status class.",
            "properties": {
              "s2xx": {
                "description": "Responses 200–299.",
                "minimum": 0,
                "type": "integer"
              },
              "s3xx": {
                "description": "Responses 300–399.",
                "minimum": 0,
                "type": "integer"
              },
              "s4xx": {
                "description": "Responses 400–499.",
                "minimum": 0,
                "type": "integer"
              },
              "s5xx": {
                "description": "Responses 500–599.",
                "minimum": 0,
                "type": "integer"
              },
              "total": {
                "description": "HTTP access logs, 1xx included.",
                "minimum": 0,
                "type": "integer"
              }
            },
            "required": [
              "total",
              "s2xx",
              "s3xx",
              "s4xx",
              "s5xx"
            ],
            "type": "object"
          }
        },
        "required": [
          "at",
          "logs",
          "requests"
        ],
        "type": "object"
      },
      "type": "array"
    },
    "range": {
      "anyOf": [
        {
          "enum": [
            "24h"
          ],
          "type": "string"
        },
        {
          "enum": [
            "7d"
          ],
          "type": "string"
        },
        {
          "enum": [
            "30d"
          ],
          "type": "string"
        },
        {
          "enum": [
            "90d"
          ],
          "type": "string"
        }
      ]
    },
    "resolution": {
      "anyOf": [
        {
          "enum": [
            "hour"
          ],
          "type": "string"
        },
        {
          "enum": [
            "day"
          ],
          "type": "string"
        }
      ]
    },
    "timezone": {
      "description": "The project's IANA timezone (notification settings); days are cut in it.",
      "type": "string"
    },
    "totals": {
      "additionalProperties": false,
      "properties": {
        "logs": {
          "additionalProperties": false,
          "description": "Logs received, by level.",
          "properties": {
            "debug": {
              "description": "trace and debug logs.",
              "minimum": 0,
              "type": "integer"
            },
            "error": {
              "description": "error logs.",
              "minimum": 0,
              "type": "integer"
            },
            "fatal": {
              "description": "fatal logs.",
              "minimum": 0,
              "type": "integer"
            },
            "info": {
              "description": "info logs.",
              "minimum": 0,
              "type": "integer"
            },
            "warn": {
              "description": "warn logs.",
              "minimum": 0,
              "type": "integer"
            }
          },
          "required": [
            "debug",
            "info",
            "warn",
            "error",
            "fatal"
          ],
          "type": "object"
        },
        "requests": {
          "additionalProperties": false,
          "description": "HTTP requests seen through access logs, by status class.",
          "properties": {
            "s2xx": {
              "description": "Responses 200–299.",
              "minimum": 0,
              "type": "integer"
            },
            "s3xx": {
              "description": "Responses 300–399.",
              "minimum": 0,
              "type": "integer"
            },
            "s4xx": {
              "description": "Responses 400–499.",
              "minimum": 0,
              "type": "integer"
            },
            "s5xx": {
              "description": "Responses 500–599.",
              "minimum": 0,
              "type": "integer"
            },
            "total": {
              "description": "HTTP access logs, 1xx included.",
              "minimum": 0,
              "type": "integer"
            }
          },
          "required": [
            "total",
            "s2xx",
            "s3xx",
            "s4xx",
            "s5xx"
          ],
          "type": "object"
        }
      },
      "required": [
        "logs",
        "requests"
      ],
      "type": "object"
    }
  },
  "required": [
    "range",
    "resolution",
    "timezone",
    "points",
    "totals"
  ],
  "type": "object"
}
```

### 401

unauthorized: no valid session, or the email is not verified.

Problem type: [unauthorized](https://docs.dlogify.com/errors/unauthorized.md).

### 404

not-found: the resource does not exist, or the caller is not a member of its organization.

Problem type: [not-found](https://docs.dlogify.com/errors/not-found.md).

### 422

validation-failed: the request does not match the schema.

Problem type: [validation-failed](https://docs.dlogify.com/errors/validation-failed.md).

### 429

rate-limited: per-user management request limit.

Problem type: [rate-limited](https://docs.dlogify.com/errors/rate-limited.md).

## Example

```bash
curl -X GET "https://api.dlogify.com/v1/projects/{project_id}/activity" \
  -H "Authorization: Bearer $DLOGIFY_SESSION"
```

Source: https://docs.dlogify.com/api/activity/getProjectActivity
