# Logs by weekday and hour

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

Requires role member or higher.

## 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 |
| --- | --- | --- | --- | --- |
| `days` | query | integer | no |  |
| `project_id` | path | string | yes |  |

## Responses

### 200

Logs of the last 7 or 30 days by local weekday and hour, ordered by weekday then hour.

`application/json`

```json
{
  "additionalProperties": false,
  "description": "Logs of the last 7 or 30 days by local weekday and hour, ordered by weekday then hour.",
  "properties": {
    "cells": {
      "items": {
        "additionalProperties": false,
        "properties": {
          "hour": {
            "description": "Local hour.",
            "maximum": 23,
            "minimum": 0,
            "type": "integer"
          },
          "hours": {
            "description": "Hours of the window that fall in this cell: 1 for 7 days; 4 or 5 for 30 days, which are not whole weeks. Divide `logs` by it to compare cells.",
            "minimum": 0,
            "type": "integer"
          },
          "levels": {
            "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"
          },
          "logs": {
            "description": "All logs, the sum of `levels`.",
            "minimum": 0,
            "type": "integer"
          },
          "requests": {
            "description": "HTTP access logs.",
            "minimum": 0,
            "type": "integer"
          },
          "weekday": {
            "description": "ISO weekday, 1 = Monday.",
            "maximum": 7,
            "minimum": 1,
            "type": "integer"
          }
        },
        "required": [
          "weekday",
          "hour",
          "logs",
          "levels",
          "requests",
          "hours"
        ],
        "type": "object"
      },
      "maxItems": 168,
      "minItems": 168,
      "type": "array"
    },
    "days": {
      "anyOf": [
        {
          "enum": [
            7
          ],
          "type": "number"
        },
        {
          "enum": [
            30
          ],
          "type": "number"
        }
      ]
    },
    "timezone": {
      "type": "string"
    }
  },
  "required": [
    "days",
    "timezone",
    "cells"
  ],
  "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/heatmap" \
  -H "Authorization: Bearer $DLOGIFY_SESSION"
```

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