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"
}
}'
const response = await fetch("https://api.credira.com/v1/users", {
method: "POST",
headers: {
Authorization: "Bearer YOUR_CREDIRA_AI_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify({
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",
},
}),
});
const data = await response.json();
console.log(data);
{
"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"
}
}
Users
Create User
Create new user for your organization
POST
/
users
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"
}
}'
const response = await fetch("https://api.credira.com/v1/users", {
method: "POST",
headers: {
Authorization: "Bearer YOUR_CREDIRA_AI_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify({
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",
},
}),
});
const data = await response.json();
console.log(data);
{
"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.
This endpoint creates a new user account and generates the necessary API
credentials for accessing Credira services.
Authorizations
string
required
Add
Bearer YOUR_CREDIRA_AI_KEY as the value of the Authorization header.Body
string
required
The email address for the new user account
string
required
The full name of the user
string
required
The company name associated with the user
string
The role of the user within the organization
string
The department the user belongs to
string
The phone number of the user
object
Additional metadata for the user account
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"
}
}'
const response = await fetch("https://api.credira.com/v1/users", {
method: "POST",
headers: {
Authorization: "Bearer YOUR_CREDIRA_AI_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify({
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",
},
}),
});
const data = await response.json();
console.log(data);
{
"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"
}
}
