Platform API reference

Platform API · Authentication

post/v1/auth/signup

Create a new account and sign in

Request body

email*string

User email address

Example: "user@example.com"

username*string

Unique username (letters, numbers, dot, underscore, hyphen)

Example: "john_doe"

password*string

User password (min 8 characters)

Example: "MySecurePassword123"

display_namestring

Display name

Example: "John Doe"

session_durationobject

Session duration: "short" (24h), "long" (90d), or integer seconds (3600–7776000). Defaults to 30 days.

Example: "long"

Response · 200 Token response

access_token*string

Access token (JWT)

Example: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."

refresh_tokenstring

Refresh token (JWT)

Example: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."

token_type*string

Token type

Example: "Bearer"

expires_in*number

Access token TTL in seconds

Example: 3600

Example

Request

POST https://api.platform-auth.productcraft.co/v1/auth/signup
Content-Type: application/json

{
  "email": "user@example.com",
  "username": "john_doe",
  "password": "MySecurePassword123",
  "display_name": "John Doe",
  "session_duration": "long"
}

Response

{
  "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "refresh_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "token_type": "Bearer",
  "expires_in": 3600
}