invitations
Creates, updates, deletes, gets or lists an invitations resource.
Overview
| Name | invitations |
| Type | Resource |
| Id | clickhouse.members.invitations |
Fields
The following fields are returned by SELECT queries:
- get
- list
| Name | Datatype | Description |
|---|---|---|
id | string (uuid) | Unique invitation ID. |
assigned_roles | array | Custom roles and System roles that will be assigned to the user when they accept the invitation (wire: assignedRoles) |
created_at | string (date-time) | Invitation creation timestamp. ISO-8601. (wire: createdAt) |
email | string (email) | Email of the invited user. Only a user with this email can join using the invitation. The email is stored in a lowercase form. |
expire_at | string (date-time) | Timestamp the invitation expires. ISO-8601. (wire: expireAt) |
role | string | DEPRECATED. Use assignedRoles instead. Role of the invited user in the organization. For organizations that have migrated to custom roles, this field is frozen at the pre-migration value and does not reflect the role assignment that will be applied. (admin, developer) |
| Name | Datatype | Description |
|---|---|---|
id | string (uuid) | Unique invitation ID. |
assigned_roles | array | Custom roles and System roles that will be assigned to the user when they accept the invitation (wire: assignedRoles) |
created_at | string (date-time) | Invitation creation timestamp. ISO-8601. (wire: createdAt) |
email | string (email) | Email of the invited user. Only a user with this email can join using the invitation. The email is stored in a lowercase form. |
expire_at | string (date-time) | Timestamp the invitation expires. ISO-8601. (wire: expireAt) |
role | string | DEPRECATED. Use assignedRoles instead. Role of the invited user in the organization. For organizations that have migrated to custom roles, this field is frozen at the pre-migration value and does not reflect the role assignment that will be applied. (admin, developer) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | invitation_id, organization_id | Returns details for a single organization invitation. | |
list | select | organization_id | Returns list of all organization invitations. | |
create | insert | organization_id | Creates organization invitation. | |
delete | delete | invitation_id, organization_id | Deletes a single organization invitation. |
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.
| Name | Datatype | Description |
|---|---|---|
invitation_id | string (uuid) | ID of the requested organization. (wire: invitationId) |
organization_id | string | ClickHouse Cloud organization ID. Resolved from the CLICKHOUSE_ORG_ID environment variable when it is set (x-stackQL-envVar); otherwise it must be supplied on every query as WHERE organization_id = <uuid>. A WHERE value always takes precedence over the environment. (x-stackQL-envVar: CLICKHOUSE_ORG_ID) |
SELECT examples
- get
- list
Returns details for a single organization invitation.
SELECT
id,
assigned_roles,
created_at,
email,
expire_at,
role
FROM clickhouse.members.invitations
WHERE invitation_id = '{{ invitation_id }}' -- required
AND organization_id = '{{ organization_id }}' -- required unless CLICKHOUSE_ORG_ID is set
;
Returns list of all organization invitations.
SELECT
id,
assigned_roles,
created_at,
email,
expire_at,
role
FROM clickhouse.members.invitations
WHERE organization_id = '{{ organization_id }}' -- required unless CLICKHOUSE_ORG_ID is set
;
INSERT examples
- create
- Manifest
Creates organization invitation.
INSERT INTO clickhouse.members.invitations (
email,
role,
assigned_role_ids,
organization_id
)
SELECT
'{{ email }}',
'{{ role }}',
'{{ assigned_role_ids }}',
'{{ organization_id }}'
RETURNING
request_id,
result,
status
;
# Description fields are for documentation purposes
- name: invitations
props:
- name: organization_id
value: "{{ organization_id }}"
description: Required parameter for the invitations resource.
- name: email
value: "{{ email }}"
description: |
Email of the invited user. Only a user with this email can join using the invitation. The email is stored in a lowercase form.
- name: role
value: "{{ role }}"
description: |
DEPRECATED. Use `assignedRoleIds` instead. Role to assign to the invited user in the organization.
valid_values: ['admin', 'developer']
- name: assigned_role_ids
value:
- "{{ assigned_role_ids }}"
description: |
List of role IDs to assign to the invited user when they accept the invitation
DELETE examples
- delete
Deletes a single organization invitation.
DELETE FROM clickhouse.members.invitations
WHERE invitation_id = '{{ invitation_id }}' --required
AND organization_id = '{{ organization_id }}' --required unless CLICKHOUSE_ORG_ID is set
;