# Usage against the plan

`GET /v1/orgs/{org_id}/usage`

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 |
| --- | --- | --- | --- | --- |
| `org_id` | path | string | yes |  |

## Responses

### 200

The organization's plan limits and usage this month.

`application/json`

```json
{
  "additionalProperties": false,
  "description": "The organization's plan limits and usage this month.",
  "properties": {
    "events": {
      "additionalProperties": false,
      "properties": {
        "limit": {
          "type": "integer"
        },
        "used": {
          "type": "integer"
        }
      },
      "required": [
        "used",
        "limit"
      ],
      "type": "object"
    },
    "keys_per_project": {
      "additionalProperties": false,
      "properties": {
        "limit": {
          "type": "integer"
        }
      },
      "required": [
        "limit"
      ],
      "type": "object"
    },
    "members": {
      "additionalProperties": false,
      "properties": {
        "limit": {
          "anyOf": [
            {
              "description": "Null when the plan has no limit.",
              "type": "integer"
            },
            {
              "type": "null"
            }
          ]
        },
        "used": {
          "type": "integer"
        }
      },
      "required": [
        "used",
        "limit"
      ],
      "type": "object"
    },
    "org_id": {
      "pattern": "^org_[0-7][0-9a-hjkmnp-tv-z]{25}$",
      "type": "string"
    },
    "period": {
      "description": "UTC month, YYYY-MM.",
      "pattern": "^\\d{4}-\\d{2}$",
      "type": "string"
    },
    "plan": {
      "type": "string"
    },
    "projects": {
      "additionalProperties": false,
      "properties": {
        "limit": {
          "type": "integer"
        },
        "used": {
          "type": "integer"
        }
      },
      "required": [
        "used",
        "limit"
      ],
      "type": "object"
    },
    "tail": {
      "additionalProperties": false,
      "description": "Live tail limits; sessions in use are counted now, not per month.",
      "properties": {
        "lines_per_second": {
          "additionalProperties": false,
          "properties": {
            "limit": {
              "type": "integer"
            }
          },
          "required": [
            "limit"
          ],
          "type": "object"
        },
        "session_minutes": {
          "additionalProperties": false,
          "properties": {
            "limit": {
              "type": "integer"
            }
          },
          "required": [
            "limit"
          ],
          "type": "object"
        },
        "sessions": {
          "additionalProperties": false,
          "properties": {
            "limit": {
              "type": "integer"
            },
            "used": {
              "description": "Live tail sessions open now across the organization.",
              "type": "integer"
            }
          },
          "required": [
            "used",
            "limit"
          ],
          "type": "object"
        }
      },
      "required": [
        "sessions",
        "lines_per_second",
        "session_minutes"
      ],
      "type": "object"
    }
  },
  "required": [
    "org_id",
    "plan",
    "period",
    "events",
    "projects",
    "members",
    "keys_per_project",
    "tail"
  ],
  "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).

### 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/orgs/{org_id}/usage" \
  -H "Authorization: Bearer $DLOGIFY_SESSION"
```

Source: https://docs.dlogify.com/api/organizations/getOrgUsage
