Provision user into company account
POST
/admin/accounts/{code}/users
const url = 'https://auth.timetonic.com/api/admin/accounts/acme/users';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"email":"alice@example.com","username":"alice","fname":"Alice","lname":"Example","lang":"EN"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://auth.timetonic.com/api/admin/accounts/acme/users \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "email": "alice@example.com", "username": "alice", "fname": "Alice", "lname": "Example", "lang": "EN" }'Creates a new user for the specified company account. Called by the sandbox-manager service (service-to-service). The provisioned user receives a random temporary password; the caller is expected to trigger a password-reset flow.
Authorizations
Section intitulée « Authorizations »Parameters
Section intitulée « Parameters »Path Parameters
Section intitulée « Path Parameters »code
required
string
Example
acmeCompany account code
Request Bodyrequired
Section intitulée « Request Bodyrequired »Media typeapplication/json
object
email
required
string format: email
Example
alice@example.comusername
required
string
Example
alicefname
string
Example
Alicelname
string
Example
Examplelang
string
Example
ENResponses
Section intitulée « Responses »User provisioned successfully
Media typeapplication/json
object
success
boolean
data
object
user_code
string
email
string
company_account_code
string
Example
{ "success": true, "data": { "user_code": "alice", "email": "alice@example.com", "company_account_code": "acme" }}Missing or invalid service API key
Company account not found
Media typeapplication/json
object
success
boolean
error
string
message
string
Example
{ "success": false, "error": "not_found"}Email or username already registered
Media typeapplication/json
object
success
boolean
error
string
message
string
errors
object
email
Array<string>
username
Array<string>
Example
{ "success": false, "error": "user_already_exists"}Validation error
Media typeapplication/json
object
success
boolean
error
string
message
string
errors
object
Example
{ "success": false, "error": "validation_error"}Rate limit exceeded