# Who is calling

Source: https://openpanel.sh/docs/api/organization/who-is-calling

The person behind the credential, the organization the call works in, and what the credential may do.

`GET https://openpanel.sh/api/v1/me`

## Responses

| Status | Meaning | Body |
|---|---|---|
| 200 | Who is calling | `application/json`, `Me` |
| 401 | No valid credential was sent. | `application/problem+json`, `Problem` |
| 403 | The credential may not do this. | `application/problem+json`, `Problem` |
| 429 | Too many requests; wait for Retry-After seconds. | `application/problem+json`, `Problem` |

## Schemas

### Me

```json
{
  "type": "object",
  "properties": {
    "user": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "email": {
          "type": "string"
        }
      },
      "required": [
        "id",
        "name",
        "email"
      ]
    },
    "organization": {
      "$ref": "#/components/schemas/Organization"
    },
    "credential": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "enum": [
            "key",
            "session"
          ]
        },
        "via": {
          "anyOf": [
            {
              "type": "string",
              "enum": [
                "cli",
                "console",
                "oauth"
              ]
            },
            {
              "type": "null"
            }
          ],
          "description": "For a session: where it was made."
        },
        "keyId": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid"
            },
            {
              "type": "null"
            }
          ]
        },
        "scope": {
          "anyOf": [
            {
              "type": "string",
              "enum": [
                "view",
                "deploy",
                "admin"
              ]
            },
            {
              "type": "null"
            }
          ],
          "description": "For an API key: the most it may do."
        },
        "projectIds": {
          "anyOf": [
            {
              "type": "array",
              "items": {
                "type": "string",
                "format": "uuid"
              }
            },
            {
              "type": "null"
            }
          ],
          "description": "For an API key limited to projects: those projects."
        }
      },
      "required": [
        "kind",
        "via",
        "keyId",
        "scope",
        "projectIds"
      ]
    }
  },
  "required": [
    "user",
    "organization",
    "credential"
  ]
}
```

### Organization

```json
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "slug": {
      "type": "string"
    },
    "logo": {
      "type": [
        "string",
        "null"
      ]
    },
    "role": {
      "type": "string",
      "enum": [
        "owner",
        "admin",
        "member",
        "viewer"
      ],
      "description": "The caller's role: member is \"Can deploy\", viewer is \"Can view\"."
    },
    "personal": {
      "type": "boolean",
      "description": "The organization made for the caller's own account."
    }
  },
  "required": [
    "id",
    "name",
    "slug",
    "logo",
    "role",
    "personal"
  ]
}
```

### Problem

```json
{
  "type": "object",
  "properties": {
    "type": {
      "type": "string",
      "description": "A link to the error's explanation in the docs."
    },
    "title": {
      "type": "string"
    },
    "status": {
      "type": "integer"
    },
    "code": {
      "type": "string",
      "description": "Stable machine-readable code: not_found, forbidden, invalid, conflict, rate_limited, not_implemented, …"
    },
    "detail": {
      "type": "string",
      "description": "What went wrong, in a sentence written for a person."
    }
  },
  "required": [
    "type",
    "title",
    "status",
    "code",
    "detail"
  ]
}
```