Skip to main content

invites

Creates, updates, deletes, gets or lists an invites resource.

Overview

Nameinvites
TypeResource
Idanthropic_admin.organization.invites

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringID of the Invite.
emailstringEmail of the User being invited.
expires_atstringRFC 3339 datetime string indicating when the Invite expires.
invited_atstringRFC 3339 datetime string indicating when the Invite was created.
rolestringOrganization role of the invited User. (admin, billing, claude_code_user, developer, user)
statusstringStatus of the Invite. (accepted, deleted, expired, pending)
typestringObject type. Always `invite`. (invite)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectinvite_idGet an organization invite by ID.
listselectbefore_id, after_idList pending and historical invites for the organization.
createinsertemail, roleInvite a user to the organization. Invites expire after 21 days.
deletedeleteinvite_idDelete an organization invite.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
invite_idstringID of the Invite.
after_idstringID of the object to use as a cursor for pagination. Returns the page of results immediately after this object.
before_idstringID of the object to use as a cursor for pagination. Returns the page of results immediately before this object.

SELECT examples

Get an organization invite by ID.

SELECT
id,
email,
expires_at,
invited_at,
role,
status,
type
FROM anthropic_admin.organization.invites
WHERE invite_id = '{{ invite_id }}' -- required
;

INSERT examples

Invite a user to the organization. Invites expire after 21 days.

INSERT INTO anthropic_admin.organization.invites (
email,
role
)
SELECT
'{{ email }}' /* required */,
'{{ role }}' /* required */
RETURNING
id,
email,
expires_at,
invited_at,
role,
status,
type
;

DELETE examples

Delete an organization invite.

DELETE FROM anthropic_admin.organization.invites
WHERE invite_id = '{{ invite_id }}' --required
;