---
title: "Enroll and mint a workshop bearer code"
method: POST
path: "/api/workshop/enroll"
tags: ["workshop", "browser-session"]
---

# Enroll and mint a workshop bearer code

`POST /api/workshop/enroll`

## Request

- Base URL: `https://www.immersivecommons.com`
- URL: `https://www.immersivecommons.com/api/workshop/enroll`
- Auth: API key in cookie `__session`

Clerk-session only. IDEMPOTENT: re-calling with the same session returns the same enrollment record with `fresh:false`. Mints a 6-char bearer code, a stable slug, and assigns one skill round-robin from the enrollment ordinal. The slug names the attendee's hosted A2A endpoint paths. The returned `enrollment.code` IS the bearer for every other workshop route - treat it as a secret.

## Request body

- WorkshopEnrollRequest
  - `display_name` string: Optional. Falls back to the signed-in identity.

## Response `200`

The enrollment plus its A2A URLs.

- WorkshopEnrollResponse
  - `ok` boolean, required
  - `enrollment` WorkshopEnrollment, required: One attendee's enrollment. `code` IS the bearer for every other workshop route — treat it as a secret.
    - `code` string: 6-char bearer code.
    - `slug` string: Stable `agent-<code>` slug that names the attendee's hosted A2A paths.
    - `display_name` string
    - `skill_id` string: Assigned round-robin from the enrollment ordinal.
    - `enrolled_at` string, date-time
  - `fresh` boolean, required: false means this session was already enrolled and the SAME record came back.
  - `agent_card_url` string
  - `jsonrpc_url` string

## Other responses

- `401`: Not signed in.
- `500`: KV write failed.

---

[API](https://skmtc.dev/immersivecommons/apis/immersive-commons-agent-rest-api.md) · [All operations](https://skmtc.dev/immersivecommons/apis/immersive-commons-agent-rest-api/llms.txt) · [OpenAPI document](https://skmtc.dev/immersivecommons/apis/immersive-commons-agent-rest-api/revisions/be67c1f67c27?raw)
