> ## Documentation Index
> Fetch the complete documentation index at: https://docs.usehasp.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Identity

> Look up who the calling credential is: its organization, the person it belongs to, and the credential's own label and scopes.

Returns the identity of the credential that makes the request. Any valid credential can call it; no scope is required. The response only ever describes the calling credential and its own organization. `hasp whoami` uses this endpoint.

## Get identity

```
GET https://api.usehasp.com/v1/me
Authorization: Bearer hasp_pat_live_...
```

### Response

```json theme={null}
{
  "success": true,
  "data": {
    "object": "identity",
    "caller_type": "developer",
    "user": {
      "id": "01JZ0000000000000000000000",
      "name": "Ada Lovelace",
      "email": "ada@example.com"
    },
    "organization": {
      "id": "01JZ0000000000000000000001",
      "name": "Example Health",
      "slug": "example-health"
    },
    "credential": {
      "type": "developer",
      "id": "01JZ0000000000000000000002",
      "name": "ada-laptop",
      "last_four": "9f2a",
      "mode": "live",
      "scopes": ["inference:write"]
    }
  }
}
```

### Fields

| Field | Description |
| - | - |
| `caller_type` | The kind of credential: `developer` (a `hasp login` credential), `api_key`, or `agent`. |
| `user` | The person the credential belongs to. Only a developer credential belongs to a person; for an API key or an agent credential this is `null`, and the user who issued it isn't disclosed. |
| `organization` | The credential's organization: `id`, `name`, `slug`. |
| `credential.type` | Same as `caller_type`. |
| `credential.id` | The credential's id. |
| `credential.name` | The credential's label (for a developer credential, the machine name it was issued under), or `null` for an agent credential. |
| `credential.last_four` | The last four characters of the credential, as shown in the dashboard, or `null` for an agent credential. |
| `credential.mode` | `live` or `test`. |
| `credential.scopes` | The scopes the credential carries. |

## Error codes

| Code | HTTP | Description |
| - | - | - |
| `INVALID_API_KEY` | 401 | Missing, invalid, or revoked credential |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.