---
title: "Generate an invite code for the authenticated user"
method: GET
path: "/v2/workspaces/members/code"
tags: ["Workspaces"]
---

# Generate an invite code for the authenticated user

`GET /v2/workspaces/members/code`

Generates a short-lived (5 minutes) invite code bound to the authenticated user's identity. A workspace owner can then call `POST /v2/workspaces/members` with this code to add the user as a member.

Rate limited to 1 code every 5 minutes per user.

## Response `200`

Invite code generated.

- object
  - `status` 'success', required
  - `response` object, required
    - `code` string, required

## Other responses

- `401` — The Authorization header is missing, malformed, or the credentials are not valid.
- `429` — The endpoint enforces its own rate limit and the caller hit the cooldown.
- `500` — Persisting the code in cache failed.

---

[API](https://skmtc.dev/squarecloud/apis/square-cloud-api.md) · [All operations](https://skmtc.dev/squarecloud/apis/square-cloud-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/squarecloud/square-cloud-api/revisions/54b7733a6b95/schema)
