Skip to main content

REST API

clepit's REST surface covers tenant administration: members, invitations, billing and tenant settings. Every operation needs an access token.

HostServes
https://api.clepit.comProduction
https://staging.api.clepit.comStaging

members

POST/v1/tenants/me/members/listhttps://api.clepit.com

List the caller's tenant members

Cursor-paginated. The body carries the filter and cursor; POST rather than GET because the filter is structured.

Auth bearerAuth

Responses

A page of members

JSON
{
  "nextCursor?": "string | null",
  "rows": [
    {
      "id": "string",
      "userId": "string",
      "email": "string",
      "name?": "string | null",
      "status": "string",
      "roleId?": "string | null",
      "roleName?": "string | null",
      "joinedAt": "string",
      "suspendedAt?": "string | null",
      "suspensionSource?": "string | null",
      "removedAt?": "string | null",
      "removedById?": "string | null"
    }
  ],
  "total": "integer"
}

Try it

curl -X POST "https://api.clepit.com/v1/tenants/me/members/list" \
  -H "Authorization: Bearer $BEARER_AUTH"
POST/v1/tenants/me/members/{id}/suspendhttps://api.clepit.com

Suspend a member

Suspends one membership in the caller's tenant.

Auth bearerAuth

Parameters

NameInTypeDescription
id requiredpathstringThe membership id to suspend.

Responses

The suspended membership

JSON
{
  "id": "string",
  "suspendedAt": "string"
}

Try it

curl -X POST "https://api.clepit.com/v1/tenants/me/members/:id/suspend" \
  -H "Authorization: Bearer $BEARER_AUTH"
POST/v1/tenants/me/members/{id}/unsuspendhttps://api.clepit.com

Reinstate a suspended member

Lifts a suspension on one membership in the caller's tenant.

Auth bearerAuth

Parameters

NameInTypeDescription
id requiredpathstringThe membership id to reinstate.

Responses

The reinstated membership

JSON
{
  "id": "string"
}

Try it

curl -X POST "https://api.clepit.com/v1/tenants/me/members/:id/unsuspend" \
  -H "Authorization: Bearer $BEARER_AUTH"
DELETE/v1/tenants/me/members/{id}https://api.clepit.com

Remove a member

Removes one membership from the caller's tenant. Requires a fresh MFA-backed session; forward the ID token in X-Id-Token.

Auth bearerAuth

Parameters

NameInTypeDescription
id requiredpathstringThe membership id to remove.

Responses

The removed membership

JSON
{
  "id": "string",
  "removedAt": "string"
}

Try it

curl -X DELETE "https://api.clepit.com/v1/tenants/me/members/:id" \
  -H "Authorization: Bearer $BEARER_AUTH"
DELETE/v1/tenants/me/membershiphttps://api.clepit.com

Leave the tenant

Removes the caller's own membership. An owner must transfer ownership first.

Auth bearerAuth

Responses

The removed membership

JSON
{
  "id": "string",
  "removedAt": "string"
}

Try it

curl -X DELETE "https://api.clepit.com/v1/tenants/me/membership" \
  -H "Authorization: Bearer $BEARER_AUTH"
POST/v1/tenants/me/members/bulk-removehttps://api.clepit.com

Remove several members

Each result reports its own outcome, so a partial success is still a 200. A membership that would leave the tenant without an owner is refused; so is your own, which is what leave is for. Requires a fresh MFA-backed session.

Auth bearerAuth

Responses

Per-membership results

JSON
{
  "results": "unknown"
}

Try it

curl -X POST "https://api.clepit.com/v1/tenants/me/members/bulk-remove" \
  -H "Authorization: Bearer $BEARER_AUTH"
POST/v1/tenants/me/members/bulk-rolehttps://api.clepit.com

Assign one role to several members

Rows apply in order within one transaction, so demoting every owner in a batch refuses the last one rather than leaving the tenant ownerless.

Auth bearerAuth

Responses

Per-membership results

JSON
{
  "results": "unknown"
}

Try it

curl -X POST "https://api.clepit.com/v1/tenants/me/members/bulk-role" \
  -H "Authorization: Bearer $BEARER_AUTH"
POST/v1/tenants/me/members/{id}/rolehttps://api.clepit.com

Change a member's role

Replaces the member's current role assignment.

Auth bearerAuth

Parameters

NameInTypeDescription
id requiredpathstringThe membership id whose role changes.

Responses

Role changed

JSON
{
  "ok": "boolean"
}

Try it

