Skip to content

Session Endpoints

POST /login

Login to Cumulonimbus.

Kill Switch Behavior

This endpoint is affected by the following kill switches:

  • ACCOUNT_LOGIN(4)

and will fail with the error ServiceUnavailable if any of these kill switches are enabled.

Ratelimit

This endpoint uses a ratelimit that is separate from the rest of the API. This ratelimit is 3 requests per 3 minutes per IP address. If you try to register an account while providing a session, you will receive an InvalidSession error.

Identity Reverification

This endpoint will require you to provide your password to confirm it's you. More information can found in the Identity Reverification section.

Username and password do NOT need to be resupplied when responding to a second factor challenge, only rememberMe.

Parameters

NameTypeLocationRequiredDescription
usernamestringbodyyesThe username of the account to login to.
passwordstringbodyyesThe password of the account to login to.
rememberMebooleanbodynoWhether or not to remember the session.

Example Requests

sh
curl -X POST \
-H "Content-Type: application/json" \
-d '{"username": "alekeagle", "password": "password", "rememberMe": true}' \
https://alekeagle.me/api/login
js
fetch('https://alekeagle.me/api/login', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    username: 'alekeagle',
    password: 'password',
    rememberMe: true,
  }),
});

Responses

POST /users/me/sessions

Create a scoped session with specific scopes.

Kill Switch Behavior

This endpoint is affected by the following kill switches:

  • ACCOUNT_MODIFY(1)
  • ACCOUNT_LOGIN(4)

and will fail with the error ServiceUnavailable if any of these kill switches are enabled.

Scoped Session

Requests to this endpoint using a scoped session are not allowed in order to prevent additional sessions to be created without explicit user consent.

Identity Reverification

This endpoint will require you to provide your password to confirm it's you. More information can found in the Identity Reverification section.

Parameters

NameTypeLocationRequiredDescription
namestringbodyYesA friendly name to give the scoped session.
permissionFlagsnumberbodyYesThe session scopes you'd like to grant to this scoped session.
longLivedbooleanbodyNoWhether you would like this session to last 24 hours or 10 years.

Example Requests

sh
curl -X POST \
-H "Authorization: eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoiVGhlIGV4YW1wbGUgdG9rZW4gZm9yIGRvY3MuYWxla2VhZ2xlLm1lIiwic3ViIjoiMTY0NzAxNTAyODYyNiIsImlhdCI6MTY4NzA2NzYxNCwiZXhwIjoyMDAyNjQzNjE0fQ.qAwhjhtGT56iAI52EsdVYcaTjmLPeR51TALkJ1CwRlfyDHwrsOTzAe8Y3za_tJqkvSaohwQq4cD7lZbTzMSw8Q" \
-H "Content-Type: application/json" \
-d '{"name":"Upload Only Token", "permissionFlags": 2, "longLived": true}' \
https://alekeagle.me/api/users/me/sessions
js
fetch('https://alekeagle.me/api/users/me/sessions', {
  method: 'POST',
  headers: {
    'Authorization':
      'eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoiVGhlIGV4YW1wbGUgdG9rZW4gZm9yIGRvY3MuYWxla2VhZ2xlLm1lIiwic3ViIjoiMTY0NzAxNTAyODYyNiIsImlhdCI6MTY4NzA2NzYxNCwiZXhwIjoyMDAyNjQzNjE0fQ.qAwhjhtGT56iAI52EsdVYcaTjmLPeR51TALkJ1CwRlfyDHwrsOTzAe8Y3za_tJqkvSaohwQq4cD7lZbTzMSw8Q',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    name: 'Upload Only Token',
    permissionFlags: 2
    longLived: true
  }),
});

Responses

GET /users/me/sessions/:sid

Get a session of the current user.

Scoped Session

Requests to this endpoint using a scoped session require the session to have the SESSION_READ scope.

Parameters

NameTypeLocationRequiredDescription
sidstringpathyesThe session ID. Can be me to get the current session.

Example Requests

