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 |
members
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": [
{
"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"
}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}"},
)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 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}"},
)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}"},
)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}"},
)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}"},
)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}"},
)List the tenant's invitations
Cursor-paginated, same shape as the member list.
Responses
A page of invitations
{
"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"
}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}"},
)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
{
"id": "string",
"email": "string",
"expiresAt": "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}"},
)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}"},
)tenant-settings
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}"},
)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}"},
)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.
Responses
Role created
{
"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/roles" \
-H "Authorization: Bearer $BEARER_AUTH"const response = await fetch('https://api.clepit.com/v1/tenants/me/roles', {
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/roles'),
headers: {
'Authorization': 'Bearer $bearerAuth',
},
);response = requests.post(
"https://api.clepit.com/v1/tenants/me/roles",
headers={"Authorization": f"Bearer {bearer_auth}"},
)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.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
| id required | path | string | The role id being edited. |
Responses
Role updated
{
"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 PATCH "https://api.clepit.com/v1/tenants/me/roles/:id" \
-H "Authorization: Bearer $BEARER_AUTH"const response = await fetch('https://api.clepit.com/v1/tenants/me/roles/:id', {
method: 'PATCH',
headers: {
Authorization: `Bearer ${bearerAuth}`,
},
});
const data = await response.json();final response = await http.patch(
Uri.parse('https://api.clepit.com/v1/tenants/me/roles/:id'),
headers: {
'Authorization': 'Bearer $bearerAuth',
},
);response = requests.patch(
"https://api.clepit.com/v1/tenants/me/roles/:id",
headers={"Authorization": f"Bearer {bearer_auth}"},
)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.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
| id required | path | string | The role id being deleted. |
Responses
Role deleted
{
"lostBy": [
{
"email": "string",
"name?": "string | null",
"userId": "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/roles/:id" \
-H "Authorization: Bearer $BEARER_AUTH"const response = await fetch('https://api.clepit.com/v1/tenants/me/roles/: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/roles/:id'),
headers: {
'Authorization': 'Bearer $bearerAuth',
},
);response = requests.delete(
"https://api.clepit.com/v1/tenants/me/roles/:id",
headers={"Authorization": f"Bearer {bearer_auth}"},
)List a role's holders
The members currently holding the role, for the delete warning and the Roles tab.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
| id required | path | string | The role id whose holders are listed. |
Responses
The holders
{
"holders": [
{
"email": "string",
"name?": "string | null",
"userId": "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/roles/:id/holders" \
-H "Authorization: Bearer $BEARER_AUTH"const response = await fetch('https://api.clepit.com/v1/tenants/me/roles/:id/holders', {
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/roles/:id/holders'),
headers: {
'Authorization': 'Bearer $bearerAuth',
},
);response = requests.get(
"https://api.clepit.com/v1/tenants/me/roles/:id/holders",
headers={"Authorization": f"Bearer {bearer_auth}"},
)List SCIM tokens
The tenant's live SCIM tokens, newest first, with when each last authenticated. A token's secret is never returned here.
Responses
The tenant's SCIM tokens
{
"tokens": [
{
"id": "string",
"displayName": "string",
"createdAt": "string",
"lastUsedAt?": "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/scim-tokens" \
-H "Authorization: Bearer $BEARER_AUTH"const response = await fetch('https://api.clepit.com/v1/tenants/me/scim-tokens', {
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/scim-tokens'),
headers: {
'Authorization': 'Bearer $bearerAuth',
},
);response = requests.get(
"https://api.clepit.com/v1/tenants/me/scim-tokens",
headers={"Authorization": f"Bearer {bearer_auth}"},
)Create a SCIM token
Mints a token for the tenant's identity provider and returns its secret once. Held on Enterprise; other plans are refused with FEATURE_NOT_IN_PLAN. Requires a fresh MFA-backed session; forward the ID token in X-Id-Token.
Responses
The minted token and its secret
{
"token": {
"id": "string",
"displayName": "string",
"createdAt": "string",
"lastUsedAt?": "string | null"
},
"secret": "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/scim-tokens" \
-H "Authorization: Bearer $BEARER_AUTH"const response = await fetch('https://api.clepit.com/v1/tenants/me/scim-tokens', {
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/scim-tokens'),
headers: {
'Authorization': 'Bearer $bearerAuth',
},
);response = requests.post(
"https://api.clepit.com/v1/tenants/me/scim-tokens",
headers={"Authorization": f"Bearer {bearer_auth}"},
)Revoke a SCIM token
Stops the token authenticating, on any plan. Requires a fresh MFA-backed session; forward the ID token in X-Id-Token.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
| id required | path | string | The SCIM token id being revoked. |
Responses
Token revoked
{
"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/scim-tokens/:id" \
-H "Authorization: Bearer $BEARER_AUTH"const response = await fetch('https://api.clepit.com/v1/tenants/me/scim-tokens/: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/scim-tokens/:id'),
headers: {
'Authorization': 'Bearer $bearerAuth',
},
);response = requests.delete(
"https://api.clepit.com/v1/tenants/me/scim-tokens/:id",
headers={"Authorization": f"Bearer {bearer_auth}"},
)Read the AI add-on settings
Whether the AI add-on is on for the organisation, the model it runs, when it was turned on, and its route: platform on clepit's account, own on the organisation's own AI account.
Responses
The AI add-on settings
{
"enabled": "boolean",
"model?": "string | null",
"enabledAt?": "string | null",
"route": "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/ai/settings" \
-H "Authorization: Bearer $BEARER_AUTH"const response = await fetch('https://api.clepit.com/v1/tenants/me/ai/settings', {
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/ai/settings'),
headers: {
'Authorization': 'Bearer $bearerAuth',
},
);response = requests.get(
"https://api.clepit.com/v1/tenants/me/ai/settings",
headers={"Authorization": f"Bearer {bearer_auth}"},
)List the AI models
The models the AI add-on offers, each with its price per million tokens, in micros.
Responses
The offered models
[
{
"id": "string",
"displayName": "string",
"perMillion": {
"input": "integer",
"output": "integer",
"cacheWrite5M": "integer",
"cacheWrite1H": "integer",
"cacheRead": "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/ai/models" \
-H "Authorization: Bearer $BEARER_AUTH"const response = await fetch('https://api.clepit.com/v1/tenants/me/ai/models', {
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/ai/models'),
headers: {
'Authorization': 'Bearer $bearerAuth',
},
);response = requests.get(
"https://api.clepit.com/v1/tenants/me/ai/models",
headers={"Authorization": f"Bearer {bearer_auth}"},
)List the AI spend limits
The company's AI spend limits, the company-wide one and one per member, each with what is used and left this month.
Responses
The AI spend limits
[
{
"id": "string",
"memberId?": "string | null",
"memberName?": "string | null",
"unit": "string",
"amount": "integer",
"thresholds": [],
"recipients": [
{
"kind": "string",
"value": "string"
}
],
"used": "integer",
"left": "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/ai/limits" \
-H "Authorization: Bearer $BEARER_AUTH"const response = await fetch('https://api.clepit.com/v1/tenants/me/ai/limits', {
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/ai/limits'),
headers: {
'Authorization': 'Bearer $bearerAuth',
},
);response = requests.get(
"https://api.clepit.com/v1/tenants/me/ai/limits",
headers={"Authorization": f"Bearer {bearer_auth}"},
)Set an AI spend limit
Sets the company's AI spend limit, or one member's with memberId, replacing the one it had. AI stops when the amount is reached. unit is tokens or money, a money amount in micros; thresholds are warning percentages from 1 to 99; each recipient is alerted and has kind member, role or email with its value.
Responses
The limit as written
{
"id": "string",
"memberId?": "string | null",
"memberName?": "string | null",
"unit": "string",
"amount": "integer",
"thresholds": [],
"recipients": [
{
"kind": "string",
"value": "string"
}
],
"used": "integer",
"left": "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 PUT "https://api.clepit.com/v1/tenants/me/ai/limits" \
-H "Authorization: Bearer $BEARER_AUTH"const response = await fetch('https://api.clepit.com/v1/tenants/me/ai/limits', {
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/ai/limits'),
headers: {
'Authorization': 'Bearer $bearerAuth',
},
);response = requests.put(
"https://api.clepit.com/v1/tenants/me/ai/limits",
headers={"Authorization": f"Bearer {bearer_auth}"},
)Suggest a company AI limit
A suggested company limit in money, in micros: the plan's monthly seat price for every seat, or the nearest priced plan's.
Responses
The suggested limit
{
"suggestion?": "integer | 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/ai/limit-suggestion" \
-H "Authorization: Bearer $BEARER_AUTH"const response = await fetch('https://api.clepit.com/v1/tenants/me/ai/limit-suggestion', {
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/ai/limit-suggestion'),
headers: {
'Authorization': 'Bearer $bearerAuth',
},
);response = requests.get(
"https://api.clepit.com/v1/tenants/me/ai/limit-suggestion",
headers={"Authorization": f"Bearer {bearer_auth}"},
)Read the own AI account's seat fee
The fee per seat a month for running AI on the organisation's own account: every seat on the plan counts, at the price of the band the seat count falls in. It answers the organisation's seat count, that band's price in cents, and the bands of the plan that offers an own account.
Responses
The seat fee
{
"seats": "integer",
"priceCents": "integer",
"bands": [
{
"seatsUpTo?": "integer | null",
"cents": "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/ai/seat-fee" \
-H "Authorization: Bearer $BEARER_AUTH"const response = await fetch('https://api.clepit.com/v1/tenants/me/ai/seat-fee', {
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/ai/seat-fee'),
headers: {
'Authorization': 'Bearer $bearerAuth',
},
);response = requests.get(
"https://api.clepit.com/v1/tenants/me/ai/seat-fee",
headers={"Authorization": f"Bearer {bearer_auth}"},
)Read whether a card is on file
Whether the company has a default card on file, which turning the AI add-on on requires.
Responses
Whether a default card is on file
{
"cardOnFile": "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/ai/card-on-file" \
-H "Authorization: Bearer $BEARER_AUTH"const response = await fetch('https://api.clepit.com/v1/tenants/me/ai/card-on-file', {
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/ai/card-on-file'),
headers: {
'Authorization': 'Bearer $bearerAuth',
},
);response = requests.get(
"https://api.clepit.com/v1/tenants/me/ai/card-on-file",
headers={"Authorization": f"Bearer {bearer_auth}"},
)List the members for AI limits
The company's members with their ids, names and emails, and the caller's own id: the ids a member's limit and a member recipient take.
Responses
The members
{
"me": "string",
"members": [
{
"id": "string",
"name?": "string | null",
"email?": "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/ai/members" \
-H "Authorization: Bearer $BEARER_AUTH"const response = await fetch('https://api.clepit.com/v1/tenants/me/ai/members', {
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/ai/members'),
headers: {
'Authorization': 'Bearer $bearerAuth',
},
);response = requests.get(
"https://api.clepit.com/v1/tenants/me/ai/members",
headers={"Authorization": f"Bearer {bearer_auth}"},
)List the roles AI warnings can name
The organisation's roles a limit's warnings can name, each with how many people hold it; heldBy is null when the role holders could not be read. A role reaches everyone who holds it when a warning goes out.
Responses
The roles
[
{
"key": "string",
"heldBy?": "integer | 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/ai/roles" \
-H "Authorization: Bearer $BEARER_AUTH"const response = await fetch('https://api.clepit.com/v1/tenants/me/ai/roles', {
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/ai/roles'),
headers: {
'Authorization': 'Bearer $bearerAuth',
},
);response = requests.get(
"https://api.clepit.com/v1/tenants/me/ai/roles",
headers={"Authorization": f"Bearer {bearer_auth}"},
)Read the AI usage for a month
The company's AI use for one month: the total in tokens and in the money billed, in micros; a row for each member who spent and one for use with no member; totals by surface and by model. The current month also carries each limit with what is used and left, and each member's own limit. Refused with AI_MONTH for a month not written YYYY-MM.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
| month | query | string | The month to read, written YYYY-MM; this month when left out. |
Responses
The month's AI usage
{
"month": "string",
"current": "boolean",
"spend": {
"tokens": "integer",
"micros": "integer"
},
"limits": [
{
"id": "string",
"memberId?": "string | null",
"memberName?": "string | null",
"unit": "string",
"amount": "integer",
"thresholds": [],
"recipients": [
{
"kind": "string",
"value": "string"
}
],
"used": "integer",
"left": "integer"
}
],
"members": [
{
"memberId?": "string | null",
"name?": "string | null",
"email?": "string | null",
"spend": {
"tokens": "integer",
"micros": "integer"
},
"limit?": {
"id": "string",
"memberId?": "string | null",
"memberName?": "string | null",
"unit": "string",
"amount": "integer",
"thresholds": [],
"recipients": [
{
"kind": "string",
"value": "string"
}
],
"used": "integer",
"left": "integer"
},
"departed": "boolean"
}
],
"surfaces": [
{
"key": "string",
"spend": {
"tokens": "integer",
"micros": "integer"
}
}
],
"models": [
{
"key": "string",
"spend": {
"tokens": "integer",
"micros": "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/ai/usage" \
-H "Authorization: Bearer $BEARER_AUTH"const response = await fetch('https://api.clepit.com/v1/tenants/me/ai/usage', {
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/ai/usage'),
headers: {
'Authorization': 'Bearer $bearerAuth',
},
);response = requests.get(
"https://api.clepit.com/v1/tenants/me/ai/usage",
headers={"Authorization": f"Bearer {bearer_auth}"},
)Read a month's own-account seats
The seats a month carries on the organisation's own AI account: its highest seat count while it ran on that account, 0 for a month on clepit's account, and the price per seat of the band that count falls in, in cents. Refused with AI_MONTH for a month not written YYYY-MM.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
| month | query | string | The month to read, written YYYY-MM; this month when left out. |
Responses
The month's seats
{
"month": "string",
"count": "integer",
"priceCents": "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/ai/seats" \
-H "Authorization: Bearer $BEARER_AUTH"const response = await fetch('https://api.clepit.com/v1/tenants/me/ai/seats', {
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/ai/seats'),
headers: {
'Authorization': 'Bearer $bearerAuth',
},
);response = requests.get(
"https://api.clepit.com/v1/tenants/me/ai/seats",
headers={"Authorization": f"Bearer {bearer_auth}"},
)List the months with AI usage
The months the company used AI in, written YYYY-MM, newest first.
Responses
The months with AI usage
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/ai/usage/months" \
-H "Authorization: Bearer $BEARER_AUTH"const response = await fetch('https://api.clepit.com/v1/tenants/me/ai/usage/months', {
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/ai/usage/months'),
headers: {
'Authorization': 'Bearer $bearerAuth',
},
);response = requests.get(
"https://api.clepit.com/v1/tenants/me/ai/usage/months",
headers={"Authorization": f"Bearer {bearer_auth}"},
)Read a year of AI spend by month
A year of the company's AI spend month by month, in tokens and in the money billed, in micros, with each month's seats on its own AI account (0 for a month on clepit's account) and the company's first year. Refused with AI_YEAR for a year before the first one or after this one.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
| year | query | integer | The year to read, such as 2026; this year when left out. |
Responses
The year's AI spend by month
{
"year": "integer",
"firstYear": "integer",
"months": [
{
"month": "string",
"spend": {
"tokens": "integer",
"micros": "integer"
},
"seats": "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/ai/usage/year" \
-H "Authorization: Bearer $BEARER_AUTH"const response = await fetch('https://api.clepit.com/v1/tenants/me/ai/usage/year', {
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/ai/usage/year'),
headers: {
'Authorization': 'Bearer $bearerAuth',
},
);response = requests.get(
"https://api.clepit.com/v1/tenants/me/ai/usage/year",
headers={"Authorization": f"Bearer {bearer_auth}"},
)Turn the AI add-on on
Turns the AI add-on on with the model in the body. From then on the company's AI use is billed per token. Refused with MODEL_UNAVAILABLE for a model the models route does not list, and with PAYMENT_METHOD_REQUIRED when the company has no default card on file.
Responses
The AI add-on settings
{
"enabled": "boolean",
"model?": "string | null",
"enabledAt?": "string | null",
"route": "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/ai/enable" \
-H "Authorization: Bearer $BEARER_AUTH"const response = await fetch('https://api.clepit.com/v1/tenants/me/ai/enable', {
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/ai/enable'),
headers: {
'Authorization': 'Bearer $bearerAuth',
},
);response = requests.post(
"https://api.clepit.com/v1/tenants/me/ai/enable",
headers={"Authorization": f"Bearer {bearer_auth}"},
)Turn the AI add-on off
Turns the AI add-on off, which stops AI for the company. Its model and limits are kept.
Responses
The AI add-on settings
{
"enabled": "boolean",
"model?": "string | null",
"enabledAt?": "string | null",
"route": "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/ai/disable" \
-H "Authorization: Bearer $BEARER_AUTH"const response = await fetch('https://api.clepit.com/v1/tenants/me/ai/disable', {
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/ai/disable'),
headers: {
'Authorization': 'Bearer $bearerAuth',
},
);response = requests.post(
"https://api.clepit.com/v1/tenants/me/ai/disable",
headers={"Authorization": f"Bearer {bearer_auth}"},
)Change the AI model
Changes the model the AI add-on runs. Refused with MODEL_UNAVAILABLE for a model the models route does not list.
Responses
The AI add-on settings
{
"enabled": "boolean",
"model?": "string | null",
"enabledAt?": "string | null",
"route": "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 PUT "https://api.clepit.com/v1/tenants/me/ai/model" \
-H "Authorization: Bearer $BEARER_AUTH"const response = await fetch('https://api.clepit.com/v1/tenants/me/ai/model', {
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/ai/model'),
headers: {
'Authorization': 'Bearer $bearerAuth',
},
);response = requests.put(
"https://api.clepit.com/v1/tenants/me/ai/model",
headers={"Authorization": f"Bearer {bearer_auth}"},
)Remove an AI spend limit
Removes an AI spend limit, so the spend it covered is no longer capped or warned about.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
| id required | path | string | The limit id being removed. |
Responses
Whether a limit was removed
{
"removed": "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/ai/limits/:id" \
-H "Authorization: Bearer $BEARER_AUTH"const response = await fetch('https://api.clepit.com/v1/tenants/me/ai/limits/: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/ai/limits/:id'),
headers: {
'Authorization': 'Bearer $bearerAuth',
},
);response = requests.delete(
"https://api.clepit.com/v1/tenants/me/ai/limits/:id",
headers={"Authorization": f"Bearer {bearer_auth}"},
)Read the own AI account
The organisation's own AI account when it has connected one, on Enterprise: the provider, the key's last four characters, a Model Studio region and workspace where there is one, and who connected it when. Null when AI runs on clepit's account. The key itself is never returned.
Responses
The own AI account, or null
{
"provider": "string",
"hint": "string",
"region?": "string | null",
"workspace?": "string | null",
"connectedAt": "string",
"connectedBy": "string",
"connectedByName?": "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/ai/account" \
-H "Authorization: Bearer $BEARER_AUTH"const response = await fetch('https://api.clepit.com/v1/tenants/me/ai/account', {
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/ai/account'),
headers: {
'Authorization': 'Bearer $bearerAuth',
},
);response = requests.get(
"https://api.clepit.com/v1/tenants/me/ai/account",
headers={"Authorization": f"Bearer {bearer_auth}"},
)Connect the own AI account
Connects the organisation's own AI account, or replaces its key, and runs AI on it with the model in the body after one short request confirms the model. enable also turns AI on. Enterprise only; refused with PAYMENT_METHOD_REQUIRED without a default card on file, MODEL_UNAVAILABLE for a model the account does not answer, and with the provider's refusals. Nothing is kept when a check fails.
Responses
The AI add-on settings
{
"enabled": "boolean",
"model?": "string | null",
"enabledAt?": "string | null",
"route": "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 PUT "https://api.clepit.com/v1/tenants/me/ai/account" \
-H "Authorization: Bearer $BEARER_AUTH"const response = await fetch('https://api.clepit.com/v1/tenants/me/ai/account', {
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/ai/account'),
headers: {
'Authorization': 'Bearer $bearerAuth',
},
);response = requests.put(
"https://api.clepit.com/v1/tenants/me/ai/account",
headers={"Authorization": f"Bearer {bearer_auth}"},
)Remove the own AI account
Removes the organisation's own AI account and its key, and turns AI off; turning it back on runs on clepit's account.
Responses
The AI add-on settings
{
"enabled": "boolean",
"model?": "string | null",
"enabledAt?": "string | null",
"route": "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/ai/account" \
-H "Authorization: Bearer $BEARER_AUTH"const response = await fetch('https://api.clepit.com/v1/tenants/me/ai/account', {
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/ai/account'),
headers: {
'Authorization': 'Bearer $bearerAuth',
},
);response = requests.delete(
"https://api.clepit.com/v1/tenants/me/ai/account",
headers={"Authorization": f"Bearer {bearer_auth}"},
)List the own AI account's models
The models the organisation's own AI account lists that answer text, by id and name. Empty for a provider with no model list, whose model is typed by name. Refused with AI_ACCOUNT_NOT_CONNECTED when no account is connected.
Responses
The account's models
[
{
"id": "string",
"name": "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/ai/account/models" \
-H "Authorization: Bearer $BEARER_AUTH"const response = await fetch('https://api.clepit.com/v1/tenants/me/ai/account/models', {
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/ai/account/models'),
headers: {
'Authorization': 'Bearer $bearerAuth',
},
);response = requests.get(
"https://api.clepit.com/v1/tenants/me/ai/account/models",
headers={"Authorization": f"Bearer {bearer_auth}"},
)Check an AI account's key
Lists the models an AI account offers with the key in the body, and keeps nothing. Enterprise only: refused with FEATURE_NOT_IN_PLAN on any other plan, and with PROVIDER_KEY_REJECTED, PROVIDER_LIMIT_REACHED or PROVIDER_UNAVAILABLE when the provider refuses.
Responses
The account's models
[
{
"id": "string",
"name": "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/ai/account/check" \
-H "Authorization: Bearer $BEARER_AUTH"const response = await fetch('https://api.clepit.com/v1/tenants/me/ai/account/check', {
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/ai/account/check'),
headers: {
'Authorization': 'Bearer $bearerAuth',
},
);response = requests.post(
"https://api.clepit.com/v1/tenants/me/ai/account/check",
headers={"Authorization": f"Bearer {bearer_auth}"},
)Read whether the caller needs onboarding
Answers needed when the caller belongs to no clepit organisation, with the organisations they own elsewhere that have no clepit members yet. owned is null when the login could not be asked.
Responses
Whether onboarding is needed
{
"needed": "boolean",
"owned?": [
{
"orgId": "string",
"name": "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/onboarding" \
-H "Authorization: Bearer $BEARER_AUTH"const response = await fetch('https://api.clepit.com/v1/onboarding', {
method: 'GET',
headers: {
Authorization: `Bearer ${bearerAuth}`,
},
});
const data = await response.json();final response = await http.get(
Uri.parse('https://api.clepit.com/v1/onboarding'),
headers: {
'Authorization': 'Bearer $bearerAuth',
},
);response = requests.get(
"https://api.clepit.com/v1/onboarding",
headers={"Authorization": f"Bearer {bearer_auth}"},
)Create an organisation and its first workspace
Creates an organisation named in the body through the login, seats the caller as its owner, creates the first workspace and makes the organisation the caller's active one. Refused with ORGANISATION_NAME_REQUIRED or WORKSPACE_NAME_REQUIRED for a blank name.
Responses
The organisation
{
"orgId": "string",
"workspaceCreated": "boolean",
"switched": "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/onboarding/organisation" \
-H "Authorization: Bearer $BEARER_AUTH"const response = await fetch('https://api.clepit.com/v1/onboarding/organisation', {
method: 'POST',
headers: {
Authorization: `Bearer ${bearerAuth}`,
},
});
const data = await response.json();final response = await http.post(
Uri.parse('https://api.clepit.com/v1/onboarding/organisation'),
headers: {
'Authorization': 'Bearer $bearerAuth',
},
);response = requests.post(
"https://api.clepit.com/v1/onboarding/organisation",
headers={"Authorization": f"Bearer {bearer_auth}"},
)Use an organisation the caller owns
Brings an organisation the caller owns in another product into clepit, seats the caller as its owner alone, creates the first workspace and makes it the active organisation. Refused with NOT_AN_OWNED_ORG and ORG_ALREADY_HAS_AN_ORGANISATION.
Responses
The organisation
{
"orgId": "string",
"workspaceCreated": "boolean",
"switched": "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/onboarding/adopt" \
-H "Authorization: Bearer $BEARER_AUTH"const response = await fetch('https://api.clepit.com/v1/onboarding/adopt', {
method: 'POST',
headers: {
Authorization: `Bearer ${bearerAuth}`,
},
});
const data = await response.json();final response = await http.post(
Uri.parse('https://api.clepit.com/v1/onboarding/adopt'),
headers: {
'Authorization': 'Bearer $bearerAuth',
},
);response = requests.post(
"https://api.clepit.com/v1/onboarding/adopt",
headers={"Authorization": f"Bearer {bearer_auth}"},
)List the caller's organisations
Every clepit organisation the caller belongs to, ordered by name, with their role in each when it can be read, and the one the sign-in is open in. Answers for a sign-in that names an organisation clepit does not know.
Responses
The caller's organisations
{
"organisations": [
{
"tenantId": "string",
"orgId": "string",
"name": "string",
"role?": "string | null"
}
],
"activeTenantId?": "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/session/organisations" \
-H "Authorization: Bearer $BEARER_AUTH"const response = await fetch('https://api.clepit.com/v1/session/organisations', {
method: 'GET',
headers: {
Authorization: `Bearer ${bearerAuth}`,
},
});
const data = await response.json();final response = await http.get(
Uri.parse('https://api.clepit.com/v1/session/organisations'),
headers: {
'Authorization': 'Bearer $bearerAuth',
},
);response = requests.get(
"https://api.clepit.com/v1/session/organisations",
headers={"Authorization": f"Bearer {bearer_auth}"},
)Open one of the caller's organisations
Asks the login to make the named organisation the sign-in's active one; the client refreshes its session and reloads. Refused with NOT_YOUR_ORGANISATION for an organisation the caller does not belong to.
Responses
The organisation the sign-in now opens
{
"tenantId": "string",
"orgId": "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/session/organisation" \
-H "Authorization: Bearer $BEARER_AUTH"const response = await fetch('https://api.clepit.com/v1/session/organisation', {
method: 'POST',
headers: {
Authorization: `Bearer ${bearerAuth}`,
},
});
const data = await response.json();final response = await http.post(
Uri.parse('https://api.clepit.com/v1/session/organisation'),
headers: {
'Authorization': 'Bearer $bearerAuth',
},
);response = requests.post(
"https://api.clepit.com/v1/session/organisation",
headers={"Authorization": f"Bearer {bearer_auth}"},
)Read an invitation
Names the organisation, the person who sent the invitation and the role it gives, for the person it was sent to. Refused with INVITATION_NOT_FOUND, INVITATION_EXPIRED, INVITATION_REVOKED, INVITATION_ALREADY_ACCEPTED, INVITATION_NOT_FOR_YOU (naming nothing), EMAIL_DOMAIN_NOT_ALLOWED, TENANT_NOT_PROVISIONED and INVITER_CANNOT_GRANT_ROLE.
Responses
The invitation
{
"organisation": "string",
"inviter": "string",
"role": "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/invitations/preview" \
-H "Authorization: Bearer $BEARER_AUTH"const response = await fetch('https://api.clepit.com/v1/invitations/preview', {
method: 'POST',
headers: {
Authorization: `Bearer ${bearerAuth}`,
},
});
const data = await response.json();final response = await http.post(
Uri.parse('https://api.clepit.com/v1/invitations/preview'),
headers: {
'Authorization': 'Bearer $bearerAuth',
},
);response = requests.post(
"https://api.clepit.com/v1/invitations/preview",
headers={"Authorization": f"Bearer {bearer_auth}"},
)Join the organisation an invitation names
Accepts the invitation for the person it was sent to, then asks the login to make its organisation the sign-in's active one. A person who already belongs is answered with the organisation. Refused with the preview's codes.
Responses
The organisation joined
{
"orgId": "string",
"switched": "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/invitations/accept" \
-H "Authorization: Bearer $BEARER_AUTH"const response = await fetch('https://api.clepit.com/v1/invitations/accept', {
method: 'POST',
headers: {
Authorization: `Bearer ${bearerAuth}`,
},
});
const data = await response.json();final response = await http.post(
Uri.parse('https://api.clepit.com/v1/invitations/accept'),
headers: {
'Authorization': 'Bearer $bearerAuth',
},
);response = requests.post(
"https://api.clepit.com/v1/invitations/accept",
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
{
"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"
}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}"},
)Read the tenant's billing standing
Whether the company's bill is paid: good, past_due with the time its team will be suspended, suspended with the time its published pages stop too, or halted once they have. Each carries when the payment failed. Open to every member, and answered while the company is suspended or halted.
Responses
The tenant's billing standing
{
"status": "string",
"suspendsAt?": "string | null",
"haltsAt?": "string | null",
"failedAt?": "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/standing" \
-H "Authorization: Bearer $BEARER_AUTH"const response = await fetch('https://api.clepit.com/v1/tenants/me/billing/standing', {
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/standing'),
headers: {
'Authorization': 'Bearer $bearerAuth',
},
);response = requests.get(
"https://api.clepit.com/v1/tenants/me/billing/standing",
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
{
"tier": "free | pro | business | enterprise",
"cycle": "monthly | annual",
"unitAmount": "integer",
"currency": "string",
"seatCount": "integer",
"total": "integer",
"priceId": "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/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}"},
)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}"},
)List invoices
Cursor-paginated; pass the previous page's cursor as a query parameter.
Responses
A page of invoices
{
"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"
}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
{
"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"
}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
[
{
"id": "string",
"brand": "string",
"last4": "string",
"expMonth": "integer",
"expYear": "integer",
"isDefault": "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/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}"},
)Preview a plan change
Returns the proration for moving to a different tier or cycle, before committing.
Responses
The proration preview
{
"amountDueNow": "integer",
"amountDueNextCycle": "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}"},
)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}"},
)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}"},
)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}"},
)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}"},
)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}"},
)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}"},
)List the plan catalogue
Every clepit plan with its entitlements and prices: the ladder the pricing page and the consoles render. Public, and cacheable for five minutes.
Responses
The plan catalogue
{
"plans": [
{
"tier": "string",
"cycle": "string",
"trialDays": "integer",
"priced": "boolean",
"entitlements": "unknown"
}
]
}The plan catalogue is unavailable
Try it
curl -X GET "https://api.clepit.com/v1/plans"const response = await fetch('https://api.clepit.com/v1/plans', {
method: 'GET',
});
const data = await response.json();final response = await http.get(
Uri.parse('https://api.clepit.com/v1/plans'),
);response = requests.get(
"https://api.clepit.com/v1/plans",
)