createInvite
# createInvite
POST
/invites
const url = 'http://localhost:8080/api/v1/invites';const options = { method: 'POST', headers: {cookie: 'hs_session=<hs_session>', 'Content-Type': 'application/json'}, body: '{"role":"member","expiresInDays":7,"maxUses":1}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url http://localhost:8080/api/v1/invites \ --header 'Content-Type: application/json' \ --cookie hs_session=<hs_session> \ --data '{ "role": "member", "expiresInDays": 7, "maxUses": 1 }'Members can invite viewers only. Owners can invite members.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
role
required
string
expiresInDays
integer
maxUses
integer
Responses
Section titled “Responses”Invite created. code and url are shown once.
Media typeapplication/json
object
id
required
string
role
required
string
code
Only on create.
string
url
Only on create.
string format: uri
qrPayload
Only on create.
string
expiresAt
required
string format: date-time
maxUses
required
integer
uses
required
integer
createdAt
required
string format: date-time
Examples
Exampleseed
Derived from fixtures/seed.json.
{ "code": "H7KM29QZ", "createdAt": "2026-10-16T09:00:00.000Z", "expiresAt": "2026-10-24T09:00:00.000Z", "id": "inv_01j9a1b2c3d4e5f6g7h8j9k00p", "maxUses": 1, "qrPayload": "http://localhost:5173/invite/H7KM29QZ", "role": "viewer", "url": "http://localhost:5173/invite/H7KM29QZ", "uses": 0}Role or scope does not allow this.
Media typeapplication/problem+json
object
type
required
string format: uri
title
required
string
status
required
integer
code
required
string
i18nKey
string
detail
string
fields
Array<object>
object
path
required
string
code
required
string
i18nKey
string
Example generated
{ "type": "https://example.com", "title": "example", "status": 1, "code": "example", "i18nKey": "example", "detail": "example", "fields": [ { "path": "example", "code": "example", "i18nKey": "example" } ]}