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

tenant-settings

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/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"

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

Try it

curl -X GET "https://api.clepit.com/v1/tenants/me/billing" \
  -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/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/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
{
  "currency": "string",
  "cycle": "monthly | annual",
  "priceId": "string",
  "seatCount": "integer",
  "tier": "free | pro | business | enterprise",
  "total": "integer",
  "unitAmount": "integer"
}

Try it

curl -X GET "https://api.clepit.com/v1/tenants/me/billing/checkout/preview" \
  -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": [
    {
      "amountDue": "integer",
      "amountPaid": "integer",
      "created": "string",
      "currency": "string",
      "hostedInvoiceUrl?": "string | null",
      "id": "string",
      "invoicePdf?": "string | null",
      "number?": "string | null",
      "periodEnd": "string",
      "periodStart": "string",
      "status?": "string | null"
    }
  ],
  "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
{
  "amountDue": "integer",
  "amountPaid": "integer",
  "created": "string",
  "currency": "string",
  "hostedInvoiceUrl?": "string | null",
  "id": "string",
  "invoicePdf?": "string | null",
  "number?": "string | null",
  "periodEnd": "string",
  "periodStart": "string",
  "status?": "string | null"
}

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
[
  {
    "brand": "string",
    "expMonth": "integer",
    "expYear": "integer",
    "id": "string",
    "isDefault": "boolean",
    "last4": "string"
  }
]

Try it

curl -X GET "https://api.clepit.com/v1/tenants/me/billing/payment-methods" \
  -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"
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"
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/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"
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
{
  "amountDueNextCycle": "integer",
  "amountDueNow": "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/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"

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"
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"
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
{
  "email": "string",
  "expiresAt": "string",
  "id": "string"
}

Try it

curl -X POST "https://api.clepit.com/v1/tenants/me/invitations/:id/resend" \
  -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": [
    {
      "acceptedAt?": "string | null",
      "email": "string",
      "expiresAt": "string",
      "id": "string",
      "invitedById?": "string | null",
      "revokedAt?": "string | null",
      "roleId?": "string | null",
      "roleName?": "string | null",
      "sentAt": "string",
      "status": "string"
    }
  ],
  "total": "integer"
}

Try it

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

members

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"
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"
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"
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/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": [
    {
      "email": "string",
      "id": "string",
      "joinedAt": "string",
      "name?": "string | null",
      "removedAt?": "string | null",
      "removedById?": "string | null",
      "roleId?": "string | null",
      "roleName?": "string | null",
      "status": "string",
      "suspendedAt?": "string | null",
      "suspensionSource?": "string | null",
      "userId": "string"
    }
  ],
  "total": "integer"
}

Try it

curl -X POST "https://api.clepit.com/v1/tenants/me/members/list" \
  -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"