Create
organizations.invitations.create(strorganization_id, InvitationCreateParams**kwargs) -> Invitation
POST/organizations/{organization_id}/invitations
Create an invitation to join an organization
Parameters
organization_id: str
Organization ID or label identifier
minLength1
maxLength255
email: str
Email address to invite
formatemail
x_client_request_id: Optional[str]
formatuuid
Returns
Create
from keycardai_api import KeycardAPI
client = KeycardAPI()
invitation = client.organizations.invitations.create(
organization_id="x",
email="dev@stainless.com",
role="org_admin",
)
print(invitation.id){
"id": "ab3def8hij2klm9opq5rst7uvw",
"created_at": "2019-12-27T18:11:19.117Z",
"created_by": "ab3def8hij2klm9opq5rst7uvw",
"email": "dev@stainless.com",
"expires_at": "2019-12-27T18:11:19.117Z",
"organization_id": "ab3def8hij2klm9opq5rst7uvw",
"role": "org_admin",
"status": "pending",
"updated_at": "2019-12-27T18:11:19.117Z",
"permissions": {
"organizations": {
"read": true,
"update": true
},
"users": {
"read": true,
"list": true
}
}
}Returns Examples
{
"id": "ab3def8hij2klm9opq5rst7uvw",
"created_at": "2019-12-27T18:11:19.117Z",
"created_by": "ab3def8hij2klm9opq5rst7uvw",
"email": "dev@stainless.com",
"expires_at": "2019-12-27T18:11:19.117Z",
"organization_id": "ab3def8hij2klm9opq5rst7uvw",
"role": "org_admin",
"status": "pending",
"updated_at": "2019-12-27T18:11:19.117Z",
"permissions": {
"organizations": {
"read": true,
"update": true
},
"users": {
"read": true,
"list": true
}
}
}