B2B Registration API
POST /api/b2b/register
Creates a new B2B workspace for an organization. The response includes the first API key once, so the caller must store it immediately.
warning
The clientSecret is returned only in the registration response. GOFA cannot display the same secret again later. Create a new key if the original value is lost.
Request Body:
| Field | Type | Required | Notes |
|---|---|---|---|
clientId | string | Yes | Lowercase letters, numbers, and hyphens. This becomes the client identifier used in API authentication. |
clientName | string | Yes | Display name for the organization. |
ownerName | string | Yes | Display name for the initial workspace owner. |
email | string | Yes | Work email for the owner account. |
password | string | Yes | Minimum 8 characters. |
primaryColor | string | No | Optional 6-digit hex color such as #ef8173. |
termsAccepted | boolean | Yes | Must be true. |
Sample Request:
Request Body
{
"clientId": "acme-wellness",
"clientName": "Acme Wellness",
"ownerName": "Alex Chan",
"email": "admin@acme.example",
"password": "a-secure-password",
"primaryColor": "#ef8173",
"termsAccepted": true
}
Sample Response:
201-style Success Response
{
"success": true,
"clientId": "acme-wellness",
"clientName": "Acme Wellness",
"clientSecret": "generated-api-key-value",
"initialApiPlanDefinitionId": "free_plan",
"initialApiPlanName": "Free Plan",
"portalUrl": "https://acme-wellness.gofa.app/b2b/login"
}
Responses:
200 OK: Workspace created and initial API key returned.400 Bad Request: Invalid request body or reserved client ID.409 Conflict: Client ID or owner email already exists.500 Internal Server Error: Registration could not be completed.
After registration, sign in through the returned portalUrl using the owner email and password.