sh
curl -X GET \
-H "Authorization: eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoiVGhlIGV4YW1wbGUgdG9rZW4gZm9yIGRvY3MuYWxla2VhZ2xlLm1lIiwic3ViIjoiMTY0NzAxNTAyODYyNiIsImlhdCI6MTY4NzA2NzYxNCwiZXhwIjoyMDAyNjQzNjE0fQ.qAwhjhtGT56iAI52EsdVYcaTjmLPeR51TALkJ1CwRlfyDHwrsOTzAe8Y3za_tJqkvSaohwQq4cD7lZbTzMSw8Q" \
https://alekeagle.me/api/users/me/sessions/me
js
fetch('https://alekeagle.me/api/me/sessions/me', {
  method: 'GET',
  headers: {
    Authorization:
      'eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoiVGhlIGV4YW1wbGUgdG9rZW4gZm9yIGRvY3MuYWxla2VhZ2xlLm1lIiwic3ViIjoiMTY0NzAxNTAyODYyNiIsImlhdCI6MTY4NzA2NzYxNCwiZXhwIjoyMDAyNjQzNjE0fQ.qAwhjhtGT56iAI52EsdVYcaTjmLPeR51TALkJ1CwRlfyDHwrsOTzAe8Y3za_tJqkvSaohwQq4cD7lZbTzMSw8Q',
  },
});

Responses

GET /users/:uid/sessions/:sid

Get a session of a specified user.

Non-Public Endpoint

This endpoint is not public and requires authentication of a user with staff permissions.

Scoped Session

Requests to this endpoint using a scoped session require the session to have the STAFF_READ_SESSIONS scope.

Parameters

NameTypeLocationRequiredDescription
uidstringpathyesThe User's ID
sidstringpathyesThe session ID.

Example Requests

sh
curl -X GET \
-H "Authorization: eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoiVGhlIGV4YW1wbGUgdG9rZW4gZm9yIGRvY3MuYWxla2VhZ2xlLm1lIiwic3ViIjoiMTY0NzAxNTAyODYyNiIsImlhdCI6MTY4NzA2NzYxNCwiZXhwIjoyMDAyNjQzNjE0fQ.qAwhjhtGT56iAI52EsdVYcaTjmLPeR51TALkJ1CwRlfyDHwrsOTzAe8Y3za_tJqkvSaohwQq4cD7lZbTzMSw8Q" \
https://alekeagle.me/api/users/1234567890123/sessions/1234567890
js
fetch('https://alekeagle.me/api/1234567890123/sessions/1234567890', {
  method: 'GET',
  headers: {
    Authorization:
      'eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoiVGhlIGV4YW1wbGUgdG9rZW4gZm9yIGRvY3MuYWxla2VhZ2xlLm1lIiwic3ViIjoiMTY0NzAxNTAyODYyNiIsImlhdCI6MTY4NzA2NzYxNCwiZXhwIjoyMDAyNjQzNjE0fQ.qAwhjhtGT56iAI52EsdVYcaTjmLPeR51TALkJ1CwRlfyDHwrsOTzAe8Y3za_tJqkvSaohwQq4cD7lZbTzMSw8Q',
  },
});

Responses

GET /users/me/sessions

Fetch a list of sessions for the current user.

Scoped Session

Requests to this endpoint using a scoped session require the session to have the SESSION_READ scope.

Parameters

NameTypeLocationRequiredDescription
limitnumberquerynoThe maximum number of sessions to return. (Default and max: 50)
offsetnumberquerynoThe number of sessions to skip. (Default: 0)

Example Requests

sh
curl -X GET \
-H "Authorization: eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoiVGhlIGV4YW1wbGUgdG9rZW4gZm9yIGRvY3MuYWxla2VhZ2xlLm1lIiwic3ViIjoiMTY0NzAxNTAyODYyNiIsImlhdCI6MTY4NzA2NzYxNCwiZXhwIjoyMDAyNjQzNjE0fQ.qAwhjhtGT56iAI52EsdVYcaTjmLPeR51TALkJ1CwRlfyDHwrsOTzAe8Y3za_tJqkvSaohwQq4cD7lZbTzMSw8Q" \
https://alekeagle.me/api/users/me/sessions
js
fetch('https://alekeagle.me/api/users/me/sessions', {
  method: 'GET',
  headers: {
    Authorization:
      'eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoiVGhlIGV4YW1wbGUgdG9rZW4gZm9yIGRvY3MuYWxla2VhZ2xlLm1lIiwic3ViIjoiMTY0NzAxNTAyODYyNiIsImlhdCI6MTY4NzA2NzYxNCwiZXhwIjoyMDAyNjQzNjE0fQ.qAwhjhtGT56iAI52EsdVYcaTjmLPeR51TALkJ1CwRlfyDHwrsOTzAe8Y3za_tJqkvSaohwQq4cD7lZbTzMSw8Q',
  },
});

Responses

