Skip to content
Docs menu

auth

Identity of the caller

6 operations · 16 schemas

GET /v1/auth/me

Who am I

getMe · scope key:read

Returns the authenticated principal: the user and how they authenticated (session or API key, and the key's scopes). List org memberships via GET /v1/orgs. account says whether the person has chosen their handle. It also says how they answered the welcome questions. This tells a client when to ask.

Responses

getMe responses
StatusDescriptionBody
200

The authenticated principal.

Me
401

Missing or invalid credentials.

Problemapplication/problem+json

PATCH /v1/auth/me

Change my handle or my welcome answers

updateMe · scope session

Changes the signed-in person's handle, records their answers to the welcome questions, or both. Only a signed-in person may do this. A key cannot rename the account it belongs to. A handle follows the organization rules: letters, digits and dashes, no dash at either end, at most 64 characters. Case is ignored and the handle is stored in lower case. A handle already used by a user or an organization is a 409. So is a name the site keeps for its own pages. If the old handle ever owned a repository, it keeps pointing at this account. Its repository addresses still resolve, and nobody else can take it. API keys and robots refer to the account by id, so a rename changes nothing for them. An account may hold at most five old handles. Each rename is recorded in the activity feed.

Request body

application/json · required · MeUpdate

updateMe request body
FieldTypeDescription
usernamestring

length 1–64 · pattern ^[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?$

The new handle. Case is ignored.

onboardingOnboardingUpdate

Responses

updateMe responses
StatusDescriptionBody
200

The account after the change.

Me
401

Missing or invalid credentials.

Problemapplication/problem+json
403

Authenticated but not allowed (visibility, membership or scope).

Problemapplication/problem+json
409

State conflict (duplicate handle/slug, wrong repo kind, terminal job, ...).

Problemapplication/problem+json
422

Request failed validation.

Problemapplication/problem+json

DELETE /v1/auth/key

Revoke the API key that calls

revokeOwnApiKey · scope key:read

Ends the API key that sends the request, at once, with the short-lived keys made from it. A program that was handed a key for one job calls it when the job is done, so the key does not outlive it. A key can only end itself this way. Minting, listing and revoking other keys stay with a signed-in person. A session has no key to end (422). Any key may call it, a key limited to some repos too. The revocation is audited as the key's own.

Responses

revokeOwnApiKey responses
StatusDescriptionBody
204

The calling key is revoked.

401

Missing or invalid credentials.

Problemapplication/problem+json
422

Request failed validation.

Problemapplication/problem+json

POST /v1/desktop-sign-ins

Let a desktop app on this computer act as you

authorizeDesktopApp · scope session

The hub's sign-in page calls this when a signed-in person approves a desktop app. The app opened that page itself, with a PKCE challenge and the port it listens on, on this computer only. The answer is a one-time code and the address it goes to, http://127.0.0.1:<port>/callback. The page sends the browser there. Only the app that made the challenge can turn the code into a key (exchangeDesktopCode), so a link sent by someone else yields them nothing. Session only.

Request body

application/json · required · DesktopAuthorize

authorizeDesktopApp request body
FieldTypeDescription
clientrequiredstring

pattern ^[a-z0-9][a-z0-9._/-]{0,63}$

The app and its version, as the app reported it.

device_namerequiredstring

length 1–64

The computer's name as the app reported it. The page says so.

code_challengerequiredstring

pattern ^[A-Za-z0-9_-]{43}$

The PKCE challenge, the base64url SHA-256 of the app's verifier.

code_challenge_methodrequiredstring

one of S256

redirect_portrequiredinteger

≥ 1024 · ≤ 65535

The port the app listens on, on 127.0.0.1 only.

Responses

authorizeDesktopApp responses
StatusDescriptionBody
201

Approved; the browser goes to redirect_uri with the code.

DesktopAuthorization
401

Missing or invalid credentials.

Problemapplication/problem+json
403

Authenticated but not allowed (visibility, membership or scope).

Problemapplication/problem+json
422

Request failed validation.

Problemapplication/problem+json

POST /v1/desktop-sign-ins/token

The desktop app turns its code into a key

exchangeDesktopCode · scope none

The app sends the code it received on its own loopback address and the PKCE verifier only it holds. The answer is a key that expires in seven days, a refresh token, and who the key acts as. A code works once and for one minute. An unknown, used or expired code, and a verifier that does not match, all get the same 404.

Request body

application/json · required · DesktopCodeExchange

exchangeDesktopCode request body
FieldTypeDescription
coderequiredstring

length ≤ 128

code_verifierrequiredstring

length 43–128 · pattern ^[A-Za-z0-9._~-]{43,128}$

Responses

exchangeDesktopCode responses
StatusDescriptionBody
200

Signed in; key.key and refresh_token are shown this once.

DesktopSignInCollected
404

Resource not found (or hidden from the caller).

Problemapplication/problem+json
422

Request failed validation.

Problemapplication/problem+json

POST /v1/desktop-sign-ins/refresh

Renew a desktop app's key

refreshDesktopKey · scope none

Before its key expires, the app sends its refresh token. The answer is a new key and a new refresh token, and the old key stops working. A refresh token works once. Using one twice ends the sign-in, because it means someone else has it too. An expired key renews until thirty days after the last renewal (the grace window). A key the person revoked or rotated on the keys page, or one made from a key that no longer works, ends the sign-in instead (404).

Request body

application/json · required · DesktopRefresh

refreshDesktopKey request body
FieldTypeDescription
refresh_tokenrequiredstring

length ≤ 128

Responses

refreshDesktopKey responses
StatusDescriptionBody
200

Renewed; the new key.key and refresh_token are shown this once.

DesktopSignInCollected
404

Resource not found (or hidden from the caller).

Problemapplication/problem+json
422

Request failed validation.

Problemapplication/problem+json

Schemas (16)

The schemas these operations reach before any other tag’s do. A type that links elsewhere is rendered on that tag’s page.

Me

object

Me fields
FieldTypeDescription
userrequiredUserPublic
authrequiredAuthInfo
accountrequiredMeAccount

MeUpdate

object

Omitted fields are unchanged.

MeUpdate fields
FieldTypeDescription
usernamestring

length 1–64 · pattern ^[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?$

The new handle. Case is ignored.

onboardingOnboardingUpdate

DesktopAuthorize

object

DesktopAuthorize fields
FieldTypeDescription
clientrequiredstring

pattern ^[a-z0-9][a-z0-9._/-]{0,63}$

The app and its version, as the app reported it.

device_namerequiredstring

length 1–64

The computer's name as the app reported it. The page says so.

code_challengerequiredstring

pattern ^[A-Za-z0-9_-]{43}$

The PKCE challenge, the base64url SHA-256 of the app's verifier.

code_challenge_methodrequiredstring

one of S256

redirect_portrequiredinteger

≥ 1024 · ≤ 65535

The port the app listens on, on 127.0.0.1 only.

DesktopAuthorization

object

DesktopAuthorization fields
FieldTypeDescription
coderequiredstring

One use, one minute, and only with the app's verifier.

redirect_urirequiredstring

Where the browser goes with the code, on this computer.

expires_atrequiredstring (date-time)

DesktopCodeExchange

object

DesktopCodeExchange fields
FieldTypeDescription
coderequiredstring

length ≤ 128

code_verifierrequiredstring

length 43–128 · pattern ^[A-Za-z0-9._~-]{43,128}$

DesktopSignInCollected

object

DesktopSignInCollected fields
FieldTypeDescription
keyrequiredApiKeyCreated
refresh_tokenrequiredstring

Renews the key before it expires (refreshDesktopKey). Shown once.

refresh_expires_atrequiredstring (date-time)

After this, unused, the app signs in again.

userrequiredUserPublic

DesktopRefresh

object

DesktopRefresh fields
FieldTypeDescription
refresh_tokenrequiredstring

length ≤ 128

AuthInfo

object

AuthInfo fields
FieldTypeDescription
kindrequiredstring

one of session · api_key

How the caller authenticated.

key_idstring | null

API key id (key_...) when kind is api_key.

scopesrequiredarray of string

Effective scopes, hierarchical: write implies read, train implies write. Sessions carry all three.

expires_atstring (date-time) | null (date-time)

When the API key stops working. Null for a session or a key that does not expire.

limited_toarray of ApiKeyLimit | null

The repos the API key is limited to. Null for a session or an unlimited key.

agentboolean

True when the API key is marked as one an AI agent holds.

MeAccount

object

What only the account's owner sees about their own account. It says whether they chose their handle, and holds their answers to the welcome questions.

MeAccount fields
FieldTypeDescription
handle_chosenrequiredboolean

False while the handle is the one the site made up at the first sign-in. A client then asks the person to choose one.

handle_suggestionrequiredstring | null

A free handle drawn from what the sign-in said about the person, to prefill the handle form. It comes from their username, else the part of their e-mail address before the @. Null when there is nothing to draw from, or the handle was already chosen. Only the person sees it.

onboardingrequiredOnboarding

OnboardingUpdate

object

Omitted fields are unchanged and null clears one. finish marks the welcome screen as done, either by answering or by skipping it.

OnboardingUpdate fields
FieldTypeDescription
roleOnboardingRole | null
institutionstring | null

length ≤ 200

start_withOnboardingStart | null
buildingstring | null

length ≤ 500

finishstring | null

one of finished · skipped

ApiKeyCreated

object

A freshly minted key. key is the plaintext secret and is present only in this response. Store it now. The server keeps an argon2 hash and cannot show it again.

ApiKeyCreated fields
FieldTypeDescription
idrequiredId
namerequiredstring

length 1–128

key_prefixrequiredstring

length ≤ 32

scopesrequiredarray of ApiKeyScope

items 1–3

daily_gpu_hour_quotanumber | null

> 0 · ≤ 999999.99

last_used_atstring (date-time) | null (date-time)
revoked_atstring (date-time) | null (date-time)
expires_atrequiredstring (date-time) | null (date-time)

When the key stops working. Null means it does not expire. After this instant the key answers 401 with a problem that says it expired.

limited_torequiredarray of ApiKeyLimit | null

The repos this key may act on, by their current names. Null means every repo the account can reach. An empty list means every repo it named has since been deleted.

agentrequiredboolean

Marked as a key an AI agent holds. Its rows in the activity feed say agent, and hosted work beyond the free allowance needs a person.

replaced_byrequiredId | null

The key that rotateApiKey made to replace this one. This key then expires within 7 days.

parent_key_idId | null

For a short-lived child (createChildApiKey), the key it was made from. It stops when that key is revoked.

created_atrequiredstring (date-time)
keyrequiredstring

The plaintext key (lucen_sk_...). Shown once.

ApiKeyLimit

string

length ≤ 129 · pattern ^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?/(?:[*]|[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)$

One repo, as owner/slug, or every repo of one owner, as owner/*.

Onboarding

object

The person's answers to the welcome questions.

Onboarding fields
FieldTypeDescription
rolerequiredOnboardingRole | null
institutionrequiredstring | null

length ≤ 200

start_withrequiredOnboardingStart | null
buildingrequiredstring | null

length ≤ 500

What the person said they are building, in their words.

finished_atrequiredstring (date-time) | null (date-time)

When the person finished or skipped the welcome screen. Null means they have not seen it yet, and a client shows it once.

skippedrequiredboolean

True when they left the welcome screen without answering.

OnboardingRole

string

one of student · researcher · lab_pi · robotics_engineer · hobbyist

What the person does, as they said it on the welcome screen.

OnboardingStart

string

one of try_laika · bring_robot · bring_dataset · connect_agent

Where the person chose to start. One of: try the sample robot in sim, bring their own robot, bring a dataset, or connect their own AI.

ApiKeyScope

string

one of read · write · train

Granted scope. Hierarchical: write implies read, train implies write.