curl -X POST "https://api.clepit.com/v1/tenants/me/members/:id/role" \
  -H "Authorization: Bearer $BEARER_AUTH"

invitations

POST/v1/tenants/me/invitationshttps://api.clepit.com

Invite people to the tenant

Creates invitations in bulk. Each result reports its own outcome, so a partial success is still a 200.

Auth bearerAuth

Responses

Per-invitation results

JSON
{
  "results": "unknown"
}

Try it

curl -X POST "https://api.clepit.com/v1/tenants/me/invitations" \
  -H "Authorization: Bearer $BEARER_AUTH"
POST/v1/tenants/me/invitations/listhttps://api.clepit.com

List the tenant's invitations

Cursor-paginated, same shape as the member list.

Auth bearerAuth

Responses

A page of invitations

JSON
{
  "nextCursor?": "string | null",
  "rows": [
    {
      "id": "string",
      "email": "string",
      "status": "string",
      "roleId?": "string | null",
      "roleName?": "string | null",
      "invitedById?": "string | null",
      "sentAt": "string",
      "expiresAt": "string",
      "acceptedAt?": "string | null",
      "revokedAt?": "string | null"
    }
  ],
  "total": "integer"
}

Try it

curl -X POST "https://api.clepit.com/v1/tenants/me/invitations/list" \
  -H "Authorization: Bearer $BEARER_AUTH"
POST/v1/tenants/me/invitations/{id}/resendhttps://api.clepit.com

Resend an invitation

Re-sends the invitation email and extends its expiry.

Auth bearerAuth

Parameters

NameInTypeDescription
id requiredpathstringThe invitation id to resend.

Responses

The resent invitation

JSON
{
  "id": "string",
  "email": "string",
  "expiresAt": "string"
}

Try it

curl -X POST "https://api.clepit.com/v1/tenants/me/invitations/:id/resend" \
  -H "Authorization: Bearer $BEARER_AUTH"
DELETE/v1/tenants/me/invitations/{id}https://api.clepit.com

Revoke an invitation

Revokes a pending invitation so its link stops working.

Auth bearerAuth

Parameters

NameInTypeDescription
id requiredpathstringThe invitation id to revoke.

Responses

The revoked invitation

JSON
{
  "id": "string",
  "revokedAt": "string"
}

Try it

curl -X DELETE "https://api.clepit.com/v1/tenants/me/invitations/:id" \
  -H "Authorization: Bearer $BEARER_AUTH"

tenant-settings

POST/v1/tenants/me/transfer-ownershiphttps://api.clepit.com

Transfer tenant ownership

Moves ownership of the caller's tenant to another member. Requires a fresh MFA-backed session.

Auth bearerAuth

Responses

Ownership transferred

JSON
{
  "ok": "boolean"
}

Try it

curl -X POST "https://api.clepit.com/v1/tenants/me/transfer-ownership" \
  -H "Authorization: Bearer $BEARER_AUTH"
GET/v1/tenants/me/allowed-email-domainshttps://api.clepit.com

Read the tenant's allowed email domains

An empty list means invitations are not restricted by domain.

Auth bearerAuth

Responses

The current policy

JSON
{
  "allowedEmailDomains": []
}

Try it

curl -X GET "https://api.clepit.com/v1/tenants/me/allowed-email-domains" \
  -H "Authorization: Bearer $BEARER_AUTH"
PUT/v1/tenants/me/allowed-email-domainshttps://api.clepit.com

Replace the tenant's allowed email domains

Replaces the whole list; an empty list clears the restriction. Domains are normalised to lowercase and matched exactly — a subdomain must be listed in its own right. Requires a fresh MFA-backed session.

Auth bearerAuth

Responses

The stored policy

JSON
{
  "allowedEmailDomains": []
}

Try it

curl -X PUT "https://api.clepit.com/v1/tenants/me/allowed-email-domains" \
  -H "Authorization: Bearer $BEARER_AUTH"
POST/v1/tenants/me/roleshttps://api.clepit.com

Create a custom role

Defines a tenant role centrally as the acting person, then mirrors it locally. The central service refuses a definition carrying privileges the caller cannot pass on.

Auth bearerAuth

Responses

Role created

JSON
{
  "id": "string"
}

Try it

curl -X POST "https://api.clepit.com/v1/tenants/me/roles" \
  -H "Authorization: Bearer $BEARER_AUTH"
PATCH/v1/tenants/me/roles/{id}https://api.clepit.com

Update a custom role