GET /users/:uid/sessions

Fetch a list of sessions for the specified user.

Non-Public Endpoint

This endpoint is not public and requires authentication of a user with staff permissions.

Scoped Session

Requests to this endpoint using a scoped session require the session to have the STAFF_READ_SESSIONS scope.

Parameters

NameTypeLocationRequiredDescription
uidstringpathyesThe User's ID
limitnumberquerynoThe maximum number of sessions to return. (Default and max: 50)
offsetnumberquerynoThe number of sessions to skip. (Default: 0)

Example Requests

sh
curl -X GET \
-H "Authorization: eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoiVGhlIGV4YW1wbGUgdG9rZW4gZm9yIGRvY3MuYWxla2VhZ2xlLm1lIiwic3ViIjoiMTY0NzAxNTAyODYyNiIsImlhdCI6MTY4NzA2NzYxNCwiZXhwIjoyMDAyNjQzNjE0fQ.qAwhjhtGT56iAI52EsdVYcaTjmLPeR51TALkJ1CwRlfyDHwrsOTzAe8Y3za_tJqkvSaohwQq4cD7lZbTzMSw8Q" \
https://alekeagle.me/api/users/1234567890123/sessions
js
fetch('https://alekeagle.me/api/users/1234567890123/sessions', {
  method: 'GET',
  headers: {
    Authorization:
      'eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoiVGhlIGV4YW1wbGUgdG9rZW4gZm9yIGRvY3MuYWxla2VhZ2xlLm1lIiwic3ViIjoiMTY0NzAxNTAyODYyNiIsImlhdCI6MTY4NzA2NzYxNCwiZXhwIjoyMDAyNjQzNjE0fQ.qAwhjhtGT56iAI52EsdVYcaTjmLPeR51TALkJ1CwRlfyDHwrsOTzAe8Y3za_tJqkvSaohwQq4cD7lZbTzMSw8Q',
  },
});

Responses

DELETE /users/me/sessions/:sid

Delete a specified session for the current account.

Kill Switch Behavior

This endpoint is affected by the following kill switches:

  • ACCOUNT_MODIFY(2)

and will fail with the error ServiceUnavailable if any of these kill switches are enabled.

Scoped Session

Requests to this endpoint using a scoped session require the session to have the SESSION_MODIFY scope.

Parameters

NameTypeLocationRequiredDescription
sidstringpathyesThe session ID. Can be me to delete the current session.

Example Requests

sh
curl -X DELETE \
-H "Authorization: eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoiVGhlIGV4YW1wbGUgdG9rZW4gZm9yIGRvY3MuYWxla2VhZ2xlLm1lIiwic3ViIjoiMTY0NzAxNTAyODYyNiIsImlhdCI6MTY4NzA2NzYxNCwiZXhwIjoyMDAyNjQzNjE0fQ.qAwhjhtGT56iAI52EsdVYcaTjmLPeR51TALkJ1CwRlfyDHwrsOTzAe8Y3za_tJqkvSaohwQq4cD7lZbTzMSw8Q" \
https://alekeagle.me/api/users/me/sessions/me
js
fetch('https://alekeagle.me/api/users/me/sessions/me', {
  method: 'DELETE',
  headers: {
    Authorization:
      'eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoiVGhlIGV4YW1wbGUgdG9rZW4gZm9yIGRvY3MuYWxla2VhZ2xlLm1lIiwic3ViIjoiMTY0NzAxNTAyODYyNiIsImlhdCI6MTY4NzA2NzYxNCwiZXhwIjoyMDAyNjQzNjE0fQ.qAwhjhtGT56iAI52EsdVYcaTjmLPeR51TALkJ1CwRlfyDHwrsOTzAe8Y3za_tJqkvSaohwQq4cD7lZbTzMSw8Q',
  },
});

Responses

DELETE /users/:uid/sessions/:sid

Delete a session.

Non-Public Endpoint

This endpoint is not public and requires authentication of a user with staff permissions.

Scoped Session

Requests to this endpoint using a scoped session require the session to have the STAFF_MODIFY_SESSIONS scope.

Parameters

NameTypeLocationRequiredDescription
uidstringpathyesThe User's ID
sidstringpathyesThe session ID.

Example Requests

sh
curl -X DELETE \
-H "Authorization: eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoiVGhlIGV4YW1wbGUgdG9rZW4gZm9yIGRvY3MuYWxla2VhZ2xlLm1lIiwic3ViIjoiMTY0NzAxNTAyODYyNiIsImlhdCI6MTY4NzA2NzYxNCwiZXhwIjoyMDAyNjQzNjE0fQ.qAwhjhtGT56iAI52EsdVYcaTjmLPeR51TALkJ1CwRlfyDHwrsOTzAe8Y3za_tJqkvSaohwQq4cD7lZbTzMSw8Q" \
https://alekeagle.me/api/users/1234567890123/sessions/1234567890
js
fetch('https://alekeagle.me/api/users/1234567890123/sessions/1234567890', {
  method: 'DELETE',
  headers: {
    Authorization:
      'eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoiVGhlIGV4YW1wbGUgdG9rZW4gZm9yIGRvY3MuYWxla2VhZ2xlLm1lIiwic3ViIjoiMTY0NzAxNTAyODYyNiIsImlhdCI6MTY4NzA2NzYxNCwiZXhwIjoyMDAyNjQzNjE0fQ.qAwhjhtGT56iAI52EsdVYcaTjmLPeR51TALkJ1CwRlfyDHwrsOTzAe8Y3za_tJqkvSaohwQq4cD7lZbTzMSw8Q',
  },
});

Responses

DELETE /users/me/sessions

Delete multiple sessions for the current user.

Kill Switch Behavior

This endpoint is affected by the following kill switches:

  • ACCOUNT_MODIFY(2)

and will fail with the error ServiceUnavailable if any of these kill switches are enabled.

Scoped Session

Requests to this endpoint using a scoped session require the session to have the SESSION_MODIFY scope.

Parameters

NameTypeLocationRequiredDescription
idsstring[]bodyyesThe session IDs. Can include me to delete the current session.

Example Requests

sh
curl -X DELETE \
-H "Authorization: eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoiVGhlIGV4YW1wbGUgdG9rZW4gZm9yIGRvY3MuYWxla2VhZ2xlLm1lIiwic3ViIjoiMTY0NzAxNTAyODYyNiIsImlhdCI6MTY4NzA2NzYxNCwiZXhwIjoyMDAyNjQzNjE0fQ.qAwhjhtGT56iAI52EsdVYcaTjmLPeR51TALkJ1CwRlfyDHwrsOTzAe8Y3za_tJqkvSaohwQq4cD7lZbTzMSw8Q" \
-H "Content-Type: application/json" \
-d '{"ids":["me", "1234567890"]}' \
https://alekeagle.me/api/users/me/sessions
js
fetch('https://alekeagle.me/api/users/me/sessions', {
  method: 'DELETE',
  headers: {
    'Authorization':
      'eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoiVGhlIGV4YW1wbGUgdG9rZW4gZm9yIGRvY3MuYWxla2VhZ2xlLm1lIiwic3ViIjoiMTY0NzAxNTAyODYyNiIsImlhdCI6MTY4NzA2NzYxNCwiZXhwIjoyMDAyNjQzNjE0fQ.qAwhjhtGT56iAI52EsdVYcaTjmLPeR51TALkJ1CwRlfyDHwrsOTzAe8Y3za_tJqkvSaohwQq4cD7lZbTzMSw8Q',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ ids: ['me', '1234567890'] }),
});

Responses

DELETE /users/:uid/sessions

Delete multiple sessions for the specified user.

Non-Public Endpoint

This endpoint is not public and requires authentication of a user with staff permissions.

Scoped Session

Requests to this endpoint using a scoped session require the session to have the STAFF_MODIFY_SESSIONS scope.

Parameters

NameTypeLocationRequiredDescription
uidstringpathyesThe User's ID
idsstring[]bodyyesThe session IDs.

Example Requests

sh
curl -X DELETE \
-H "Authorization: eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoiVGhlIGV4YW1wbGUgdG9rZW4gZm9yIGRvY3MuYWxla2VhZ2xlLm1lIiwic3ViIjoiMTY0NzAxNTAyODYyNiIsImlhdCI6MTY4NzA2NzYxNCwiZXhwIjoyMDAyNjQzNjE0fQ.qAwhjhtGT56iAI52EsdVYcaTjmLPeR51TALkJ1CwRlfyDHwrsOTzAe8Y3za_tJqkvSaohwQq4cD7lZbTzMSw8Q" \
-H "Content-Type: application/json" \
-d '{"ids":["1234567890"]}' \
https://alekeagle.me/api/users/1234567890123/sessions
js
fetch('https://alekeagle.me/api/users/1234567890123/sessions', {
  method: 'DELETE',
  headers: {
    'Authorization':
      'eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoiVGhlIGV4YW1wbGUgdG9rZW4gZm9yIGRvY3MuYWxla2VhZ2xlLm1lIiwic3ViIjoiMTY0NzAxNTAyODYyNiIsImlhdCI6MTY4NzA2NzYxNCwiZXhwIjoyMDAyNjQzNjE0fQ.qAwhjhtGT56iAI52EsdVYcaTjmLPeR51TALkJ1CwRlfyDHwrsOTzAe8Y3za_tJqkvSaohwQq4cD7lZbTzMSw8Q',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ ids: ['1234567890'] }),
});

