Invitations
Overview
The Confident AI SDK exposes every Invitation method on the platform. This page documents how to call these methods in all supported languages. See the introduction to install the SDK and set your API key.
Methods
List Invitations
Lists the invitations to your organization that are still outstanding — those the invitee has not answered, and those they declined. An invitation disappears from this list once it is accepted or revoked. Invitations do not expire on their own, so a pending one stays acceptable until it is revoked or resent. Every entry carries the token from the invitee's invite link, so treat the response as sensitive.
from confident_ai import ConfidentAI
client = ConfidentAI()
result = client.organization.list_invitations()For async mode, call a_list_invitations and await it as shown below:
result = await client.organization.a_list_invitations(...)import { ConfidentAI } from "confident-ai";
const client = new ConfidentAI();
const result = await client.organization.listInvitations();Returns
This method returns an object of type OrganizationInvitationList.
Create Invitations
Invites people to your organization by email, each with a link granting organization access when accepted — organization access only; a project is joined separately. Addresses that already have an invitation, or already belong to a member, are dropped from the batch; if that leaves nothing, the request is refused as a conflict. The Free plan caps members plus invitations at 2. Only the invitations created are returned.
from confident_ai import ConfidentAI
client = ConfidentAI()
result = client.organization.create_invitations(
emails=["jane@acme.com"],
organization_role_id="<ORGANIZATION-ROLE-ID>",
)For async mode, call a_create_invitations and await it as shown below:
result = await client.organization.a_create_invitations(...)Parameters
| Parameter | Type | Description |
|---|---|---|
emails | List[str] | Required. The email addresses to invite, between 1 and 50 of them. Each is trimmed and lowercased, and must be a company address — free and disposable domains are refused. |
organization_role_id | Optional[str] | The id of the organization role every invitee lands on when they accept. Omit it to give them the default Member role. The Owner role cannot be handed out this way. |
import { ConfidentAI } from "confident-ai";
const client = new ConfidentAI();
const result = await client.organization.createInvitations(
["jane@acme.com"],
{ organizationRoleId: "<ORGANIZATION-ROLE-ID>" },
);Parameters
| Parameter | Type | Description |
|---|---|---|
emails | string[] | Required. The email addresses to invite, between 1 and 50 of them. Each is trimmed and lowercased, and must be a company address — free and disposable domains are refused. |
organizationRoleId | string | The id of the organization role every invitee lands on when they accept. Omit it to give them the default Member role. The Owner role cannot be handed out this way. |
Returns
This method returns an object of type OrganizationInvitationList.
Resend Invitation
Emails the invitation again and returns it, resetting it in the process: the status goes back to PENDING, a fresh token is issued, and any link sent earlier stops working. That reset is what revives an invitation the invitee declined. An invitation that was already accepted is reset the same way, mailing the member a link they no longer need without touching the access they have — revoke the invitation or remove the member instead if that is what you meant.
from confident_ai import ConfidentAI
client = ConfidentAI()
result = client.organization.resend_invitation(invitation_id=42)For async mode, call a_resend_invitation and await it as shown below:
result = await client.organization.a_resend_invitation(...)Parameters
| Parameter | Type | Description |
|---|---|---|
invitation_id | str | Required. The id of the organization invitation. |
import { ConfidentAI } from "confident-ai";
const client = new ConfidentAI();
const result = await client.organization.resendInvitation(42);Parameters
| Parameter | Type | Description |
|---|---|---|
invitationId | string | Required. The id of the organization invitation. |
Returns
This method returns an object of type OrganizationInvitation.
Delete Invitation
Deletes the invitation, whatever its status, so its link can no longer be accepted. Only the invitation goes: an invitee who already accepted keeps their organization membership, so revoke access by removing them from the members instead. This cannot be undone — invite the address again to issue a new invitation with a new token.
from confident_ai import ConfidentAI
client = ConfidentAI()
result = client.organization.delete_invitation(invitation_id=42)For async mode, call a_delete_invitation and await it as shown below:
result = await client.organization.a_delete_invitation(...)Parameters
| Parameter | Type | Description |
|---|---|---|
invitation_id | str | Required. The id of the organization invitation. |
import { ConfidentAI } from "confident-ai";
const client = new ConfidentAI();
const result = await client.organization.deleteInvitation(42);Parameters
| Parameter | Type | Description |
|---|---|---|
invitationId | string | Required. The id of the organization invitation. |
Returns
This method returns an object of type InvitationRef.
Types
InvitationRef
Confirmation that the invitation is gone and its link can no longer be accepted.
class InvitationRef:
id: intidintRequired
The id of the invitation, generated by Confident AI.
Example: 42
interface InvitationRef {
id: number;
}idnumberRequired
The id of the invitation, generated by Confident AI.
Example: 42
InvitationStatus
Where an invitation stands: PENDING while its link can still be accepted, ACCEPTED once the invitee joined, DECLINED once they turned it down. A declined invitation cannot be accepted again until it is resent.
class InvitationStatus(Enum):
PENDING = "PENDING"
ACCEPTED = "ACCEPTED"
DECLINED = "DECLINED"enum InvitationStatus {
PENDING = "PENDING",
ACCEPTED = "ACCEPTED",
DECLINED = "DECLINED",
}PENDING · ACCEPTED · DECLINED
OrganizationInvitation
A standing offer of access to your organization. Accepting one makes the invitee an organization member; it grants no access to any project on its own.
class OrganizationInvitation:
id: int
email: str
status: InvitationStatus
created_at: str
organization_role_id: Optional[str] = Field(alias="organizationRoleId")
token: Optional[str]idintRequired
The id of the invitation, generated by Confident AI.
Example: 42
emailstrRequired
The email address the invitation was sent to, lowercased when it was created.
Example: "jane@acme.com"
statusInvitationStatusRequired
See InvitationStatus.
created_atstrRequired
When the invitation was issued, as an ISO 8601 datetime. Resending an invitation stamps this again.
Example: "2025-01-15T10:30:00+00:00"
organization_role_idOptional[str]Required
The id of the organization role the invitee lands on when they accept, or null to give them the default Member role.
Example: "<ORGANIZATION-ROLE-ID>"
tokenOptional[str]Required
The token embedded in the invitee's invite link, returned unmasked. Anyone holding it can accept the invitation as the invited email address, so treat it as a secret. It is replaced whenever the invitation is resent, which invalidates any link sent earlier. It is null when the invitation has no token stored, in which case its link only points the invitee at signup.
Example: "<INVITATION-TOKEN>"
interface OrganizationInvitation {
id: number;
email: string;
status: InvitationStatus;
created_at: string;
organizationRoleId: string | null;
token: string | null;
}idnumberRequired
The id of the invitation, generated by Confident AI.
Example: 42
emailstringRequired
The email address the invitation was sent to, lowercased when it was created.
Example: "jane@acme.com"
statusInvitationStatusRequired
See InvitationStatus.
created_atstringRequired
When the invitation was issued, as an ISO 8601 datetime. Resending an invitation stamps this again.
Example: "2025-01-15T10:30:00+00:00"
organizationRoleIdstring | nullRequired
The id of the organization role the invitee lands on when they accept, or null to give them the default Member role.
Example: "<ORGANIZATION-ROLE-ID>"
tokenstring | nullRequired
The token embedded in the invitee's invite link, returned unmasked. Anyone holding it can accept the invitation as the invited email address, so treat it as a secret. It is replaced whenever the invitation is resent, which invalidates any link sent earlier. It is null when the invitation has no token stored, in which case its link only points the invitee at signup.
Example: "<INVITATION-TOKEN>"
OrganizationInvitationList
Every organization invitation that has not been accepted or revoked. Accepted invitations are left out, since the invitee is an organization member by then.
class OrganizationInvitationList:
invitations: List[OrganizationInvitation]invitationsList[OrganizationInvitation]Required
The organization's pending and declined invitations.
interface OrganizationInvitationList {
invitations: OrganizationInvitation[];
}invitationsOrganizationInvitation[]Required
The organization's pending and declined invitations.
Last updated on