curl --request POST \
--url https://api.credira.com/v1/users \
--header 'Authorization: Bearer YOUR_CREDIRA_AI_KEY' \
--header 'Content-Type: application/json' \
--data '{
"email": "john.doe@company.com",
"name": "John Doe",
"company": "Acme Corporation",
"role": "billing_manager",
"department": "finance",
"phone": "+1234567890",
"metadata": {
"subscription_plan": "premium",
"timezone": "America/New_York",
"language": "en"
}
}'
{
"success": true,
"data": {
"id": "user_123456789",
"email": "john.doe@company.com",
"name": "John Doe",
"company": "Acme Corporation",
"role": "billing_manager",
"department": "finance",
"phone": "+1234567890",
"api_key": "credira_sk_1234567890abcdef",
"account_id": "acc_789123456",
"status": "active",
"created_time": "2024-01-15T10:30:00Z",
"last_login": null,
"permissions": [
"calls:read",
"calls:write",
"emails:read",
"emails:write",
"callouts:read",
"callouts:write"
],
"metadata": {
"subscription_plan": "premium",
"timezone": "America/New_York",
"language": "en"
}
},
"meta": {
"timestamp": "2024-01-15T10:30:00Z",
"request_id": "req_123456789",
"message": "User created successfully"
}
}
Create new user for your organization
curl --request POST \
--url https://api.credira.com/v1/users \
--header 'Authorization: Bearer YOUR_CREDIRA_AI_KEY' \
--header 'Content-Type: application/json' \
--data '{
"email": "john.doe@company.com",
"name": "John Doe",
"company": "Acme Corporation",
"role": "billing_manager",
"department": "finance",
"phone": "+1234567890",
"metadata": {
"subscription_plan": "premium",
"timezone": "America/New_York",
"language": "en"
}
}'
{
"success": true,
"data": {
"id": "user_123456789",
"email": "john.doe@company.com",
"name": "John Doe",
"company": "Acme Corporation",
"role": "billing_manager",
"department": "finance",
"phone": "+1234567890",
"api_key": "credira_sk_1234567890abcdef",
"account_id": "acc_789123456",
"status": "active",
"created_time": "2024-01-15T10:30:00Z",
"last_login": null,
"permissions": [
"calls:read",
"calls:write",
"emails:read",
"emails:write",
"callouts:read",
"callouts:write"
],
"metadata": {
"subscription_plan": "premium",
"timezone": "America/New_York",
"language": "en"
}
},
"meta": {
"timestamp": "2024-01-15T10:30:00Z",
"request_id": "req_123456789",
"message": "User created successfully"
}
}
Bearer YOUR_CREDIRA_AI_KEY as the value of the Authorization header.curl --request POST \
--url https://api.credira.com/v1/users \
--header 'Authorization: Bearer YOUR_CREDIRA_AI_KEY' \
--header 'Content-Type: application/json' \
--data '{
"email": "john.doe@company.com",
"name": "John Doe",
"company": "Acme Corporation",
"role": "billing_manager",
"department": "finance",
"phone": "+1234567890",
"metadata": {
"subscription_plan": "premium",
"timezone": "America/New_York",
"language": "en"
}
}'
{
"success": true,
"data": {
"id": "user_123456789",
"email": "john.doe@company.com",
"name": "John Doe",
"company": "Acme Corporation",
"role": "billing_manager",
"department": "finance",
"phone": "+1234567890",
"api_key": "credira_sk_1234567890abcdef",
"account_id": "acc_789123456",
"status": "active",
"created_time": "2024-01-15T10:30:00Z",
"last_login": null,
"permissions": [
"calls:read",
"calls:write",
"emails:read",
"emails:write",
"callouts:read",
"callouts:write"
],
"metadata": {
"subscription_plan": "premium",
"timezone": "America/New_York",
"language": "en"
}
},
"meta": {
"timestamp": "2024-01-15T10:30:00Z",
"request_id": "req_123456789",
"message": "User created successfully"
}
}
{
"success": false,
"error": {
"code": "INVALID_REQUEST",
"message": "Missing required field: email"
},
"meta": {
"timestamp": "2024-01-15T10:30:00Z",
"request_id": "req_123456789"
}
}
{
"success": false,
"error": {
"code": "UNAUTHORIZED",
"message": "Invalid or missing Credira AI key"
},
"meta": {
"timestamp": "2024-01-15T10:30:00Z",
"request_id": "req_123456789"
}
}
{
"success": false,
"error": {
"code": "CONFLICT",
"message": "User with this email already exists"
},
"meta": {
"timestamp": "2024-01-15T10:30:00Z",
"request_id": "req_123456789"
}
}
{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Invalid email address format"
},
"meta": {
"timestamp": "2024-01-15T10:30:00Z",
"request_id": "req_123456789"
}
}