Responses

DELETE /users/me/sessions/all

Delete all sessions for the current user.

Kill Switch Behavior

This endpoint is affected by the following kill switches:

  • ACCOUNT_MODIFY(2)

and will fail with the error ServiceUnavailable if any of these kill switches are enabled.

Scoped Session

Requests to this endpoint using a scoped session require the session to have the SESSION_MODIFY scope.

Parameters

NameTypeLocationRequiredDescription
include-selfbooleanquerynoWhether to include the current session. Defaults to false.

Example Requests

sh
curl -X DELETE \
-H "Authorization: eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoiVGhlIGV4YW1wbGUgdG9rZW4gZm9yIGRvY3MuYWxla2VhZ2xlLm1lIiwic3ViIjoiMTY0NzAxNTAyODYyNiIsImlhdCI6MTY4NzA2NzYxNCwiZXhwIjoyMDAyNjQzNjE0fQ.qAwhjhtGT56iAI52EsdVYcaTjmLPeR51TALkJ1CwRlfyDHwrsOTzAe8Y3za_tJqkvSaohwQq4cD7lZbTzMSw8Q" \
https://alekeagle.me/api/users/me/sessions/all?include-self=true
js
fetch('https://alekeagle.me/api/users/me/sessions/all?include-self=true', {
  method: 'DELETE',
  headers: {
    Authorization:
      'eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoiVGhlIGV4YW1wbGUgdG9rZW4gZm9yIGRvY3MuYWxla2VhZ2xlLm1lIiwic3ViIjoiMTY0NzAxNTAyODYyNiIsImlhdCI6MTY4NzA2NzYxNCwiZXhwIjoyMDAyNjQzNjE0fQ.qAwhjhtGT56iAI52EsdVYcaTjmLPeR51TALkJ1CwRlfyDHwrsOTzAe8Y3za_tJqkvSaohwQq4cD7lZbTzMSw8Q',
  },
});

Responses

DELETE /users/:uid/sessions/all

Delete all sessions for the specified user.

Non-Public Endpoint

This endpoint is not public and requires authentication of a user with staff permissions.

Scoped Session

Requests to this endpoint using a scoped session require the session to have the STAFF_MODIFY_SESSIONS scope.

Parameters

NameTypeLocationRequiredDescription
uidstringpathyesThe User's ID

Example Requests

sh
curl -X DELETE \
-H "Authorization: eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoiVGhlIGV4YW1wbGUgdG9rZW4gZm9yIGRvY3MuYWxla2VhZ2xlLm1lIiwic3ViIjoiMTY0NzAxNTAyODYyNiIsImlhdCI6MTY4NzA2NzYxNCwiZXhwIjoyMDAyNjQzNjE0fQ.qAwhjhtGT56iAI52EsdVYcaTjmLPeR51TALkJ1CwRlfyDHwrsOTzAe8Y3za_tJqkvSaohwQq4cD7lZbTzMSw8Q" \
https://alekeagle.me/api/users/1234567890123/sessions/all
js
fetch('https://alekeagle.me/api/users/1234567890123/sessions/all', {
  method: 'DELETE',
  headers: {
    Authorization:
      'eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoiVGhlIGV4YW1wbGUgdG9rZW4gZm9yIGRvY3MuYWxla2VhZ2xlLm1lIiwic3ViIjoiMTY0NzAxNTAyODYyNiIsImlhdCI6MTY4NzA2NzYxNCwiZXhwIjoyMDAyNjQzNjE0fQ.qAwhjhtGT56iAI52EsdVYcaTjmLPeR51TALkJ1CwRlfyDHwrsOTzAe8Y3za_tJqkvSaohwQq4cD7lZbTzMSw8Q',
  },
});

Responses

Made with ❤️ by Alek Evans (AlekEagle)