Launch Week 3: Five days of launches

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 this project that are still outstanding — those the invitee has not answered, and those they declined. An invitation drops off this list once it is accepted or revoked, and invitations do not expire on their own. Every entry carries the token from the invitee's invite link, so treat the response as sensitive. Invitations to the organization as a whole are listed separately.

from confident_ai import ConfidentAI

client = ConfidentAI()

project = client.project(project_id="<PROJECT-ID>")
result = project.list_invitations()

For async mode, call a_list_invitations and await it as shown below:

result = await project.a_list_invitations(...)

Returns

This method returns an object of type ProjectInvitationList.

Create Invitations

Invites people to this project by email, each with a link. Accepting can grow the organization too, not just the project. Addresses that already have an invitation to this project, or already belong to it, are dropped from the batch; if that leaves nothing, the request is refused as a conflict. The Free plan caps the organization's members plus invitations at 2. Only the invitations created are returned.

from confident_ai import ConfidentAI

client = ConfidentAI()

project = client.project(project_id="<PROJECT-ID>")
result = project.create_invitations(
    emails=["jane@acme.com"],
    project_role_id="<PROJECT-ROLE-ID>",
)

For async mode, call a_create_invitations and await it as shown below:

result = await project.a_create_invitations(...)

Parameters

ParameterTypeDescription
emailsList[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.
project_role_idOptional[str]The id of the project 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 ProjectInvitationList.

Resend Invitation

Emails the project 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()

project = client.project(project_id="<PROJECT-ID>")
result = project.resend_invitation(invitation_id=42)

For async mode, call a_resend_invitation and await it as shown below:

result = await project.a_resend_invitation(...)

Parameters

ParameterTypeDescription
invitation_idstrRequired. The id of the project invitation.

Returns

This method returns an object of type ProjectInvitation.

Delete Invitation

Deletes the project invitation, whatever its status, so its link can no longer be accepted. Only the invitation goes: an invitee who already accepted keeps their place in the project and the organization, so revoke access by removing them from the project's 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()

project = client.project(project_id="<PROJECT-ID>")
result = project.delete_invitation(invitation_id=42)

For async mode, call a_delete_invitation and await it as shown below:

result = await project.a_delete_invitation(...)

Parameters

ParameterTypeDescription
invitation_idstrRequired. The id of the project invitation.

Returns

This method returns an object of type InvitationRef.

Methods (Stateless)

These methods take every argument themselves, so a caller reaches them through client.projects without opening a Project first.

List Invitations

Lists the invitations to this project that are still outstanding — those the invitee has not answered, and those they declined. An invitation drops off this list once it is accepted or revoked, and invitations do not expire on their own. Every entry carries the token from the invitee's invite link, so treat the response as sensitive. Invitations to the organization as a whole are listed separately.

from confident_ai import ConfidentAI

client = ConfidentAI()

result = client.projects.list_invitations(project_id="<PROJECT-ID>")

For async mode, call a_list_invitations and await it as shown below:

result = await client.projects.a_list_invitations(...)

Parameters

ParameterTypeDescription
project_idstrRequired. The id of the project, which must belong to your organization.

Returns

This method returns an object of type ProjectInvitationList.

Create Invitations

Invites people to this project by email, each with a link. Accepting can grow the organization too, not just the project. Addresses that already have an invitation to this project, or already belong to it, are dropped from the batch; if that leaves nothing, the request is refused as a conflict. The Free plan caps the organization's members plus invitations at 2. Only the invitations created are returned.

from confident_ai import ConfidentAI

client = ConfidentAI()

result = client.projects.create_invitations(
    project_id="<PROJECT-ID>",
    emails=["jane@acme.com"],
    project_role_id="<PROJECT-ROLE-ID>",
)

For async mode, call a_create_invitations and await it as shown below:

result = await client.projects.a_create_invitations(...)

Parameters

ParameterTypeDescription
project_idstrRequired. The id of the project, which must belong to your organization.
emailsList[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.
project_role_idOptional[str]The id of the project 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 ProjectInvitationList.

Resend Invitation

Emails the project 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.projects.resend_invitation(
    project_id="<PROJECT-ID>",
    invitation_id=42,
)

For async mode, call a_resend_invitation and await it as shown below:

result = await client.projects.a_resend_invitation(...)

Parameters

ParameterTypeDescription
project_idstrRequired. The id of the project, which must belong to your organization.
invitation_idstrRequired. The id of the project invitation.

Returns

This method returns an object of type ProjectInvitation.

Delete Invitation

Deletes the project invitation, whatever its status, so its link can no longer be accepted. Only the invitation goes: an invitee who already accepted keeps their place in the project and the organization, so revoke access by removing them from the project's 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.projects.delete_invitation(
    project_id="<PROJECT-ID>",
    invitation_id=42,
)

For async mode, call a_delete_invitation and await it as shown below:

result = await client.projects.a_delete_invitation(...)

Parameters

ParameterTypeDescription
project_idstrRequired. The id of the project, which must belong to your organization.
invitation_idstrRequired. The id of the project 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: int

idintRequired

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"

PENDING · ACCEPTED · DECLINED

ProjectInvitation

A standing offer of access to one project. Accepting one adds the invitee to the project and, if they are not in it yet, to the organization the project belongs to.

class ProjectInvitation:
    id: int
    email: str
    status: InvitationStatus
    created_at: str
    project_role_id: Optional[str] = Field(alias="projectRoleId")
    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

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"

project_role_idOptional[str]Required

The id of the project role the invitee lands on when they accept, or null to give them the default Member role.

Example: "<PROJECT-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>"

ProjectInvitationList

Every invitation to this project that has not been accepted or revoked. Accepted invitations are left out, since the invitee is a project member by then.

class ProjectInvitationList:
    invitations: List[ProjectInvitation]

invitationsList[ProjectInvitation]Required

The project's pending and declined invitations.

See ProjectInvitation.

Building a production pipeline?Design a scalable API workflow for evals, datasets, traces, and promptsTalk to an engineer

Last updated on

Built byConfident AI