diff --git a/fern/assets/invite-email.png b/fern/assets/invite-email.png new file mode 100644 index 0000000..924629c Binary files /dev/null and b/fern/assets/invite-email.png differ diff --git a/fern/docs.yml b/fern/docs.yml index 703633d..345d651 100644 --- a/fern/docs.yml +++ b/fern/docs.yml @@ -72,6 +72,8 @@ navigation: path: ./guides/update-descriptions.mdx - page: Create landscape versions path: ./guides/create-versions.mdx + - page: Invite users + path: ./guides/invite-users.mdx - tab: core_concepts layout: diff --git a/fern/guides/invite-users.mdx b/fern/guides/invite-users.mdx new file mode 100644 index 0000000..5f3bae0 --- /dev/null +++ b/fern/guides/invite-users.mdx @@ -0,0 +1,61 @@ +--- +title: Invite users via API +description: Programmatically invite teammates to your IcePanel organization. +--- + +This guide shows how to invite users to your organization using the API. This is useful for automating onboarding workflows or granting temporary access to external collaborators. + + +Prerequisites: +- IcePanel account +- API key (created from `https://app.icepanel.io/organizations/:organizationId/manage/api-keys`) + + +```bash +export ICEPANEL_API_KEY='your-api-key' +export ICEPANEL_ORGANIZATION_ID='your-organization-id' +``` + +## Steps + + + + Before creating a new invite, check whether the user already has a pending one: + + + + This endpoint returns all invites, including used and revoked ones. An invite is still active if it has no `usedAt` or `revokedAt` field and its `expiresAt` is in the future. + + + + + Send an invite to a user by email. Set `permission` to control their access level (`read`, `write`, `admin`, or `billing`), and `expiresAt` to define how long the invite remains valid. + + + + + Note that invites with `write` or `admin` permission count against your paid seat limit. If you are at capacity, creating one returns a **409** error with `"All organization seats have been assigned"`. + Invites with `read` permission do not count against this limit. [See pricing](https://icepanel.io/pricing) + + + Note that the `createdBy` field in the response will be `"api-key"` when created via API key, **not** a user ID. This is useful for auditing who or what triggered the invite. + + The invited user will receive an email like this: + + IcePanel invite email + + Note the invite `id` in the response if you want to revoke the invite in the next step. + + + + If you need to cancel an invite before it is accepted, revoke it using the invite ID: + + + + The response returns the updated invite object with `revokedAt` and `revokedBy` fields populated. + + + This endpoint is idempotent. Revoking an already-revoked invite will not return an error. Revoked invites remain in the list returned by `GET /users/invites` and are not deleted. + + +