Create profile
Creates a new profile with a name, optional description, and color. Names are unique per workspace: a duplicate returns a 409 whose details.existingProfileId carries the id of the existing profile. Send an Idempotency-Key header to make retries safe: a retried create with the same key and body replays the original 201 (same _id) instead of conflicting.
API key authentication - use your Zernio API key as a Bearer token
In: header
Header Parameters
Optional client-generated unique key (e.g. a UUID) that makes create retries safe. Same key + same body replays the original response; same key + different body → 422; key still processing → 409.
length <= 255Response Body
application/json
application/json
application/json
import Zernio from '@zernio/node';const zernio = new Zernio({ apiKey: process.env.ZERNIO_API_KEY });const { data } = await zernio.profiles.createProfile({ body: { name: 'Example', },});console.log(data);{
"message": "Profile created successfully",
"profile": {
"_id": "64f0a1b2c3d4e5f6a7b8c9d0",
"userId": "6507a1b2c3d4e5f6a7b8c9d0",
"name": "Marketing Team",
"description": "Profile for marketing campaigns",
"color": "#4CAF50",
"isDefault": false,
"createdAt": "2024-11-01T10:00:00Z"
}
}{
"error": "Unauthorized"
}{
"error": "Add a payment method to connect more than 2 accounts.",
"code": "PAYMENT_REQUIRED",
"reason": "free_tier_exceeded",
"documentation_url": "https://docs.zernio.com/billing/payment-method-required",
"dashboard_url": "https://zernio.com/dashboard?tab=billing",
"details": {
"free_tier_account_limit": 2,
"current_account_count": 3,
"has_payment_method": false
}
}List profiles GET
Returns profiles sorted default-first, then by creation date. Filter with name (exact match) and paginate with limit/skip; without those params the full list is returned unchanged. Use includeOverLimit=true to include profiles that exceed the plan limit.
Get profile GET
Returns a single profile by ID, including its name, color, and default status.