Authentication

Create anonymous session

Create an anonymous user session for guest access. Users can later convert to full accounts.

AuthPublic
GroupAuthentication
Rate limitSee Rate Limits
POST/api/auth/anonymous

SDK setup

Create a client instance. No authentication is required for this endpoint.

import { Configuration, AuthenticationApi } from 'mudbase-sdk';

const configuration = new Configuration({
  basePath: 'https://cloud.mudbase.dev',
});

const authentication = new AuthenticationApi(configuration);
import { Configuration, AuthenticationApi } from 'mudbase-sdk';

const configuration = new Configuration({
  basePath: 'https://cloud.mudbase.dev',
});

const authentication = new AuthenticationApi(configuration);

Example request

Call this endpoint using the client from SDK setup. Use View HTTP for a raw cURL example.

const { data: result } = await authentication.createAnonymousSession(
  {
    projectId: "proj_wv9rchdgqtou",
    deviceId: "yAe74DT6fDlI8SoZ"
  }
);
const { data: result } = await authentication.createAnonymousSession(
  {
    projectId: "proj_wv9rchdgqtou",
    deviceId: "yAe74DT6fDlI8SoZ"
  }
);

Playground

live

Test this endpoint with your own credentials. Your requests will be sent to the live API.

No Request Yet

Send a request to see the full inspector

Authentication

Public — No Auth Required

Request Body

json
{
  "projectId": "685ad30be129932fbb7a1047",
  "deviceId": "device-uuid-123"
}
{
  "projectId": "685ad30be129932fbb7a1047",
  "deviceId": "device-uuid-123"
}

Responses

200Anonymous session created
json
{
  "message": "Anonymous session created",
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "refreshToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "expiresIn": 86400,
  "user": {
    "id": "685acbe0e129932fbb7a0fc2",
    "email": "anonymous_abc123@anonymous.local",
    "firstName": "Anonymous",
    "lastName": "User",
    "role": "viewer",
    "isAnonymous": true
  }
}
{
  "message": "Anonymous session created",
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "refreshToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "expiresIn": 86400,
  "user": {
    "id": "685acbe0e129932fbb7a0fc2",
    "email": "anonymous_abc123@anonymous.local",
    "firstName": "Anonymous",
    "lastName": "User",
    "role": "viewer",
    "isAnonymous": true
  }
}
400
403
404

Errors

CodeMeaning
400
403
404
Edit this page on GitHub