---
title: "Stats Environments"
method: GET
path: "/v2/projects/{proj_id}/envs/{env_id}/stats"
tags: ["Environments"]
---

# Stats Environments

`GET /v2/projects/{proj_id}/envs/{env_id}/stats`

## Path parameters

- `proj_id` string, required — Either the unique id of the project, or the URL-friendly key of the project (i.e: the "slug").
- `env_id` string, required — Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the "slug").

## Response `200`

Successful Response

- EnvironmentStats
  - `key` string, required — A URL-friendly name of the environment (i.e: slug). You will be able to query later using this key instead of the id (UUID) of the environment.
  - `id` string, uuid, required — Unique id of the environment
  - `organization_id` string, uuid, required — Unique id of the organization that the environment belongs to.
  - `project_id` string, uuid, required — Unique id of the project that the environment belongs to.
  - `created_at` string, date-time, required — Date and time when the environment was created (ISO_8601 format).
  - `updated_at` string, date-time, required — Date and time when the environment was last updated/modified (ISO_8601 format).
  - `avp_policy_store_id` string
  - `name` string, required — The name of the environment
  - `description` string — an optional longer description of the environment
  - `custom_branch_name` string — when using gitops feature, an optional branch name for the environment
  - `jwks` JwksConfig
    - `ttl` integer — JWKS cache TTL (in seconds)
    - `url` string — ...
    - `jwks` JwksObj
      - `keys` object[], required — The keys to match against the request headers
  - `settings` object — the settings for this environment
  - `pdp_configs` PDPConfigRead[], required
    - `id` string, uuid, required
    - `name` string
    - `organization_id` string, uuid, required — Unique id of the organization that the pdp_config belongs to.
    - `project_id` string, uuid, required — Unique id of the project that the pdp_config belongs to.
    - `environment_id` string, uuid, required — Unique id of the environment that the pdp_config belongs to.
    - `client_secret` string, required
    - `opal_server_access_token` string
    - `num_shards` integer
    - `debug_audit_logs` boolean — Whether debug audit logs are enabled or not
    - `min_pdp_version` string — The minimum image version of PDP that can connect to this config
  - `stats` EnvironmentStatistics, required
    - `roles` integer, required
    - `users` integer, required
    - `policies` integer, required
    - `resources` integer, required
    - `tenants` integer, required
    - `has_decision_logs` boolean, required
    - `members` OrgMemberReadWithGrants[], required
      - `id` string, uuid, required — Unique id of the account member
      - `email` string, email, required — Email of the user controlling this account
      - `email_verified` boolean, required — Whether this email address is verified or not. For social providers like 'Login with Google' this is done automatically, otherwise we will send the user a verification link in email.
      - `name` string — Name of this user
      - `given_name` string — First name of the user
      - `family_name` string — Last name of the user
      - `picture` string — URL to picture, photo, or avatar of the user that controls this account.
      - `is_superuser` boolean, required — Whether or not this user has special access to permit.io organizations
      - `is_onboarding` boolean, required — Whether or not this user is currently onboarding, needs to be replaced by a user journey object
      - `onboarding_step` 'create_organization' | 'create_project' | 'create_resource' | 'create_actions' | 'assign_permissions' | 'assign_user_roles' | 'connect_sdk' | 'done', required — An enumeration.
      - `created_at` string, date-time, required — Date and time when the account member was created (ISO_8601 format).
      - `last_login` string, date-time — Last date and time this user logged in (ISO_8601 format).
      - `last_ip` string — Last IP address from which this user logged in.
      - `logins_count` integer — Total number of logins this user has performed.
      - `identities` IdentityRead[], required
        - `user_id` string, required — Unique User Id of this identity in the identity provider (including the provider type)
        - `provider` string, required — The identity provider type this identity came from
        - `sub` string, required — Unique User Id of this identity in the identity provider (NOT including the provider type)
        - `email` string, email, required — Email connected to this account identity
        - `email_verified` boolean, required — Whether this email address connected to this account identity is verified or not. For social providers like 'Login with Google' this is done automatically, otherwise we will send the user a verification link in email.
        - `auth0_info` object, required — Raw user info json coming from our identity provider and matching a specific account identity
      - `invite` InviteRead
        - `member_id` string, uuid — Unique id of the invite
        - `email` string, email, required — The invited member's email address
        - `role` 'admin' | 'write' | 'read' | 'no_access' — An enumeration.
        - `id` string, uuid, required — Unique id of the invite
        - `organization_id` string, uuid, required — Unique id of the organization that the invite belongs to.
        - `invite_code` string, uuid, required — The invite code that is sent to the member's email
        - `created_at` string, date-time, required — Date and time when the invite was created (ISO_8601 format).
        - `status` 'pending' | 'accepted' | 'failed' | 'canceled', required — An enumeration.
        - `failed_reason` string — if failed, the reason the invitation failed
      - `settings` object, required — Custom permit.io dashboard settings, such as preferred theme, etc.
      - `grants` Permission[], required
        - `organization_id` string, uuid, required
        - `project_id` string, uuid
        - `environment_id` string, uuid
        - `object_type` 'org' | 'project' | 'env', required — An enumeration.
        - `access_level` 'admin' | 'write' | 'read' | 'no_access', required — An enumeration.
        - `organization_key` string
        - `project_key` string
        - `environment_key` string
        - `organization_name` string
        - `project_name` string
        - `environment_name` string
    - `mau` integer, required

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.dev/permit/apis/permit-io-api.md) · [All operations](https://skmtc.dev/permit/apis/permit-io-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/permit/permit-io-api/revisions/13faa12b4692/schema)