Replaces the role's name, description and privilege bundle. System roles marked not editable are refused. Subject to the same delegation intersection as creation.

Auth bearerAuth

Parameters

NameInTypeDescription
id requiredpathstringThe role id being edited.

Responses

Role updated

JSON
{
  "ok": "boolean"
}

Try it

curl -X PATCH "https://api.clepit.com/v1/tenants/me/roles/:id" \
  -H "Authorization: Bearer $BEARER_AUTH"
DELETE/v1/tenants/me/roles/{id}https://api.clepit.com

Delete a custom role

Deletes the role and answers who lost it. A held role deletes with a warning rather than a veto; system roles marked not deletable are refused. Requires a fresh MFA-backed session.

Auth bearerAuth

Parameters

NameInTypeDescription
id requiredpathstringThe role id being deleted.

Responses

Role deleted

JSON
{
  "lostBy": [
    {
      "email": "string",
      "name?": "string | null",
      "userId": "string"
    }
  ]
}

Try it

curl -X DELETE "https://api.clepit.com/v1/tenants/me/roles/:id" \
  -H "Authorization: Bearer $BEARER_AUTH"
GET/v1/tenants/me/roles/{id}/holdershttps://api.clepit.com

List a role's holders

The members currently holding the role, for the delete warning and the Roles tab.

Auth bearerAuth

Parameters

NameInTypeDescription
id requiredpathstringThe role id whose holders are listed.

Responses

The holders

JSON
{
  "holders": [
    {
      "email": "string",
      "name?": "string | null",
      "userId": "string"
    }
  ]
}

Try it

curl -X GET "https://api.clepit.com/v1/tenants/me/roles/:id/holders" \
  -H "Authorization: Bearer $BEARER_AUTH"

billing

GET/v1/tenants/me/billinghttps://api.clepit.com

Read the tenant's billing state

Tier, status, cycle and the derived state the UI gates on.

Auth bearerAuth

Responses

The tenant's billing state

JSON
{
  "tier": "free | pro | business | enterprise",
  "billingStatus": "none | active | past_due | canceled",
  "billingCycle?": "BillingCycle | null",
  "seatCount": "integer",
  "currentPeriodEnd?": "string | null",
  "cancelAtPeriodEnd": "boolean",
  "overQuotaGraceUntil?": "string | null",
  "hasPaymentMethod": "boolean",
  "derivedState": "no_sub | active | past_due | cancel_scheduled | downgraded_grace | downgraded_locked"
}

Try it

curl -X GET "https://api.clepit.com/v1/tenants/me/billing" \
  -H "Authorization: Bearer $BEARER_AUTH"
GET/v1/tenants/me/billing/checkout/previewhttps://api.clepit.com

Preview a checkout

Prices a tier and cycle before starting checkout. Takes tier and cycle as query parameters.

Auth bearerAuth

Responses

The priced checkout

JSON
{
  "tier": "free | pro | business | enterprise",
  "cycle": "monthly | annual",
  "unitAmount": "integer",
  "currency": "string",
  "seatCount": "integer",
  "total": "integer",
  "priceId": "string"
}

Try it

curl -X GET "https://api.clepit.com/v1/tenants/me/billing/checkout/preview" \
  -H "Authorization: Bearer $BEARER_AUTH"
POST/v1/tenants/me/billing/checkouthttps://api.clepit.com

Start a checkout

Creates a checkout session and returns where to send the customer.

Auth bearerAuth

Responses

The started checkout

JSON
{
  "hostedUrl": "string"
}

Try it

curl -X POST "https://api.clepit.com/v1/tenants/me/billing/checkout" \
  -H "Authorization: Bearer $BEARER_AUTH"
GET/v1/tenants/me/billing/invoiceshttps://api.clepit.com

List invoices

Cursor-paginated; pass the previous page's cursor as a query parameter.

Auth bearerAuth

Responses

A page of invoices

JSON
{
  "data": [
    {
      "id": "string",
      "number?": "string | null",
      "status?": "string | null",
      "amountDue": "integer",
      "amountPaid": "integer",
      "currency": "string",
      "hostedInvoiceUrl?": "string | null",
      "invoicePdf?": "string | null",
      "periodStart": "string",
      "periodEnd": "string",
      "created": "string"
    }
  ],
  "hasMore": "boolean"
}

Try it

curl -X GET "https://api.clepit.com/v1/tenants/me/billing/invoices" \
  -H "Authorization: Bearer $BEARER_AUTH"
GET/v1/tenants/me/billing/invoices/{id}https://api.clepit.com

