Get current user
Return the principal behind the credentials you just sent: which user it acts as, whether it is an OAuth token or an API key, and which scopes it carries.
Call this first with a new key or a newly authorized OAuth app. A 200 confirms the credential is accepted and shows its scopes, so you can check whether an endpoint is in scope before you debug it.
Path parameters
None. The path is fixed. It has no {slug} and no user id because the endpoint describes the credential, not a workspace or a user you choose.
Query parameters
None. The endpoint has no filters, no pagination, and no ?expand=.
Scopes
profile:read or the global read scope. There is no users:* scope.
An API key can always call it. An OAuth token without profile:read or read gets 403, even when it holds other fine-grained scopes such as projects.work_items:read. Ask for profile:read when your app only needs to know who the user is.
Errors
| Status | Code | Cause |
|---|---|---|
401 | unauthorized | Missing or invalid credentials: a wrong key, the wrong header, or an expired or revoked OAuth token. |
402 | payment_required | The feature this endpoint belongs to isn't enabled on your plan, or is switched off. |
403 | forbidden | The credential is valid, but it is an OAuth token with neither profile:read nor read. |
404 | not_found | The calling principal could not be resolved to a user record. |
406 | not_acceptable | The Accept header asks for a representation the API can't produce. |
429 | rate_limited | Throttled. Honor the Retry-After header before retrying. |
Separate 401 from 403 before you debug anything else
A 401 here means the credential is wrong, so no other endpoint will work either. A 200 here and a 403 elsewhere means the credential is fine, but the scope or role is too narrow for that endpoint. Compare its documented scope with the scopes array in this response.
Send the key as X-Api-Key
v2 reads the API key from X-Api-Key, or an OAuth token from Authorization: Bearer <token>. v1's X-API-Key casing is a common cause of a 401 here when porting a v1 client. See Authentication.
A 409 isn't a credential problem
If your scopes look right and a write still returns 409 work_item_types_managed_at_workspace or work_item_types_managed_at_project, the credential is fine. The workspace manages work item types on the other surface, and the same call succeeds there. See Work item type modes.
curl -X GET \
"https://api.plane.so/api/v2/users/me/" \
-H "X-Api-Key: $PLANE_API_KEY"import requests
response = requests.get(
"https://api.plane.so/api/v2/users/me/",
headers={"X-Api-Key": "your-api-key"},
)
me = response.json()
print(me["principal_kind"], me["email"])
# API keys aren't scope-limited, so only an OAuth token's scopes are worth checking.
if me["principal_kind"] == "oauth" and not {"write", "projects.work_items:write"} & set(me["scopes"]):
raise SystemExit("This token cannot create work items.")const response = await fetch("https://api.plane.so/api/v2/users/me/", {
headers: {
"X-Api-Key": "your-api-key",
},
});
const me = await response.json();
// API keys aren't scope-limited, so only an OAuth token's scopes are worth checking.
const canWriteWorkItems =
me.principal_kind !== "oauth" ||
me.scopes.includes("write") ||
me.scopes.includes("projects.work_items:write");{
"id": "16c61a3a-512a-48ac-b0be-b6b46fe6f430",
"display_name": "Priya Raghavan",
"email": "priya@example.com",
"principal_kind": "oauth",
"scopes": [
"profile:read",
"projects.work_items:read",
"projects.work_items:write",
"projects.states:read",
"workspaces.members:read"
],
"application": {
"id": "8f0e2a64-5b1d-4c7e-9a3f-2d6b1e4c7a90",
"slug": "acme-sync",
"name": "Acme Sync"
},
"on_behalf_of_user": true
}{
"id": "16c61a3a-512a-48ac-b0be-b6b46fe6f430",
"display_name": "Priya Raghavan",
"email": "priya@example.com",
"principal_kind": "api_key",
"scopes": [],
"application": null,
"on_behalf_of_user": false
}{
"type": "unauthorized",
"code": "unauthorized",
"detail": "Authentication credentials were not provided or are invalid."
}Reading the response
principal_kindis the credential type:oauthfor an application token acting for a user,api_keyfor a personal key, andotherfor anything else the server authenticates.scopesis the OAuth grant. For an OAuth token, it lists the scopes the user consented to. Check it against the scope named on the endpoint you're calling. An API key returns an empty array because keys aren't scope-limited.applicationis the OAuth app the token was issued to (id,slug,name), ornullfor an API key.on_behalf_of_useristruewhen the app acts for the signed-in user andfalsefor an app's own client credentials token or an API key.idis the identity your writes carry. It appears ascreated_by_idon objects you create and asactor_idin audit logs.- The response doesn't include roles. Scopes limit what a token may attempt, and the user's role in each workspace and project decides whether it succeeds. A
403when the right scope is listed here is a role problem.
Related
- Users overview
- Authentication
- Members overview: the roster where this
idappears asmember_id - Errors: the full list of error codes

