Register a new user and organisation

POSThttps://app.speybooks.com/api/v1/auth/register

Create a new user and provision their organisation in one atomic operation. The request carries the account email (unique across all users), a password, the user's full name, the organisation name, and an optional business type. The password must be at least 8 characters and contain at least one letter and one number. The business type, sole-trader or limited-company (the default), selects the starter chart of accounts.

On success the new organisation is created with a starter chart of accounts for the chosen business type and an opening financial period, the user is linked to it, and the response carries the created user (with emailVerified false) and organisation, a JWT for immediate authentication, and, when payment setup is available, a Stripe checkout URL to collect payment (the account is usable before payment completes). A verification email and a welcome email are sent in the background by the mail service.

Registering with an email that already exists returns 409.

Body parameters

emailstringrequired
Email address for the new account. Must be unique across all users.
email
fullNamestringrequired
Full name of the user (1-255 characters).
organisationNamestringrequired
Name of the organisation to create (1-255 characters).
passwordstringrequired
min length: 8
planstringoptional
Business type. Determines the chart of accounts seeded and the Stripe plan. Defaults to limited-company.
sole-traderlimited-company

Response

201User and organisation created successfully. Returns a JWT token for immediate authentication and optionally a Stripe Checkout URL.
Show response fields
checkoutUrlstring
Stripe Checkout URL to collect payment. Null if Stripe setup failed (user can complete later).
organisationobject
The newly created organisation.
Show child attributes
idstring
Organisation UUID.
namestring
Organisation name.
slugstring
URL-friendly slug derived from the organisation name.
tokenstring
JWT authentication token. Use in Authorization: Bearer header.
userobject
The newly created user.
Show child attributes
createdAtstringdate-time
ISO 8601 creation timestamp.
emailstring
User email address.
emailVerifiedboolean
Always false at registration. Verification email is sent automatically.
fullNamestring
User full name.
idinteger
Internal user ID.

Error codes

400Validation error. Check the details field for per-field errors.
409Email address already registered.
429Rate limit exceeded. Try again later.