---
title: "Create a workspace invite code"
method: POST
path: "/workspaces/{slug}/invites"
---

# Create a workspace invite code

`POST /workspaces/{slug}/invites`

## Request

- Base URL: `https://superskill.sh/api`
- URL: `https://superskill.sh/api/workspaces/{slug}/invites`
- Auth: HTTP bearer

Requires invite:write/member:write token scope or owner/admin member role. The raw code is returned once; SuperSkill stores only a hash.

## Path parameters

- `slug` string, required

## Request body

- object
  - `role` 'member' | 'viewer'
  - `maxUses` integer
  - `expiresInSeconds` integer
  - `email` string, email

## Response `201`

Workspace invite code

- object
  - `workspace` Workspace
    - `slug` string, required
    - `name` string, required
    - `type` 'company' | 'community' | 'team' | 'course' | 'agency' | 'chat', required
    - `visibility` 'private' | 'invite_only' | 'gated' | 'public' | 'unlisted', required
    - `plan` 'free' | 'team' | 'enterprise', required
    - `description` string, nullable
    - `avatarUrl` string, nullable
  - `invite` WorkspaceInvite: Public invite metadata. The stored code hash is intentionally not exposed.
    - `id` string
    - `workspaceId` string
    - `workspaceSlug` string
    - `email` string, nullable
    - `role` 'owner' | 'admin' | 'moderator' | 'publisher' | 'member' | 'viewer', required
    - `maxUses` integer, nullable
    - `usesCount` integer, required
    - `expiresAt` string, nullable
    - `createdBy` string, nullable
    - `createdAt` string, required
    - `revokedAt` string, nullable
  - `code` string
  - `shareUrl` string, uri: Crawler-visible workspace preview URL. The raw invite code is present only in the URL fragment.
  - `next` string

## Other responses

- `400`: Bad request
- `401`: Authorization required
- `403`: Authorization was provided but is not allowed for this action
- `404`: Resource not found

---

[API](https://skmtc.dev/superskill/apis/superskill-api.md) · [All operations](https://skmtc.dev/superskill/apis/superskill-api/llms.txt) · [OpenAPI document](https://skmtc.dev/superskill/apis/superskill-api/revisions/ced2d2d1f217?raw)
