Toast
API Reference

Authentication

Email+password sign-in/sign-up, magic link authentication, and session management.

Sign up with email and password

POST
/api/auth/sign-up/email

Creates a new user account with email and password.

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://loading/api/auth/sign-up/email" \  -H "Content-Type: application/json" \  -d '{    "email": "user@example.com",    "password": "stringst",    "name": "string"  }'
{
  "user": {
    "id": "string",
    "email": "user@example.com",
    "name": "string",
    "emailVerified": true
  },
  "session": {
    "id": "string",
    "expiresAt": "2019-08-24T14:15:22Z"
  }
}

Sign in with email and password

POST
/api/auth/sign-in/email

Authenticates a user with email and password, starting a new session.

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://loading/api/auth/sign-in/email" \  -H "Content-Type: application/json" \  -d '{    "email": "user@example.com",    "password": "string"  }'
{
  "user": {
    "id": "string",
    "email": "user@example.com",
    "name": "string",
    "emailVerified": true
  },
  "session": {
    "id": "string",
    "expiresAt": "2019-08-24T14:15:22Z"
  }
}

Sign out

POST
/api/auth/sign-out

Ends the current session.

Response Body

application/json

curl -X POST "https://loading/api/auth/sign-out"
{
  "status": true
}

Get current session

GET
/api/auth/get-session

Returns the current session and user information if authenticated.

Response Body

application/json

curl -X GET "https://loading/api/auth/get-session"
{
  "user": {
    "id": "string",
    "email": "user@example.com",
    "name": "string",
    "emailVerified": true
  },
  "session": {
    "id": "string",
    "expiresAt": "2019-08-24T14:15:22Z"
  }
}