Auth Endpoints
Register
Section titled “Register”POST /api/v1/auth/register
Authentication: None required
Create a new user account.
Request Body
Section titled “Request Body”| Field | Type | Required | Description |
|---|---|---|---|
email | string | Yes | Valid email address |
password | string | Yes | Minimum 8 characters |
role | string | Yes | game_owner |
companyName | string | No | Company name |
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" }'const response = await fetch('https://app.weplaytestgames.com/api/v1/auth/register', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ email: 'dev@example.com', password: 'securepassword123', role: 'game_owner', companyName: 'Indie Dev Studio', }),});Response
Section titled “Response”{ "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.
Register with API Key
Section titled “Register with API Key”POST /api/v1/auth/register/api-key
Authentication: None required
Register a new account and receive an API key in one step.
Request Body
Section titled “Request Body”| Field | Type | Required | Description |
|---|---|---|---|
email | string | Yes | Valid email address |
password | string | Yes | Minimum 8 characters |
role | string | Yes | game_owner |
companyName | string | No | Company name |
keyName | string | No | Name for the API key (default: "Default") |
scopes | string[] | No | Scopes for the key. Default: game_owner, billing, chat, notifications, webhooks |
Response
Section titled “Response”{ "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 Current User
Section titled “Get Current User”GET /api/v1/auth/me
Scope: any
Returns the authenticated user’s profile.
Response
Section titled “Response”{ "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.
Update Profile
Section titled “Update Profile”PATCH /api/v1/auth/profile
Scope: any
Update profile fields. Available fields depend on your role.
Request Body
Section titled “Request Body”All fields are optional:
| Field | Type | Description |
|---|---|---|
displayName | string | Display name |
companyName | string | Company name |
websiteUrl | string|null | Website URL |
Response
Section titled “Response”{ "data": { "message": "Profile updated" }, "meta": { "requestId": "req_abc123def456", "timestamp": "2026-03-02T12:00:00.000Z" }}Change Password
Section titled “Change Password”POST /api/v1/auth/change-password
Scope: any
Request Body
Section titled “Request Body”| Field | Type | Required | Description |
|---|---|---|---|
currentPassword | string | Yes | Current password |
newPassword | string | Yes | New password (min 8 characters) |
Response
Section titled “Response”{ "data": { "message": "Password changed successfully" }, "meta": { "requestId": "req_abc123def456", "timestamp": "2026-03-02T12:00:00.000Z" }}