Skip to main content

Login User

Create a new user or login an existing user for your enterprise. This endpoint enables you to manage users through your enterprise admin account.

API Endpoint

POST enterprise/login-user

Authentication

This endpoint requires Enterprise API key authentication. Include both your API key and API key ID in the request headers:

sivi-api-key: YOUR_ENTERPRISE_API_KEY
Enterprise Admin Access Required

This endpoint can only be accessed using an Enterprise Admin API key. Regular API keys do not have sufficient privileges.

Request Body

{
"abstractUserId": "281743-2322-34i44sd3-dkfjgdkjf292",
"planId": "ent-01",
"brand": {
"brandName": "Sivi",
"brandDescription": "AI design generator for brands and layered vector based design generation",
"brandUrl": "https://sivi.ai",
"brandLogo": "https://sivi.ai/sivi-logo.png",
"brandColors": ["#5662EC", "#EF9AB2"],
"brandFonts": [],
"brandPersona": {
"emotions": ["happy"],
"industry": "games",
"audience": ["working mom", "working dad"],
"designTags": ["minimal", "time management", "productivity", "health"],
}
}
}

Request Parameters

ParameterTypeRequiredDescription
abstractUserIdstringYesUnique identifier for the user
planIdstringNoPlan identifier to assign to the user
brandObjectNoBrand details
brand.brandNamestringConditionalBrand name
brand.brandDescriptionstringConditionalBrand description
brand.brandUrlstringNoBrand URL
brand.brandLogostringNoBrand logo URL
brand.brandColorsarrayNoList of brand colors
brand.brandFontsarrayNoList of brand fonts
brand.brandPersonaobjectNoBrand persona details
brand.brandPersona.emotionsarrayNoList of brand emotions
brand.brandPersona.industrystringNoBrand industry
brand.brandPersona.audiencearrayNoList of brand target audience
brand.brandPersona.designTagsarrayNoList of brand design tags

Note:: See all available options for each parameter in the Brand Persona Details section.

Response

Successful Login/Creation

{
"status": 200,
"body": {
"accessToken": "97026520-1f1b-11f0-ada0-01392001fe46",
"refreshToken": "2342342-1f1b-11f0-ada0-01392001fe46",
"workspaceId": "765634-2322-34i44sd3-dkfjgdkjf292"
}
}

Authentication Error

{
"status": 401,
"body": {
"message": "Failed to authenticate request. Please add sivi-api-key header in request"
}
}

Invalid Input

{
"status": 422,
"body": {
"message": "Invalid input"
}
}

Response Fields

FieldTypeDescription
accessTokenstringJWT token for API authentication, valid for 1 hour
refreshTokenstringToken that can be used to obtain a new access token
workspaceIdstringUnique identifier for the workspace

Usage Notes

  • If the user already exists in Sivi's system, the API will log in the user and return access/refresh tokens
  • If the user is new, the API will create a new user and corresponding workspace, assigning the specified plan
  • The abstractUserId should be a unique identifier from your system that won't change for this user

Example

curl -X POST "https://connect.sivi.ai/api/prod/v2/enterprise/login-user" \
-H "sivi-api-key: YOUR_ENTERPRISE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"abstractUserId": "user-12345",
"planId": "ent-01"
}'