---
search:
  tags:
    - Me
    - GET
seo:
  description: >-
    Returns what the person who approved this CLI credential consented to: the
    teams it may act on,… Reference for the GET /me/cli endpoint in the varsafe
    API.
sidebar:
  label: Get the CLI grant behind the credential
  badge: GET
title: Get the CLI grant behind the credential
type: openapi-operation
---
Returns what the person who approved this CLI credential consented to: the teams it may act on, the scopes it holds per team, and any project or environment restriction. This is what `varsafe whoami` prints.

`GET /me/cli`

**Responses**

- `200` — Success.
- `400` — The request failed validation. \`field\` names the offending input.
- `401` — No credential was presented, or it is invalid or revoked.
- `403` — The credential is valid but lacks the required scope, role or team access.
- `404` — The resource does not exist, or is not visible to this credential.
- `429` — Rate limited. Retry after the interval named in the response.
- `500` — Unexpected server error. The body never carries internal detail.

Response example, 200:

```json
{
  "account": {
    "userId": "string",
    "email": "user@example.com",
    "name": "string"
  },
  "grant": {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "name": "string",
    "createdAt": "2019-08-24T14:15:22Z",
    "lastUsedAt": "2019-08-24T14:15:22Z",
    "lastUsedIp": "string",
    "expiresAt": "2019-08-24T14:15:22Z",
    "teams": [
      {
        "teamId": "a4ede8ba-7c0a-4485-8763-cbd9b282fbec",
        "teamName": "string",
        "scopes": [
          "secrets:read"
        ],
        "projectSelection": "all",
        "environmentSelection": "all"
      }
    ]
  }
}
```
