Skip to content

Auth Endpoints

POST /api/v1/auth/register

Authentication: None required

Create a new user account.

FieldTypeRequiredDescription
emailstringYesValid email address
passwordstringYesMinimum 8 characters
rolestringYesgame_owner
companyNamestringNoCompany name
Terminal window
curl -X POST https://app.weplaytestgames.com/api/v1/auth/register \
-H "Content-Type: application/json" \
-d '{
"email": "dev@example.com",
"password": "securepassword123",
"role": "game_owner",
"companyName": "Indie Dev Studio"
}'
{
"data": {
"message": "Registration successful. Please verify your email.",
"userId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
},
"meta": {
"requestId": "req_abc123def456",
"timestamp": "2026-03-02T12:00:00.000Z"
}
}

A verification email is sent automatically. The account cannot be used until the email is verified.


POST /api/v1/auth/register/api-key

Authentication: None required

Register a new account and receive an API key in one step.

FieldTypeRequiredDescription
emailstringYesValid email address
passwordstringYesMinimum 8 characters
rolestringYesgame_owner
companyNamestringNoCompany name
keyNamestringNoName for the API key (default: "Default")
scopesstring[]NoScopes for the key. Default: game_owner, billing, chat, notifications, webhooks
{
"data": {
"apiKey": "wpg_sk_a1b2c3d4e5f67890abcdef1234567890",
"user": {
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"email": "dev@example.com",
"role": "game_owner",
"emailVerified": false
},
"message": "Registration successful. Verify your email before using the API key."
},
"meta": {
"requestId": "req_abc123def456",
"timestamp": "2026-03-02T12:00:00.000Z"
}
}

The API key is inactive until the email is verified. Store the key securely — it will not be shown again.


GET /api/v1/auth/me

Scope: any

Returns the authenticated user’s profile.

{
"data": {
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"email": "dev@example.com",
"role": "game_owner",
"emailVerified": true,
"createdAt": "2026-01-15T10:00:00.000Z",
"profile": {
"id": "go_abc123",
"userId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"companyName": "Indie Dev Studio",
"displayName": "Indie Dev Studio",
"websiteUrl": null
}
},
"meta": {
"requestId": "req_abc123def456",
"timestamp": "2026-03-02T12:00:00.000Z"
}
}

The profile object contains role-specific fields: companyName, displayName, websiteUrl.


PATCH /api/v1/auth/profile

Scope: any

Update profile fields. Available fields depend on your role.

All fields are optional:

FieldTypeDescription
displayNamestringDisplay name
companyNamestringCompany name
websiteUrlstring|nullWebsite URL
{
"data": {
"message": "Profile updated"
},
"meta": {
"requestId": "req_abc123def456",
"timestamp": "2026-03-02T12:00:00.000Z"
}
}

POST /api/v1/auth/change-password

Scope: any

FieldTypeRequiredDescription
currentPasswordstringYesCurrent password
newPasswordstringYesNew password (min 8 characters)
{
"data": {
"message": "Password changed successfully"
},
"meta": {
"requestId": "req_abc123def456",
"timestamp": "2026-03-02T12:00:00.000Z"
}
}