DwiziDwizi

Browse docs

API Reference

Magic links and session management.

Authentication API

The Dwizi API uses a magic link flow for authentication. Once authenticated, you receive a session token used for subsequent requests.

Base URL

All API requests should be prefixed with /api (e.g., https://api.dwizi.com/api).

Endpoints

Initiates the login process by sending a magic link to the user's email.

POST /v1/auth/magic-link

Request Body:

{
  "email": "user@example.com"
}

Response: 200 OK (No content)

Exchanges the token from the email link for a session token.

POST /v1/auth/verify

Request Body:

{
  "token": "string" // The token from the magic link URL
}

Response: 200 OK

{
  "token": "string", // Session token
  "user": {
    "id": "string",
    "email": "string"
  }
}

Get Current User

Returns the currently authenticated user's profile.

GET /v1/me

Response: 200 OK

{
  "id": "string",
  "email": "string",
  "name": "string"
}

Logout

Invalidates the current session.

POST /v1/auth/logout

Response: 200 OK