Saltar para o conteúdo principal
POST
/
public
/
api
/
v1
/
clients
Create client
curl --request POST \
  --url https://api.gennia.ai/public/api/v1/clients \
  --header 'Content-Type: application/json' \
  --header 'X-Api-Key: <api-key>' \
  --data '
{
  "creditsOverride": 5000,
  "inviteToTrial": false,
  "periodEndOverride": "2026-12-31T23:59:59Z",
  "planPublicId": "9c3a4d22-1a8d-4b3f-9b1e-7a0f0c4f3e21",
  "sendInvitations": true,
  "users": [
    {
      "email": "ada@acme.com",
      "name": "Ada Lovelace"
    }
  ],
  "workspaceName": "Acme Corp"
}
'
{
  "createdAt": "2023-11-07T05:31:56Z",
  "creditsBalance": 123,
  "creditsUsedThisPeriod": 123,
  "currentPeriodEnd": "2023-11-07T05:31:56Z",
  "currentPeriodStart": "2023-11-07T05:31:56Z",
  "extraCreditsBalance": 123,
  "nextCreditRenewalAt": "2023-11-07T05:31:56Z",
  "pendingInvitations": [
    {
      "createdAt": "2023-11-07T05:31:56Z",
      "email": "<string>",
      "expiresAt": "2023-11-07T05:31:56Z",
      "isExpired": true,
      "name": "<string>",
      "publicId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "role": "<string>"
    }
  ],
  "pendingPlan": {
    "currency": "<string>",
    "effectiveAt": "2023-11-07T05:31:56Z",
    "name": "<string>",
    "priceCents": 123,
    "publicId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
  },
  "plan": {
    "billingIntervalMonths": 123,
    "creditsIncluded": 123,
    "currency": "<string>",
    "name": "<string>",
    "priceCents": 123,
    "publicId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
  },
  "publicId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "seatsLimit": 123,
  "unlimitedCredits": true,
  "users": [
    {
      "completedOnboarding": true,
      "email": "<string>",
      "lastSeenAt": "2023-11-07T05:31:56Z",
      "name": "<string>",
      "publicId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "role": "<string>"
    }
  ],
  "usersCount": 123,
  "workspaceName": "<string>"
}

Autorizações

X-Api-Key
string
header
obrigatório

Corpo

application/json

Body for creating a new client workspace under the hub.

creditsOverride
integer<int32>

Optional credits override. When not set, uses the plan's creditsIncluded value.

Exemplo:

5000

inviteToTrial
boolean

Invite as a trial client — ignores planPublicId and uses the hub's configured trial plan (requires trial enabled in hub config). Defaults to false.

Exemplo:

false

periodEndOverride
string<date-time>

Optional period-end override. When not set, computed from plan recurrence.

Exemplo:

"2026-12-31T23:59:59Z"

planPublicId
string<uuid>

Optional. Subscription plan public ID. If omitted, the client is created without a plan. Ignored when inviteToTrial=true.

Exemplo:

"9c3a4d22-1a8d-4b3f-9b1e-7a0f0c4f3e21"

sendInvitations
boolean

Send invitation emails to the listed users immediately. Defaults to false.

Exemplo:

true

users
object[]

Users to provision in the client workspace (at least one).

Minimum array length: 1
workspaceName
string

Display name of the client workspace.

Required string length: 1 - 150
Exemplo:

"Acme Corp"

Resposta

Created

createdAt
string<date-time>
creditsBalance
number
creditsUsedThisPeriod
number
currentPeriodEnd
string<date-time>
currentPeriodStart
string<date-time>
extraCreditsBalance
number
nextCreditRenewalAt
string<date-time>
pendingInvitations
object[]
pendingPlan
object
plan
object
publicId
string<uuid>
seatsLimit
integer<int32>
subscriptionStatus
enum<string>
Opções disponíveis:
active,
past_due,
canceled,
trialing,
pending_onboarding,
suspended
unlimitedCredits
boolean
users
object[]
usersCount
integer<int32>
workspaceName
string