Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/subratomandal/dyeink/llms.txt

Use this file to discover all available pages before exploring further.

POST /api/auth/register

Registers a new user or updates an existing user’s information after Auth0 authentication. This endpoint creates a user record in the database and sets up default site settings for new users.

Authentication

Requires Auth0 JWT token in the Authorization header.
Authorization: Bearer <auth0_jwt_token>

Request Body

auth0Id
string
required
The Auth0 user identifier (e.g., “auth0|123456789”)
email
string
required
User’s email address
name
string
User’s display name (optional)
picture
string
URL to user’s profile picture (optional)

Response

id
string
The user’s unique identifier
email
string
User’s email address
name
string
User’s display name
picture
string
URL to user’s profile picture
isAdmin
boolean
Whether the user has admin privileges
createdAt
string
ISO 8601 timestamp of when the user was created
updatedAt
string
ISO 8601 timestamp of when the user was last updated

Example Request

cURL
curl -X POST https://api.dyeink.com/api/auth/register \
  -H "Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9..." \
  -H "Content-Type: application/json" \
  -d '{
    "auth0Id": "auth0|123456789",
    "email": "user@example.com",
    "name": "John Doe",
    "picture": "https://example.com/avatar.jpg"
  }'

Example Response

{
  "id": "auth0_123456789",
  "email": "user@example.com",
  "name": "John Doe",
  "picture": "https://example.com/avatar.jpg",
  "isAdmin": false,
  "createdAt": "2026-03-04T10:30:00.000Z",
  "updatedAt": "2026-03-04T10:30:00.000Z"
}

Error Responses

401 Unauthorized
object
Authentication token is missing or invalid
{
  "error": "Unauthorized"
}
405 Method Not Allowed
object
Request method is not POST
{
  "error": "Method not allowed"
}
500 Internal Server Error
object
Server encountered an error processing the request
{
  "error": "Failed to register user"
}

Behavior

  • New Users: Creates a new user record and generates default site settings with a unique subdomain (format: blog-{userId_prefix})
  • Existing Users: Updates the user’s email, name, and picture if provided
  • Site Settings: Automatically creates a default blog site with a generated subdomain for new users