Skip to Content
CosmicAC Logo
API referenceApp node API

Authentication routes

Sign-in, sessions, OAuth and passkey flows.

/oauth/google/callback

GET
/oauth/google/callback

Response Body

Default Response

Example Request
curl -X GET 'https://your-app-node-url/oauth/google/callback'
Example Response200
Empty

/oauth/exchange

POST
/oauth/exchange

Request Body

application/json
  1. body
code*string
Length1 <= length

Response Body

Default Response

Example Request
curl -X POST 'https://your-app-node-url/oauth/exchange' \  -H 'Content-Type: application/json' \  -d '{  "code": "string"}'
Example Response200
Empty

/oauth/cli/authorize

GET
/oauth/cli/authorize

Query Parameters

redirect_uri*string
Match^http://127\.0\.0\.1:([1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])/callback$
state*string
Length1 <= length <= 512
client_name?string
Lengthlength <= 128

Response Body

Default Response

Example Request
curl -X GET 'https://your-app-node-url/oauth/cli/authorize?redirect_uri=string&state=string'
Example Response200
Empty
GET
/oauth/cli/session/{sessionId}

Path Parameters

sessionId*string
Match^[0-9a-f]{64}$

Response Body

Default Response

Example Request
curl -X GET 'https://your-app-node-url/oauth/cli/session/string'
Example Response200
Empty

/oauth/cli/exchange

POST
/oauth/cli/exchange

Authorization

ttrToken
headerttr-token<token>

Session token issued by sign-in. Sent as the ttr-token header.

Request Body

application/json
  1. body
session*string
teamId?string

Response Body

Default Response

Example Request
curl -X POST 'https://your-app-node-url/oauth/cli/exchange' \  -H 'ttr-token: <session-token>' \  -H 'Content-Type: application/json' \  -d '{  "session": "string"}'
Example Response200
Empty

/login

POST
/login

Request Body

application/json
  1. body
email*string
Formatemail
password*string
Length1 <= length

Response Body

Default Response

Example Request
curl -X POST 'https://your-app-node-url/login' \  -H 'Content-Type: application/json' \  -d '{  "email": "user@example.com",  "password": "string"}'
Example Response200
Empty

/pwd/forgot

POST
/pwd/forgot

Request Body

application/json
  1. body
email*string
Formatemail

Response Body

Default Response

Example Request
curl -X POST 'https://your-app-node-url/pwd/forgot' \  -H 'Content-Type: application/json' \  -d '{  "email": "user@example.com"}'
Example Response200
Empty

/pwd/reset

POST
/pwd/reset

Request Body

application/json
  1. body
email*string
Formatemail
token*string
new_password*string
Length6 <= length

Response Body

Default Response

Example Request
curl -X POST 'https://your-app-node-url/pwd/reset' \  -H 'Content-Type: application/json' \  -d '{  "email": "user@example.com",  "token": "string",  "new_password": "string"}'
Example Response200
Empty

/pwd/reset/verify

POST
/pwd/reset/verify

Request Body

application/json
  1. body
email*string
Formatemail
token*string

Response Body

Default Response

Example Request
curl -X POST 'https://your-app-node-url/pwd/reset/verify' \  -H 'Content-Type: application/json' \  -d '{  "email": "user@example.com",  "token": "string"}'
Example Response200
Empty

/auth/userinfo

GET
/auth/userinfo

Authorization

ttrToken
headerttr-token<token>

Session token issued by sign-in. Sent as the ttr-token header.

Response Body

Default Response

Example Request
curl -X GET 'https://your-app-node-url/auth/userinfo' \  -H 'ttr-token: <session-token>'
Example Response200
Empty

/auth/userinfo

PATCH
/auth/userinfo

Authorization

ttrToken
headerttr-token<token>

Session token issued by sign-in. Sent as the ttr-token header.

Request Body

application/json
  1. body
name?|
Length1 <= length
title?|
Length1 <= length
picture?|
Formaturi

Response Body

Default Response

Example Request
curl -X PATCH 'https://your-app-node-url/auth/userinfo' \  -H 'ttr-token: <session-token>' \  -H 'Content-Type: application/json' \  -d '{}'
Example Response200
Empty

/auth/change-password

POST
/auth/change-password

Authorization

ttrToken
headerttr-token<token>

Session token issued by sign-in. Sent as the ttr-token header.

Request Body

application/json
  1. body
current_password*string
Length6 <= length
new_password*string
Length6 <= length

Response Body

Default Response

Example Request
curl -X POST 'https://your-app-node-url/auth/change-password' \  -H 'ttr-token: <session-token>' \  -H 'Content-Type: application/json' \  -d '{  "current_password": "string",  "new_password": "string"}'
Example Response200
Empty

/auth/logout

POST
/auth/logout

Authorization

ttrToken
headerttr-token<token>

Session token issued by sign-in. Sent as the ttr-token header.

Response Body

Default Response

Example Request
curl -X POST 'https://your-app-node-url/auth/logout' \  -H 'ttr-token: <session-token>'
Example Response200
Empty

/auth/logout/all

POST
/auth/logout/all

Authorization

ttrToken
headerttr-token<token>

Session token issued by sign-in. Sent as the ttr-token header.

Response Body

Default Response

Example Request
curl -X POST 'https://your-app-node-url/auth/logout/all' \  -H 'ttr-token: <session-token>'
Example Response200
Empty

/auth/token

POST
/auth/token

Authorization

ttrToken
headerttr-token<token>

Session token issued by sign-in. Sent as the ttr-token header.

Request Body

application/json
  1. body
teamId?string
ttl?number

Response Body

Default Response

Example Request
curl -X POST 'https://your-app-node-url/auth/token' \  -H 'ttr-token: <session-token>' \  -H 'Content-Type: application/json' \  -d '{}'
Example Response200
Empty

/auth/team-auth

POST
/auth/team-auth

Authorization

ttrToken
headerttr-token<token>

Session token issued by sign-in. Sent as the ttr-token header.

Response Body

Default Response

Example Request
curl -X POST 'https://your-app-node-url/auth/team-auth' \  -H 'ttr-token: <session-token>'
Example Response200
Empty