---
title: "Mint a short-lived workspace gate code"
method: POST
path: "/workspaces/{slug}/join-code"
---

# Mint a short-lived workspace gate code

`POST /workspaces/{slug}/join-code`

## Request

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

Requires a signed-in user session. The code is for Telegram, Discord or entitlement gate verification and does not create membership by itself.

## Path parameters

- `slug` string, required

## Request body

- object
  - `source` 'telegram' | 'discord' | 'entitlement', required
  - `policyId` string
  - `ttl_seconds` integer

## Response `201`

Workspace join code

- object
  - `workspace` Workspace, required
    - `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
  - `policy` WorkspaceJoinPolicy, required: Workspace join gate metadata. No raw invite code, bot secret, token or external credential is exposed.
    - `id` string, required
    - `workspaceId` string
    - `workspaceSlug` string
    - `kind` 'invite' | 'email_domain' | 'telegram' | 'discord' | 'entitlement' | 'paid_subscription' | 'manual_approval', required
    - `status` 'active' | 'disabled', required
    - `role` 'member' | 'viewer', required
    - `title` string, nullable
    - `instructions` string, nullable
    - `config` object, required
    - `createdAt` string, required
    - `updatedAt` string, required
  - `code` string, required
  - `source` string, required
  - `subject_type` string, required
  - `subject_id` string, required
  - `expires_at` string, date-time, required
  - `next` string, required

## Other responses

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

---

[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)
