REST API
clepit's REST surface covers tenant administration: members, invitations, billing and tenant settings. Every operation needs an access token.
| Host | Serves |
|---|---|
| https://api.clepit.com | Production |
| https://staging.api.clepit.com | Staging |
tenant-settings
Read the tenant's allowed email domains
An empty list means invitations are not restricted by domain.
Responses
The current policy
{
"allowedEmailDomains": []
}Validation failed
{
"error": {
"code": "string",
"message": "string"
}
}Caller is not permitted to perform this operation
{
"error": {
"code": "string",
"message": "string"
}
}Unexpected failure
{
"error": {
"code": "string",
"message": "string"
}
}Try it
curl -X GET "https://api.clepit.com/v1/tenants/me/allowed-email-domains" \
-H "Authorization: Bearer $BEARER_AUTH"const response = await fetch('https://api.clepit.com/v1/tenants/me/allowed-email-domains', {
method: 'GET',
headers: {
Authorization: `Bearer ${bearerAuth}`,
},
});
const data = await response.json();final response = await http.get(
Uri.parse('https://api.clepit.com/v1/tenants/me/allowed-email-domains'),
headers: {
'Authorization': 'Bearer $bearerAuth',
},
);response = requests.get(
"https://api.clepit.com/v1/tenants/me/allowed-email-domains",
headers={"Authorization": f"Bearer {bearer_auth}"},
)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.
Responses
The stored policy
{
"allowedEmailDomains": []
}Validation failed
{
"error": {
"code": "string",
"message": "string"
}
}Caller is not permitted to perform this operation
{
"error": {
"code": "string",
"message": "string"
}
}Unexpected failure
{
"error": {
"code": "string",
"message": "string"
}
}Try it
curl -X PUT "https://api.clepit.com/v1/tenants/me/allowed-email-domains" \
-H "Authorization: Bearer $BEARER_AUTH"const response = await fetch('https://api.clepit.com/v1/tenants/me/allowed-email-domains', {
method: 'PUT',
headers: {
Authorization: `Bearer ${bearerAuth}`,
},
});
const data = await response.json();final response = await http.put(
Uri.parse('https://api.clepit.com/v1/tenants/me/allowed-email-domains'),
headers: {
'Authorization': 'Bearer $bearerAuth',
},
);response = requests.put(
"https://api.clepit.com/v1/tenants/me/allowed-email-domains",
headers={"Authorization": f"Bearer {bearer_auth}"},
)Transfer tenant ownership
Moves ownership of the caller's tenant to another member. Requires a fresh MFA-backed session.
Responses
Ownership transferred
{
"ok": "boolean"
}Validation failed
{
"error": {
"code": "string",
"message": "string"
}
}Caller is not permitted to perform this operation
{
"error": {
"code": "string",
"message": "string"
}
}Unexpected failure
{
"error": {
"code": "string",
"message": "string"
}
}Try it
curl -X POST "https://api.clepit.com/v1/tenants/me/transfer-ownership" \
-H "Authorization: Bearer $BEARER_AUTH"const response = await fetch('https://api.clepit.com/v1/tenants/me/transfer-ownership', {
method: 'POST',
headers: {
Authorization: `Bearer ${bearerAuth}`,
},
});
const data = await response.json();final response = await http.post(
Uri.parse('https://api.clepit.com/v1/tenants/me/transfer-ownership'),
headers: {
'Authorization': 'Bearer $bearerAuth',
},
);response = requests.post(
"https://api.clepit.com/v1/tenants/me/transfer-ownership",
headers={"Authorization": f"Bearer {bearer_auth}"},
)billing
Read the tenant's billing state
Tier, status, cycle and the derived state the UI gates on.
Responses
The tenant's billing state
{
"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"
}Validation failed
{
"error": {
"code": "string",
"message": "string"
}
}Caller is not permitted to perform this operation
{
"error": {
"code": "string",
"message": "string"
}
}Unexpected failure
{
"error": {
"code": "string",
"message": "string"
}
}Try it
curl -X GET "https://api.clepit.com/v1/tenants/me/billing" \
-H "Authorization: Bearer $BEARER_AUTH"const response = await fetch('https://api.clepit.com/v1/tenants/me/billing', {
method: 'GET',
headers: {
Authorization: `Bearer ${bearerAuth}`,
},
});
const data = await response.json();final response = await http.get(
Uri.parse('https://api.clepit.com/v1/tenants/me/billing'),
headers: {
'Authorization': 'Bearer $bearerAuth',
},
);response = requests.get(
"https://api.clepit.com/v1/tenants/me/billing",
headers={"Authorization": f"Bearer {bearer_auth}"},
)Cancel the subscription
Schedules cancellation at the end of the current period.
Responses
The cancellation was scheduled
{
"ok": "boolean"
}Validation failed
{
"error": {
"code": "string",
"message": "string"
}
}Caller is not permitted to perform this operation
{
"error": {
"code": "string",
"message": "string"
}
}Unexpected failure
{
"error": {
"code": "string",
"message": "string"
}
}Try it
curl -X POST "https://api.clepit.com/v1/tenants/me/billing/cancel" \
-H "Authorization: Bearer $BEARER_AUTH"const response = await fetch('https://api.clepit.com/v1/tenants/me/billing/cancel', {
method: 'POST',
headers: {
Authorization: `Bearer ${bearerAuth}`,
},
});
const data = await response.json();final response = await http.post(
Uri.parse('https://api.clepit.com/v1/tenants/me/billing/cancel'),
headers: {
'Authorization': 'Bearer $bearerAuth',
},
);response = requests.post(
"https://api.clepit.com/v1/tenants/me/billing/cancel",
headers={"Authorization": f"Bearer {bearer_auth}"},
)Start a checkout
Creates a checkout session and returns where to send the customer.
Responses
The started checkout
{
"hostedUrl": "string"
}Validation failed
{
"error": {
"code": "string",
"message": "string"
}
}Caller is not permitted to perform this operation
{
"error": {
"code": "string",
"message": "string"
}
}Unexpected failure
{
"error": {
"code": "string",
"message": "string"
}
}Try it
curl -X POST "https://api.clepit.com/v1/tenants/me/billing/checkout" \
-H "Authorization: Bearer $BEARER_AUTH"const response = await fetch('https://api.clepit.com/v1/tenants/me/billing/checkout', {
method: 'POST',
headers: {
Authorization: `Bearer ${bearerAuth}`,
},
});
const data = await response.json();final response = await http.post(
Uri.parse('https://api.clepit.com/v1/tenants/me/billing/checkout'),
headers: {
'Authorization': 'Bearer $bearerAuth',
},
);response = requests.post(
"https://api.clepit.com/v1/tenants/me/billing/checkout",
headers={"Authorization": f"Bearer {bearer_auth}"},
)Preview a checkout
Prices a tier and cycle before starting checkout. Takes tier and cycle as query parameters.
Responses
The priced checkout
{
"currency": "string",
"cycle": "monthly | annual",
"priceId": "string",
"seatCount": "integer",
"tier": "free | pro | business | enterprise",
"total": "integer",
"unitAmount": "integer"
}Validation failed
{
"error": {
"code": "string",
"message": "string"
}
}Caller is not permitted to perform this operation
{
"error": {
"code": "string",
"message": "string"
}
}Unexpected failure
{
"error": {
"code": "string",
"message": "string"
}
}Try it
curl -X GET "https://api.clepit.com/v1/tenants/me/billing/checkout/preview" \
-H "Authorization: Bearer $BEARER_AUTH"const response = await fetch('https://api.clepit.com/v1/tenants/me/billing/checkout/preview', {
method: 'GET',
headers: {
Authorization: `Bearer ${bearerAuth}`,
},
});
const data = await response.json();final response = await http.get(
Uri.parse('https://api.clepit.com/v1/tenants/me/billing/checkout/preview'),
headers: {
'Authorization': 'Bearer $bearerAuth',
},
);response = requests.get(
"https://api.clepit.com/v1/tenants/me/billing/checkout/preview",
headers={"Authorization": f"Bearer {bearer_auth}"},
)List invoices
Cursor-paginated; pass the previous page's cursor as a query parameter.
Responses
A page of invoices
{
"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"
}Validation failed
{
"error": {
"code": "string",
"message": "string"
}
}Caller is not permitted to perform this operation
{
"error": {
"code": "string",
"message": "string"
}
}Unexpected failure
{
"error": {
"code": "string",
"message": "string"
}
}Try it
curl -X GET "https://api.clepit.com/v1/tenants/me/billing/invoices" \
-H "Authorization: Bearer $BEARER_AUTH"const response = await fetch('https://api.clepit.com/v1/tenants/me/billing/invoices', {
method: 'GET',
headers: {
Authorization: `Bearer ${bearerAuth}`,
},
});
const data = await response.json();final response = await http.get(
Uri.parse('https://api.clepit.com/v1/tenants/me/billing/invoices'),
headers: {
'Authorization': 'Bearer $bearerAuth',
},
);response = requests.get(
"https://api.clepit.com/v1/tenants/me/billing/invoices",
headers={"Authorization": f"Bearer {bearer_auth}"},
)Retrieve one invoice
Returns a single invoice belonging to the caller's tenant.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
| id required | path | string | The invoice id. |
Responses
The invoice
{
"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"
}Validation failed
{
"error": {
"code": "string",
"message": "string"
}
}Caller is not permitted to perform this operation
{
"error": {
"code": "string",
"message": "string"
}
}Unexpected failure
{
"error": {
"code": "string",
"message": "string"
}
}Try it
curl -X GET "https://api.clepit.com/v1/tenants/me/billing/invoices/:id" \
-H "Authorization: Bearer $BEARER_AUTH"const response = await fetch('https://api.clepit.com/v1/tenants/me/billing/invoices/:id', {
method: 'GET',
headers: {
Authorization: `Bearer ${bearerAuth}`,
},
});
const data = await response.json();final response = await http.get(
Uri.parse('https://api.clepit.com/v1/tenants/me/billing/invoices/:id'),
headers: {
'Authorization': 'Bearer $bearerAuth',
},
);response = requests.get(
"https://api.clepit.com/v1/tenants/me/billing/invoices/:id",
headers={"Authorization": f"Bearer {bearer_auth}"},
)List payment methods
Every payment method on file for the caller's tenant.
Responses
The tenant's payment methods
[
{
"brand": "string",
"expMonth": "integer",
"expYear": "integer",
"id": "string",
"isDefault": "boolean",
"last4": "string"
}
]Validation failed
{
"error": {
"code": "string",
"message": "string"
}
}Caller is not permitted to perform this operation
{
"error": {
"code": "string",
"message": "string"
}
}Unexpected failure
{
"error": {
"code": "string",
"message": "string"
}
}Try it
curl -X GET "https://api.clepit.com/v1/tenants/me/billing/payment-methods" \
-H "Authorization: Bearer $BEARER_AUTH"const response = await fetch('https://api.clepit.com/v1/tenants/me/billing/payment-methods', {
method: 'GET',
headers: {
Authorization: `Bearer ${bearerAuth}`,
},
});
const data = await response.json();final response = await http.get(
Uri.parse('https://api.clepit.com/v1/tenants/me/billing/payment-methods'),
headers: {
'Authorization': 'Bearer $bearerAuth',
},
);response = requests.get(
"https://api.clepit.com/v1/tenants/me/billing/payment-methods",
headers={"Authorization": f"Bearer {bearer_auth}"},
)Detach a payment method
Removes a payment method from the tenant.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
| id required | path | string | The payment method id to detach. |
Responses
The payment method was detached
{
"ok": "boolean"
}Validation failed
{
"error": {
"code": "string",
"message": "string"
}
}Caller is not permitted to perform this operation
{
"error": {
"code": "string",
"message": "string"
}
}Unexpected failure
{
"error": {
"code": "string",
"message": "string"
}
}Try it
curl -X DELETE "https://api.clepit.com/v1/tenants/me/billing/payment-methods/:id" \
-H "Authorization: Bearer $BEARER_AUTH"const response = await fetch('https://api.clepit.com/v1/tenants/me/billing/payment-methods/:id', {
method: 'DELETE',
headers: {
Authorization: `Bearer ${bearerAuth}`,
},
});
const data = await response.json();final response = await http.delete(
Uri.parse('https://api.clepit.com/v1/tenants/me/billing/payment-methods/:id'),
headers: {
'Authorization': 'Bearer $bearerAuth',
},
);response = requests.delete(
"https://api.clepit.com/v1/tenants/me/billing/payment-methods/:id",
headers={"Authorization": f"Bearer {bearer_auth}"},
)Make a payment method the default
Future charges use this payment method.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
| id required | path | string | The payment method id to make default. |
Responses
The default was set
{
"ok": "boolean"
}Validation failed
{
"error": {
"code": "string",
"message": "string"
}
}Caller is not permitted to perform this operation
{
"error": {
"code": "string",
"message": "string"
}
}Unexpected failure
{
"error": {
"code": "string",
"message": "string"
}
}Try it
curl -X POST "https://api.clepit.com/v1/tenants/me/billing/payment-methods/:id/default" \
-H "Authorization: Bearer $BEARER_AUTH"const response = await fetch('https://api.clepit.com/v1/tenants/me/billing/payment-methods/:id/default', {
method: 'POST',
headers: {
Authorization: `Bearer ${bearerAuth}`,
},
});
const data = await response.json();final response = await http.post(
Uri.parse('https://api.clepit.com/v1/tenants/me/billing/payment-methods/:id/default'),
headers: {
'Authorization': 'Bearer $bearerAuth',
},
);response = requests.post(
"https://api.clepit.com/v1/tenants/me/billing/payment-methods/:id/default",
headers={"Authorization": f"Bearer {bearer_auth}"},
)Start adding a payment method
Creates the setup intent the client confirms to attach a new payment method.
Responses
The setup intent
{
"clientSecret": "string"
}Validation failed
{
"error": {
"code": "string",
"message": "string"
}
}Caller is not permitted to perform this operation
{
"error": {
"code": "string",
"message": "string"
}
}Unexpected failure
{
"error": {
"code": "string",
"message": "string"
}
}Try it
curl -X POST "https://api.clepit.com/v1/tenants/me/billing/payment-methods/setup-intent" \
-H "Authorization: Bearer $BEARER_AUTH"const response = await fetch('https://api.clepit.com/v1/tenants/me/billing/payment-methods/setup-intent', {
method: 'POST',
headers: {
Authorization: `Bearer ${bearerAuth}`,
},
});
const data = await response.json();final response = await http.post(
Uri.parse('https://api.clepit.com/v1/tenants/me/billing/payment-methods/setup-intent'),
headers: {
'Authorization': 'Bearer $bearerAuth',
},
);response = requests.post(
"https://api.clepit.com/v1/tenants/me/billing/payment-methods/setup-intent",
headers={"Authorization": f"Bearer {bearer_auth}"},
)Change the plan
Moves the tenant to a different tier or cycle.
Responses
The plan was changed
{
"ok": "boolean"
}Validation failed
{
"error": {
"code": "string",
"message": "string"
}
}Caller is not permitted to perform this operation
{
"error": {
"code": "string",
"message": "string"
}
}Unexpected failure
{
"error": {
"code": "string",
"message": "string"
}
}Try it
curl -X POST "https://api.clepit.com/v1/tenants/me/billing/plan-change" \
-H "Authorization: Bearer $BEARER_AUTH"const response = await fetch('https://api.clepit.com/v1/tenants/me/billing/plan-change', {
method: 'POST',
headers: {
Authorization: `Bearer ${bearerAuth}`,
},
});
const data = await response.json();final response = await http.post(
Uri.parse('https://api.clepit.com/v1/tenants/me/billing/plan-change'),
headers: {
'Authorization': 'Bearer $bearerAuth',
},
);response = requests.post(
"https://api.clepit.com/v1/tenants/me/billing/plan-change",
headers={"Authorization": f"Bearer {bearer_auth}"},
)Preview a plan change
Returns the proration for moving to a different tier or cycle, before committing.
Responses
The proration preview
{
"amountDueNextCycle": "integer",
"amountDueNow": "integer",
"currency": "string"
}Validation failed
{
"error": {
"code": "string",
"message": "string"
}
}Caller is not permitted to perform this operation
{
"error": {
"code": "string",
"message": "string"
}
}Unexpected failure
{
"error": {
"code": "string",
"message": "string"
}
}Try it
curl -X GET "https://api.clepit.com/v1/tenants/me/billing/plan-change/preview" \
-H "Authorization: Bearer $BEARER_AUTH"const response = await fetch('https://api.clepit.com/v1/tenants/me/billing/plan-change/preview', {
method: 'GET',
headers: {
Authorization: `Bearer ${bearerAuth}`,
},
});
const data = await response.json();final response = await http.get(
Uri.parse('https://api.clepit.com/v1/tenants/me/billing/plan-change/preview'),
headers: {
'Authorization': 'Bearer $bearerAuth',
},
);response = requests.get(
"https://api.clepit.com/v1/tenants/me/billing/plan-change/preview",
headers={"Authorization": f"Bearer {bearer_auth}"},
)Resume a cancelling subscription
Clears a scheduled cancellation.
Responses
The subscription was resumed
{
"ok": "boolean"
}Validation failed
{
"error": {
"code": "string",
"message": "string"
}
}Caller is not permitted to perform this operation
{
"error": {
"code": "string",
"message": "string"
}
}Unexpected failure
{
"error": {
"code": "string",
"message": "string"
}
}Try it
curl -X POST "https://api.clepit.com/v1/tenants/me/billing/resume" \
-H "Authorization: Bearer $BEARER_AUTH"const response = await fetch('https://api.clepit.com/v1/tenants/me/billing/resume', {
method: 'POST',
headers: {
Authorization: `Bearer ${bearerAuth}`,
},
});
const data = await response.json();final response = await http.post(
Uri.parse('https://api.clepit.com/v1/tenants/me/billing/resume'),
headers: {
'Authorization': 'Bearer $bearerAuth',
},
);response = requests.post(
"https://api.clepit.com/v1/tenants/me/billing/resume",
headers={"Authorization": f"Bearer {bearer_auth}"},
)invitations
Invite people to the tenant
Creates invitations in bulk. Each result reports its own outcome, so a partial success is still a 200.
Responses
Per-invitation results
{
"results": "unknown"
}Validation failed
{
"error": {
"code": "string",
"message": "string"
}
}Caller is not permitted to perform this operation
{
"error": {
"code": "string",
"message": "string"
}
}Unexpected failure
{
"error": {
"code": "string",
"message": "string"
}
}Try it
curl -X POST "https://api.clepit.com/v1/tenants/me/invitations" \
-H "Authorization: Bearer $BEARER_AUTH"const response = await fetch('https://api.clepit.com/v1/tenants/me/invitations', {
method: 'POST',
headers: {
Authorization: `Bearer ${bearerAuth}`,
},
});
const data = await response.json();final response = await http.post(
Uri.parse('https://api.clepit.com/v1/tenants/me/invitations'),
headers: {
'Authorization': 'Bearer $bearerAuth',
},
);response = requests.post(
"https://api.clepit.com/v1/tenants/me/invitations",
headers={"Authorization": f"Bearer {bearer_auth}"},
)Revoke an invitation
Revokes a pending invitation so its link stops working.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
| id required | path | string | The invitation id to revoke. |
Responses
The revoked invitation
{
"id": "string",
"revokedAt": "string"
}Validation failed
{
"error": {
"code": "string",
"message": "string"
}
}Caller is not permitted to perform this operation
{
"error": {
"code": "string",
"message": "string"
}
}Unexpected failure
{
"error": {
"code": "string",
"message": "string"
}
}Try it
curl -X DELETE "https://api.clepit.com/v1/tenants/me/invitations/:id" \
-H "Authorization: Bearer $BEARER_AUTH"const response = await fetch('https://api.clepit.com/v1/tenants/me/invitations/:id', {
method: 'DELETE',
headers: {
Authorization: `Bearer ${bearerAuth}`,
},
});
const data = await response.json();final response = await http.delete(
Uri.parse('https://api.clepit.com/v1/tenants/me/invitations/:id'),
headers: {
'Authorization': 'Bearer $bearerAuth',
},
);response = requests.delete(
"https://api.clepit.com/v1/tenants/me/invitations/:id",
headers={"Authorization": f"Bearer {bearer_auth}"},
)Resend an invitation
Re-sends the invitation email and extends its expiry.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
| id required | path | string | The invitation id to resend. |
Responses
The resent invitation
{
"email": "string",
"expiresAt": "string",
"id": "string"
}Validation failed
{
"error": {
"code": "string",
"message": "string"
}
}Caller is not permitted to perform this operation
{
"error": {
"code": "string",
"message": "string"
}
}Unexpected failure
{
"error": {
"code": "string",
"message": "string"
}
}Try it
curl -X POST "https://api.clepit.com/v1/tenants/me/invitations/:id/resend" \
-H "Authorization: Bearer $BEARER_AUTH"const response = await fetch('https://api.clepit.com/v1/tenants/me/invitations/:id/resend', {
method: 'POST',
headers: {
Authorization: `Bearer ${bearerAuth}`,
},
});
const data = await response.json();final response = await http.post(
Uri.parse('https://api.clepit.com/v1/tenants/me/invitations/:id/resend'),
headers: {
'Authorization': 'Bearer $bearerAuth',
},
);response = requests.post(
"https://api.clepit.com/v1/tenants/me/invitations/:id/resend",
headers={"Authorization": f"Bearer {bearer_auth}"},
)List the tenant's invitations
Cursor-paginated, same shape as the member list.
Responses
A page of invitations
{
"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"
}Validation failed
{
"error": {
"code": "string",
"message": "string"
}
}Caller is not permitted to perform this operation
{
"error": {
"code": "string",
"message": "string"
}
}Unexpected failure
{
"error": {
"code": "string",
"message": "string"
}
}Try it
curl -X POST "https://api.clepit.com/v1/tenants/me/invitations/list" \
-H "Authorization: Bearer $BEARER_AUTH"const response = await fetch('https://api.clepit.com/v1/tenants/me/invitations/list', {
method: 'POST',
headers: {
Authorization: `Bearer ${bearerAuth}`,
},
});
const data = await response.json();final response = await http.post(
Uri.parse('https://api.clepit.com/v1/tenants/me/invitations/list'),
headers: {
'Authorization': 'Bearer $bearerAuth',
},
);response = requests.post(
"https://api.clepit.com/v1/tenants/me/invitations/list",
headers={"Authorization": f"Bearer {bearer_auth}"},
)members
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.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
| id required | path | string | The membership id to remove. |
Responses
The removed membership
{
"id": "string",
"removedAt": "string"
}Validation failed
{
"error": {
"code": "string",
"message": "string"
}
}Caller is not permitted to perform this operation
{
"error": {
"code": "string",
"message": "string"
}
}Unexpected failure
{
"error": {
"code": "string",
"message": "string"
}
}Try it
curl -X DELETE "https://api.clepit.com/v1/tenants/me/members/:id" \
-H "Authorization: Bearer $BEARER_AUTH"const response = await fetch('https://api.clepit.com/v1/tenants/me/members/:id', {
method: 'DELETE',
headers: {
Authorization: `Bearer ${bearerAuth}`,
},
});
const data = await response.json();final response = await http.delete(
Uri.parse('https://api.clepit.com/v1/tenants/me/members/:id'),
headers: {
'Authorization': 'Bearer $bearerAuth',
},
);response = requests.delete(
"https://api.clepit.com/v1/tenants/me/members/:id",
headers={"Authorization": f"Bearer {bearer_auth}"},
)Change a member's role
Replaces the member's current role assignment.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
| id required | path | string | The membership id whose role changes. |
Responses
Role changed
{
"ok": "boolean"
}Validation failed
{
"error": {
"code": "string",
"message": "string"
}
}Caller is not permitted to perform this operation
{
"error": {
"code": "string",
"message": "string"
}
}Unexpected failure
{
"error": {
"code": "string",
"message": "string"
}
}Try it
curl -X POST "https://api.clepit.com/v1/tenants/me/members/:id/role" \
-H "Authorization: Bearer $BEARER_AUTH"const response = await fetch('https://api.clepit.com/v1/tenants/me/members/:id/role', {
method: 'POST',
headers: {
Authorization: `Bearer ${bearerAuth}`,
},
});
const data = await response.json();final response = await http.post(
Uri.parse('https://api.clepit.com/v1/tenants/me/members/:id/role'),
headers: {
'Authorization': 'Bearer $bearerAuth',
},
);response = requests.post(
"https://api.clepit.com/v1/tenants/me/members/:id/role",
headers={"Authorization": f"Bearer {bearer_auth}"},
)Suspend a member
Suspends one membership in the caller's tenant.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
| id required | path | string | The membership id to suspend. |
Responses
The suspended membership
{
"id": "string",
"suspendedAt": "string"
}Validation failed
{
"error": {
"code": "string",
"message": "string"
}
}Caller is not permitted to perform this operation
{
"error": {
"code": "string",
"message": "string"
}
}Unexpected failure
{
"error": {
"code": "string",
"message": "string"
}
}Try it
curl -X POST "https://api.clepit.com/v1/tenants/me/members/:id/suspend" \
-H "Authorization: Bearer $BEARER_AUTH"const response = await fetch('https://api.clepit.com/v1/tenants/me/members/:id/suspend', {
method: 'POST',
headers: {
Authorization: `Bearer ${bearerAuth}`,
},
});
const data = await response.json();final response = await http.post(
Uri.parse('https://api.clepit.com/v1/tenants/me/members/:id/suspend'),
headers: {
'Authorization': 'Bearer $bearerAuth',
},
);response = requests.post(
"https://api.clepit.com/v1/tenants/me/members/:id/suspend",
headers={"Authorization": f"Bearer {bearer_auth}"},
)Reinstate a suspended member
Lifts a suspension on one membership in the caller's tenant.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
| id required | path | string | The membership id to reinstate. |
Responses
The reinstated membership
{
"id": "string"
}Validation failed
{
"error": {
"code": "string",
"message": "string"
}
}Caller is not permitted to perform this operation
{
"error": {
"code": "string",
"message": "string"
}
}Unexpected failure
{
"error": {
"code": "string",
"message": "string"
}
}Try it
curl -X POST "https://api.clepit.com/v1/tenants/me/members/:id/unsuspend" \
-H "Authorization: Bearer $BEARER_AUTH"const response = await fetch('https://api.clepit.com/v1/tenants/me/members/:id/unsuspend', {
method: 'POST',
headers: {
Authorization: `Bearer ${bearerAuth}`,
},
});
const data = await response.json();final response = await http.post(
Uri.parse('https://api.clepit.com/v1/tenants/me/members/:id/unsuspend'),
headers: {
'Authorization': 'Bearer $bearerAuth',
},
);response = requests.post(
"https://api.clepit.com/v1/tenants/me/members/:id/unsuspend",
headers={"Authorization": f"Bearer {bearer_auth}"},
)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.
Responses
Per-membership results
{
"results": "unknown"
}Validation failed
{
"error": {
"code": "string",
"message": "string"
}
}Caller is not permitted to perform this operation
{
"error": {
"code": "string",
"message": "string"
}
}Unexpected failure
{
"error": {
"code": "string",
"message": "string"
}
}Try it
curl -X POST "https://api.clepit.com/v1/tenants/me/members/bulk-remove" \
-H "Authorization: Bearer $BEARER_AUTH"const response = await fetch('https://api.clepit.com/v1/tenants/me/members/bulk-remove', {
method: 'POST',
headers: {
Authorization: `Bearer ${bearerAuth}`,
},
});
const data = await response.json();final response = await http.post(
Uri.parse('https://api.clepit.com/v1/tenants/me/members/bulk-remove'),
headers: {
'Authorization': 'Bearer $bearerAuth',
},
);response = requests.post(
"https://api.clepit.com/v1/tenants/me/members/bulk-remove",
headers={"Authorization": f"Bearer {bearer_auth}"},
)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.
Responses
Per-membership results
{
"results": "unknown"
}Validation failed
{
"error": {
"code": "string",
"message": "string"
}
}Caller is not permitted to perform this operation
{
"error": {
"code": "string",
"message": "string"
}
}Unexpected failure
{
"error": {
"code": "string",
"message": "string"
}
}Try it
curl -X POST "https://api.clepit.com/v1/tenants/me/members/bulk-role" \
-H "Authorization: Bearer $BEARER_AUTH"const response = await fetch('https://api.clepit.com/v1/tenants/me/members/bulk-role', {
method: 'POST',
headers: {
Authorization: `Bearer ${bearerAuth}`,
},
});
const data = await response.json();final response = await http.post(
Uri.parse('https://api.clepit.com/v1/tenants/me/members/bulk-role'),
headers: {
'Authorization': 'Bearer $bearerAuth',
},
);response = requests.post(
"https://api.clepit.com/v1/tenants/me/members/bulk-role",
headers={"Authorization": f"Bearer {bearer_auth}"},
)List the caller's tenant members
Cursor-paginated. The body carries the filter and cursor; POST rather than GET because the filter is structured.
Responses
A page of members
{
"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"
}Validation failed
{
"error": {
"code": "string",
"message": "string"
}
}Caller is not permitted to perform this operation
{
"error": {
"code": "string",
"message": "string"
}
}Unexpected failure
{
"error": {
"code": "string",
"message": "string"
}
}Try it
curl -X POST "https://api.clepit.com/v1/tenants/me/members/list" \
-H "Authorization: Bearer $BEARER_AUTH"const response = await fetch('https://api.clepit.com/v1/tenants/me/members/list', {
method: 'POST',
headers: {
Authorization: `Bearer ${bearerAuth}`,
},
});
const data = await response.json();final response = await http.post(
Uri.parse('https://api.clepit.com/v1/tenants/me/members/list'),
headers: {
'Authorization': 'Bearer $bearerAuth',
},
);response = requests.post(
"https://api.clepit.com/v1/tenants/me/members/list",
headers={"Authorization": f"Bearer {bearer_auth}"},
)Leave the tenant
Removes the caller's own membership. An owner must transfer ownership first.
Responses
The removed membership
{
"id": "string",
"removedAt": "string"
}Validation failed
{
"error": {
"code": "string",
"message": "string"
}
}Caller is not permitted to perform this operation
{
"error": {
"code": "string",
"message": "string"
}
}Unexpected failure
{
"error": {
"code": "string",
"message": "string"
}
}Try it
curl -X DELETE "https://api.clepit.com/v1/tenants/me/membership" \
-H "Authorization: Bearer $BEARER_AUTH"const response = await fetch('https://api.clepit.com/v1/tenants/me/membership', {
method: 'DELETE',
headers: {
Authorization: `Bearer ${bearerAuth}`,
},
});
const data = await response.json();final response = await http.delete(
Uri.parse('https://api.clepit.com/v1/tenants/me/membership'),
headers: {
'Authorization': 'Bearer $bearerAuth',
},
);response = requests.delete(
"https://api.clepit.com/v1/tenants/me/membership",
headers={"Authorization": f"Bearer {bearer_auth}"},
)