Authentication
This endpoint requires authentication and admin role access.Key Information
- The
idparameter must be a valid Supabase UUID from Supabase Auth - Users cannot be created with duplicate IDs
- The
persona_idis optional and can be linked later - Valid roles include: “admin” and “asistente”
Request Body
id(string, required): Supabase UUID from Supabase Authrole(string, required): User role assignmentpersona_id(integer, optional): Link to an existing persona record
Response
Returns the created user object:id(string): Supabase UUID identifying the userpersona_id(integer, nullable): Foreign key to the personas tablerole(string): Assigned user rolecreated_at(datetime): Timestamp of user creation
Error Responses
400: Missing required fields (id or role)409: User with this ID already exists
Supabase Integration
Usuarios use Supabase UUID as their primary identifier. This means:- Users must first be created in Supabase Auth
- The Supabase UUID is then used to create the corresponding record in this system
- This links authentication (Supabase) with authorization (role in this system)