---
title: Whoami
description: Generated HTTP reference for the 1 operation the published OpenAPI document describes under whoami.
---

# Whoami

This page is generated from the published OpenAPI document. It is complete with respect to that document and says nothing about surfaces the document does not describe yet. See [what is generated here](/docs/api/reference) for what that means.

Base URL: `https://api.codespar.dev`

Every operation below requires a Bearer token. See [Authentication](/docs/concepts/authentication).

### GET `/v1/whoami`

What this credential is

**Responses**

| Status | Body | Description |
|---|---|---|
| `200` | [Whoami](/docs/api/reference/schemas#whoami) | OK |

**Response `200`**

| Field | Type | Required | Description |
|---|---|---|---|
| `key` | object | yes | — |
| `organization` | object | yes | — |
| `project` | object | yes | — |
| `user` | object | no | Display only. An API key is scoped to an org and a project, not to a user; this is a representative org member (owner first) for a 'logged in as' line, and it is absent when no member has an email. |

**Example response**

```json
{
  "user": {
    "email": "person@example.com",
    "name": "Example"
  },
  "organization": {
    "id": "whoami_0000000000000000"
  },
  "project": {
    "id": "whoami_0000000000000000"
  },
  "key": {
    "id": "whoami_0000000000000000",
    "environment": "string",
    "scopes": [
      "string"
    ]
  }
}
```

**Example request**

```bash
curl -X GET https://api.codespar.dev/v1/whoami \
  -H "Authorization: Bearer $CODESPAR_API_KEY"
```

