---
title: "Create an invite code"
method: POST
path: "/api/invites"
tags: ["Sharing"]
---

# Create an invite code

`POST /api/invites`

## Request

- Base URL: `https://trvlrr.app`
- URL: `https://trvlrr.app/api/invites`
- Auth: HTTP bearer

kind=member adds someone to the whole account (needs a free seat on the plan: 1 on Free, 2 on Plus); kind=trip shares one trip as editor or viewer. The code is redeemed with POST /api/invites/redeem.

## Request body

- InviteCreate
  - `kind` 'member' | 'trip', required: member shares the whole account; trip shares one trip.
  - `member_role` 'co_admin' | 'member': For kind=member.
  - `trip_id` string: For kind=trip.
  - `trip_role` 'editor' | 'viewer': For kind=trip.
  - `person_id` string: Link the redeemer to this person in the account.
  - `invited_name` string: Who the code is for, for the list.

## Response `201`

The code to pass on.

- InviteCode
  - `code` string, required: The 8-character invite code.

## Other responses

- `400`: The request is malformed or fails validation.
- `401`: No usable credential: a Clerk session token, a device token or an OAuth access token is required.
- `402`: Trvlrr Plus is required, or this month's AI allowance is used up.
- `403`: The caller may not do this to this account or trip.
- `404`: No such thing, or not one the caller can see.

---

[API](https://skmtc.dev/trvlrr/apis/trvlrr-api.md) · [All operations](https://skmtc.dev/trvlrr/apis/trvlrr-api/llms.txt) · [OpenAPI document](https://skmtc.dev/trvlrr/apis/trvlrr-api/revisions/ea024946b293?raw)
