# at.happyproto.actor.acceptInvite

> Published by [happyproto.at](https://lexicon.garden/identity/did:plc:mo7vq4jbioxwafy5zkcc3eux)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:mo7vq4jbioxwafy5zkcc3eux/at.happyproto.actor.acceptInvite)
- [Documentation](https://lexicon.garden/lexicon/did:plc:mo7vq4jbioxwafy5zkcc3eux/at.happyproto.actor.acceptInvite/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:mo7vq4jbioxwafy5zkcc3eux/at.happyproto.actor.acceptInvite/examples)

## Definitions

### `at.happyproto.actor.acceptInvite`

**Type**: `procedure`

Redeem an invite from admin.createInvites: the caller joins the customers space with read access, and the address the invite went to is paired with the caller's account. Redeeming as an account that is already a customer succeeds and spends nothing. Any signed-in account may call this; the token is the authority.

#### Input

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `idempotencyKey` | `string` | Yes | A UUID, new for each attempt; a retry reuses it. |
| `token` | `string` | Yes |  |

#### Output

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `isCustomer` | `boolean` | Yes | Always true on success. |
| `joined` | `boolean` | Yes | Whether this call made the caller a customer. False when they already were, in which case the invite was not spent. |

#### Errors

- **AuthRequired**: This endpoint requires an authenticated caller.
- **InvalidRequest**: token is missing or malformed, or idempotencyKey is not a UUID.
- **InvalidInvite**: No invite has this token, or it is not an invite to the customers space.
- **InviteUsed**: The invite has already been redeemed, or was revoked.
- **InviteExpired**: The invite has expired.
- **Upstream**: The customers space is not configured, or the invite could not be redeemed.

## Raw Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "Redeem an invite from admin.createInvites: the caller joins the customers space with read access, and the address the invite went to is paired with the caller's account. Redeeming as an account that is already a customer succeeds and spends nothing. Any signed-in account may call this; the token is the authority.",
      "errors": [
        {
          "description": "This endpoint requires an authenticated caller.",
          "name": "AuthRequired"
        },
        {
          "description": "token is missing or malformed, or idempotencyKey is not a UUID.",
          "name": "InvalidRequest"
        },
        {
          "description": "No invite has this token, or it is not an invite to the customers space.",
          "name": "InvalidInvite"
        },
        {
          "description": "The invite has already been redeemed, or was revoked.",
          "name": "InviteUsed"
        },
        {
          "description": "The invite has expired.",
          "name": "InviteExpired"
        },
        {
          "description": "The customers space is not configured, or the invite could not be redeemed.",
          "name": "Upstream"
        }
      ],
      "input": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "idempotencyKey": {
              "description": "A UUID, new for each attempt; a retry reuses it.",
              "type": "string"
            },
            "token": {
              "maxLength": 128,
              "type": "string"
            }
          },
          "required": [
            "token",
            "idempotencyKey"
          ],
          "type": "object"
        }
      },
      "output": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "isCustomer": {
              "description": "Always true on success.",
              "type": "boolean"
            },
            "joined": {
              "description": "Whether this call made the caller a customer. False when they already were, in which case the invite was not spent.",
              "type": "boolean"
            }
          },
          "required": [
            "isCustomer",
            "joined"
          ],
          "type": "object"
        }
      },
      "type": "procedure"
    }
  },
  "id": "at.happyproto.actor.acceptInvite",
  "lexicon": 1
}
```
