> ## Documentation Index
> Fetch the complete documentation index at: https://docs.squarecloud.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Invite Code

> Get your invite code to join a workspace.

<ParamField header="Authorization" type="string" placeholder="API Key" required>
  The API key for your account. You can find this in your [account settings](https://squarecloud.app/en/account/security).
</ParamField>

Generates a short-lived invite code tied to the authenticated user's identity, not to any specific workspace. The user who wants to join shares this code out-of-band (chat, email) with a workspace owner, who then submits it via [Invite Member](/en/api-reference/endpoint/workspace/members/invite) along with the role to grant.

The code expires 5 minutes after generation and is single-use: it is invalidated as soon as it is redeemed. Request a new one if it expires before the owner adds you. Rate limited to 1 code every 5 minutes per user.

### Response

<ResponseField name="status" type="string">
  Indicates whether the call was successful.. `success` if successful, `error` if not.
</ResponseField>

<ResponseField name="code" type="string">
  Your workspace invite code.
</ResponseField>

<ResponseExample>
  ```json theme={null}
  {
    "status": "success",
    "code": "9c1a499e623d2410226f1ecdc7e6daaec2fc6704"
  }
  ```
</ResponseExample>

### Common errors

| Code                    | HTTP | Meaning                                          |
| ----------------------- | ---- | ------------------------------------------------ |
| `INTERNAL_SERVER_ERROR` | 500  | The invite code could not be persisted to cache. |
