Create a Profile
Call this endpoint on the first app launch. It initializes the user profile in Botsi, which is required for all AI Pricing operations, subscriptions, and paywall tracking.
Key Identifiers-
profileId: A unique ID returned by Botsi. Use this to fetch paywalls and track events. -
customerUserId(Optional): Provide your own internal ID to link profiles across devices.If you're adding a
customerUserIdto a new user profile, include only thecustomerUserIdin the request body. This will create a new profile with a randomprofileIdand the specifiedcustomerUserId.While
customerUserIdis an optional field, its use is strongly recommended to ensure reliable user identification across your system and Botsi.You must store either the
profileIdorcustomerUserIdlocally to authenticate all subsequent API calls.
Request Body
application/json
| Parameter | Type | Required | Description |
|---|---|---|---|
country | string | Required | ISO 3166-1 alpha-2 country code. Example: US |
device | string | Required | Device model identifier. Example: iPhone 15 Pro Max |
os | string | Required | Operating system and version. Example: iOS 17.0 |
platform | string | Required | Platform type. Example: ios |
customerUserId | string | Recommended | Your internal user ID. Strongly recommended to ensure reliable user identification across devices. Example: user-123 |
locale | string | Optional | Locale code. Example: en_US |
currency | string | Optional | ISO 4217 currency code. Example: USD |
storeCountry | string | Optional | App Store country code. Example: US |
timezone | string | Optional | IANA timezone identifier. Example: America/New_York |
ip | string | Optional | IP address. Example: 192.168.1.1 |
appVersion | string | Optional | App version. Example: 1.0.0 |
appBuild | string | Optional | App build number. Example: 100 |
osVersion | string | Optional | OS version. Example: 17.0 |
advertisingId | string | Optional | Advertising identifier. Example: 6D92078A-8246-4BA4-AE5B-76104861E7DC |
sessionId | string | Optional | Session ID. Example: session-abc-123 |
pushToken | string | Optional | Push notification token |
Example Request
{
"country": "US",
"device": "iPhone 15 Pro Max",
"os": "iOS 17.0",
"platform": "ios",
"customerUserId": "user-123",
"locale": "en_US",
"currency": "USD"
}
cURL Example
curl -X POST "https://app.botsi.com/api/v1/web-api/profiles" -H "Authorization: {{secret_key}}" -H "Content-Type: application/json" -d '{
"country": "US",
"device": "iPhone 15 Pro Max",
"os": "iOS 17.0",
"platform": "ios",
"customerUserId": "user-123",
"locale": "en_US",
"currency": "USD"
}'
Response
A successful request returns a JSON object containing the details of the newly created profile. Make sure to save data.profileId and/or data.customerUserId, as they are required for the next steps in the flow.
{
"ok": true,
"data": {
"profileId": "0072102a-c00c-4ea5-9271-1b6e975f2d63",
"customerUserId": "user-123",
"paid": false,
"country": "US",
"locale": "en_US",
"currency": "USD",
"storeCountry": "US",
"timezone": "America/New_York",
"ip": "192.168.1.1",
"device": "iPhone 15 Pro Max",
"os": "iOS 17.0",
"platform": "ios",
"appVersion": "1.0.0",
"appBuild": "100",
"osVersion": "17.0",
"advertisingId": "6D92078A-8246-4BA4-AE5B-76104861E7DC",
"sessionId": "session-abc-123",
"createdAt": "2025-01-15T10:30:00.000Z",
"updatedAt": "2025-01-15T10:30:00.000Z"
}
}
Try It Out
Click "Send API Request" to see the response here.