Retrieve one invoice

Returns a single invoice belonging to the caller's tenant.

Auth bearerAuth

Parameters

NameInTypeDescription
id requiredpathstringThe invoice id.

Responses

The invoice

JSON
{
  "id": "string",
  "number?": "string | null",
  "status?": "string | null",
  "amountDue": "integer",
  "amountPaid": "integer",
  "currency": "string",
  "hostedInvoiceUrl?": "string | null",
  "invoicePdf?": "string | null",
  "periodStart": "string",
  "periodEnd": "string",
  "created": "string"
}

Try it

curl -X GET "https://api.clepit.com/v1/tenants/me/billing/invoices/:id" \
  -H "Authorization: Bearer $BEARER_AUTH"
GET/v1/tenants/me/billing/payment-methodshttps://api.clepit.com

List payment methods

Every payment method on file for the caller's tenant.

Auth bearerAuth

Responses

The tenant's payment methods

JSON
[
  {
    "id": "string",
    "brand": "string",
    "last4": "string",
    "expMonth": "integer",
    "expYear": "integer",
    "isDefault": "boolean"
  }
]

Try it

curl -X GET "https://api.clepit.com/v1/tenants/me/billing/payment-methods" \
  -H "Authorization: Bearer $BEARER_AUTH"
GET/v1/tenants/me/billing/plan-change/previewhttps://api.clepit.com

Preview a plan change

Returns the proration for moving to a different tier or cycle, before committing.

Auth bearerAuth

Responses

The proration preview

JSON
{
  "amountDueNow": "integer",
  "amountDueNextCycle": "integer",
  "currency": "string"
}

Try it

curl -X GET "https://api.clepit.com/v1/tenants/me/billing/plan-change/preview" \
  -H "Authorization: Bearer $BEARER_AUTH"
POST/v1/tenants/me/billing/plan-changehttps://api.clepit.com

Change the plan

Moves the tenant to a different tier or cycle.

Auth bearerAuth

Responses

The plan was changed

JSON
{
  "ok": "boolean"
}

Try it

curl -X POST "https://api.clepit.com/v1/tenants/me/billing/plan-change" \
  -H "Authorization: Bearer $BEARER_AUTH"
POST/v1/tenants/me/billing/cancelhttps://api.clepit.com

Cancel the subscription

Schedules cancellation at the end of the current period.

Auth bearerAuth

Responses

The cancellation was scheduled

JSON
{
  "ok": "boolean"
}

Try it

curl -X POST "https://api.clepit.com/v1/tenants/me/billing/cancel" \
  -H "Authorization: Bearer $BEARER_AUTH"
POST/v1/tenants/me/billing/resumehttps://api.clepit.com

Resume a cancelling subscription

Clears a scheduled cancellation.

Auth bearerAuth

Responses

The subscription was resumed

JSON
{
  "ok": "boolean"
}

Try it

curl -X POST "https://api.clepit.com/v1/tenants/me/billing/resume" \
  -H "Authorization: Bearer $BEARER_AUTH"
POST/v1/tenants/me/billing/payment-methods/setup-intenthttps://api.clepit.com

Start adding a payment method

Creates the setup intent the client confirms to attach a new payment method.

Auth bearerAuth

Responses

The setup intent

JSON
{
  "clientSecret": "string"
}

Try it

curl -X POST "https://api.clepit.com/v1/tenants/me/billing/payment-methods/setup-intent" \
  -H "Authorization: Bearer $BEARER_AUTH"
POST/v1/tenants/me/billing/payment-methods/{id}/defaulthttps://api.clepit.com

Make a payment method the default

Future charges use this payment method.

Auth bearerAuth

Parameters

NameInTypeDescription
id requiredpathstringThe payment method id to make default.

Responses

The default was set

JSON
{
  "ok": "boolean"
}

Try it

curl -X POST "https://api.clepit.com/v1/tenants/me/billing/payment-methods/:id/default" \
  -H "Authorization: Bearer $BEARER_AUTH"
DELETE/v1/tenants/me/billing/payment-methods/{id}https://api.clepit.com

Detach a payment method

Removes a payment method from the tenant.

Auth bearerAuth

Parameters

NameInTypeDescription
id requiredpathstringThe payment method id to detach.

Responses

The payment method was detached

JSON
{
  "ok": "boolean"
}

Try it

curl -X DELETE "https://api.clepit.com/v1/tenants/me/billing/payment-methods/:id" \
  -H "Authorization: Bearer $BEARER_AUTH"