Nuvelics documentation
APIAPI reference

Session

See who the current credential acts as and in which organization, switch a session to another of your organizations, and sign out.

GET
/api/tenant/v1/auth/me

Authorization

headerx-api-key<token>

A service key (nvs_...) in the x-api-key header. A service key belongs to one organization: an X-Org-Id header is optional and, when sent, must name that organization. This header also accepts any credential the bearer scheme does, and when a request sends both headers, this one is used.

Response Body

Current principal snapshot

application/json
  1. response
userId*string

Authenticated user identifier

Match^[0-7][0-9A-HJKMNP-TV-Z]{25}$
email*string

User email address

Formatemail
name?string

User display name

locale?string

User's preferred UI locale, cached from the account record

activeOrgId*string

Currently selected org, or null for an org-less (orphan) session

Match^[0-7][0-9A-HJKMNP-TV-Z]{25}$
orgs*array<>

Organizations the user is a member of

Example Request
curl -X GET 'https://api.nuvelics.com/api/tenant/v1/auth/me'
Example Response
{  "userId": "string",  "email": "user@example.com",  "name": "string",  "locale": "string",  "activeOrgId": "string",  "orgs": [    {      "orgId": "string",      "slug": "string",      "name": "string",      "role": "owner"    }  ]}
GET
/api/tenant/v1/auth/org-context

Authorization

headerx-api-key<token>

A service key (nvs_...) in the x-api-key header. A service key belongs to one organization: an X-Org-Id header is optional and, when sent, must name that organization. This header also accepts any credential the bearer scheme does, and when a request sends both headers, this one is used.

Response Body

Org the caller's credential is bound to, and their role in it

application/json
  1. response
orgId*string

Organization the request's credential is bound to

Match^[0-7][0-9A-HJKMNP-TV-Z]{25}$
orgSlug*string

Slug of that organization

role*string

Role within an organization

Value in"owner""admin""member""viewer"
Example Request
curl -X GET 'https://api.nuvelics.com/api/tenant/v1/auth/org-context'
Example Response
{  "orgId": "string",  "orgSlug": "string",  "role": "owner"}
POST
/api/tenant/v1/auth/switch-org

Authorization

headerx-api-key<token>

A service key (nvs_...) in the x-api-key header. A service key belongs to one organization: an X-Org-Id header is optional and, when sent, must name that organization. This header also accepts any credential the bearer scheme does, and when a request sends both headers, this one is used.

Request Body

application/json
  1. body
orgId*string

Target organization identifier

Length1 <= length

Response Body

Updated principal snapshot after org switch

application/json
  1. response
userId*string

Authenticated user identifier

Match^[0-7][0-9A-HJKMNP-TV-Z]{25}$
email*string

User email address

Formatemail
name?string

User display name

locale?string

User's preferred UI locale, cached from the account record

activeOrgId*string

Currently selected org, or null for an org-less (orphan) session

Match^[0-7][0-9A-HJKMNP-TV-Z]{25}$
orgs*array<>

Organizations the user is a member of

Example Request
curl -X POST 'https://api.nuvelics.com/api/tenant/v1/auth/switch-org' \  -H 'Content-Type: application/json' \  -d '{  "orgId": "string"}'
Example Response
{  "userId": "string",  "email": "user@example.com",  "name": "string",  "locale": "string",  "activeOrgId": "string",  "orgs": [    {      "orgId": "string",      "slug": "string",      "name": "string",      "role": "owner"    }  ]}
POST
/api/tenant/v1/auth/logout

Authorization

headerx-api-key<token>

A service key (nvs_...) in the x-api-key header. A service key belongs to one organization: an X-Org-Id header is optional and, when sent, must name that organization. This header also accepts any credential the bearer scheme does, and when a request sends both headers, this one is used.

Response Body

Session revoked

Example Request
curl -X POST 'https://api.nuvelics.com/api/tenant/v1/auth/logout'
Example Response
Empty

Report a problem with this page

On this page