Create User
This endpoint allows you to create a new user in your organization. The user can be associated with a user group and will be assigned specific permissions based on their role.
πΉ Endpoint Detailsβ
POST /api/v1/users
π Authenticationβ
Header | Required | Description |
---|---|---|
Content-Type | Yes | Must be application/json |
Authorization | Yes | Format: ONLIVESITE Credential:ONLIVEAccessKeyId, Signature=CalculatedSignature |
π Request Structureβ
Required Fieldsβ
Field | Type | Required | Description | Example |
---|---|---|---|---|
firstName | string | Yes | User's first name | "John" |
lastName | string | Yes | User's last name | "Doe" |
string | Yes | Valid email address | "[email protected]" |
Optional Fieldsβ
Field | Type | Required | Description | Default |
---|---|---|---|---|
role | enum | No | User's role | "creator" |
avatar | string | No | HTTPS URL to avatar | - |
userGroupId | string | No | Associated group UUID | - |
π§© Request Exampleβ
curl -X POST "https://openapi.onlive.site/api/v1/users/" \
-H "Content-Type: application/json" \
-H "Authorization: ONLIVESITE Credential:ONLIVEAccessKeyId, Signature=CalculatedSignature" \
-d '{
"firstName": "John",
"lastName": "Doe",
"email": "[email protected]",
"role": "creator",
"avatar": "https://example.com/avatars/johndoe.jpg",
"userGroupId": "123e4567-e89b-12d3-a456-426614174000"
}'
π€ Response Formatβ
Successful Response (201 Created)β
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"firstName": "John",
"lastName": "Doe",
"email": "[email protected]",
"role": "creator",
"avatar": "https://example.com/avatars/johndoe.jpg",
"organizationId": "123e4567-e89b-12d3-a456-426614174000",
"userGroupId": "123e4567-e89b-12d3-a456-426614174001",
"fullName": "John Doe",
"createdAt": "2025-05-22T10:30:00Z",
"updatedAt": "2025-05-22T10:30:00Z"
}
β Error Responsesβ
400 Bad Requestβ
{
"statusCode": 400,
"message": "Invalid input",
"errors": [
{
"field": "email",
"message": "must be a valid email"
}
]
}
401 Unauthorizedβ
{
"statusCode": 401,
"message": "Invalid or missing authorization credentials"
}
409 Conflictβ
{
"statusCode": 409,
"message": "User with this email already exists in your organization"
}
π Notesβ
- The
organizationId
is automatically set from your authentication credentials - Email addresses must be unique within an organization
- The
fullName
field is automatically generated from first and last names - Passwords and authentication are handled through a separate system
- The
role
defaults to "creator" if not specified - Avatar URLs must use HTTPS protocol
- Time fields are automatically set and returned in UTC
β Common Use Casesβ
- π₯ New Employee: Create accounts for new team members
- π System Migration: Bulk import users from another system
- π₯ Team Setup: Create users and assign them to groups
- π Multi-branch: Create users for different organization locations
- π€ Client Access: Create accounts for external collaborators
π Validation Rulesβ
-
Email
- Must be a valid email format
- Must be unique within the organization
- Maximum length: 255 characters
-
Names
- First and last names required
- Minimum length: 1 character
- Maximum length: 100 characters
- Special characters allowed (for international names)
-
Avatar URL
- Must be a valid HTTPS URL
- Maximum length: 2048 characters
-
Role
- Must be one of:
creator
,editor
,admin
- Case sensitive
- Default:
creator
- Must be one of: