nemar auth login and nemar auth signup drive this flow (RFC 8628, the OAuth 2.0 Device Authorization Grant):
Method
Endpoint
Who calls it
Description
POST
/auth/device/start
CLI
Mint a device code and an 8-character user code
POST
/auth/device/token
CLI
Poll for the API key once the code is confirmed
GET
/auth/device/lookup
Browser (session)
Read what a code names, before confirming or denying
POST
/auth/device/confirm
Browser (session)
Authorize the code; mints nothing itself, the key is minted only when the CLI collects it at /token
POST
/auth/device/deny
Browser (session)
Decline the code
POST /auth/device/token answers HTTP 400 with an error code the CLI’s poll loop switches on
(authorization_pending, slow_down, and the three terminal codes expired_token, access_denied, invalid_grant).
A terminal answer also carries reason, the more specific refusal code below:
{
"error": "expired_token",
"reason": "device_code_expired",
"message": "The code expired. Run `nemar auth login` again for a new one."
Full-text and semantic dataset search (?q=). Returns the datasets the caller can see: public ones for everyone, plus the caller’s own and collaborated private datasets with a Bearer token, and every dataset for an administrator. Private datasets match by full text; semantic matching for them is enabled separately
GET
/datasets/resolve/:sourceId
Resolve a source ID (e.g. OpenNeuro accession) to a NEMAR dataset
GET
/datasets/:id
Get dataset details
POST
/datasets
Create dataset
POST
/datasets/:id/upload-urls
Get presigned URLs for direct file upload
POST
/datasets/:id/upload-credentials
Get temporary S3 credentials for upload
POST
/datasets/:id/download-credentials
Get temporary S3 credentials for download
GET
/datasets/:id/manifest
Get the latest version manifest
GET
/datasets/:id/versions
List dataset versions (owner, collaborator or admin); each entry carries source_version, source_version_basis and mirror (the mirror flag)
PUT
/datasets/:id/attestation
Record the deposit attestation, with the upload’s identifier preflight, on a private dataset an upload is resuming (owner or admin)
POST
/datasets/:id/publish/request
Request publication of a dataset; starts the identifier screen and returns the neutral request_notice lines
GET
/datasets/:id/publish/status
Check publication request status, including its identifier_screen view