---
title: "Get the authenticated user id"
method: GET
path: "/api/v1/user/identity"
tags: ["Account"]
---

# Get the authenticated user id

`GET /api/v1/user/identity`

## Request

- Base URL: `https://app.promptingco.com`
- URL: `https://app.promptingco.com/api/v1/user/identity`
- Auth: one of:
  - API key in header `x-api-key`
  - HTTP bearer
  - API key in cookie `better-auth.session_token`

Returns the better-auth user id behind the credential. Organization API keys resolve to the user who created the key. Service accounts have no user and are rejected.

## Response `200`

Successful response

- object
  - `ok` true, required
  - `data` object, required
    - `id` string, required: Better Auth user id. This is the PostHog distinct id used by the web app.

## Other responses

- `400`: Bad request
- `401`: Authentication required
- `403`: Forbidden
- `404`: Not found
- `422`: Validation failed
- `500`: Internal server error

---

[API](https://skmtc.dev/promptingcompany/apis/the-prompting-company-api.md) - [All operations](https://skmtc.dev/promptingcompany/apis/the-prompting-company-api/llms.txt) - [OpenAPI document](https://skmtc.dev/promptingcompany/apis/the-prompting-company-api/revisions/c0451ea10e9a?raw)
