Auth API reference

Auth API · Consumer-Me

post/{app_slug}/v1/me/tenant-invites/acceptAuth

Accept a tenant invite as the signed-in EndUser

Adds the caller to the invited tenant with the role the invite names, and consumes the invite. Requires the invited address to be one of the caller's own VERIFIED email contacts in this app — holding the code is not sufficient, because whoever minted the invite also holds it, and an unverified contact is not proof of owning the address. A refused accept leaves the invite redeemable.

Path parameters

app_slug*string

Slug of the app.

Request body

code*string

Tenant invite code (`tinv_…`) from the invitation email. Must have been issued to an email address this account already owns in this app.

Example: "tinv_9dK2mQ7pR4vXbN1sT6yZ0hLcJeW3fAgU"

Response · 200

tenant_id*string

Tenant the caller just joined.

role_id*string

Id of the role.

role_name*string

Name of the role.

Example: "member"

membership_id*string

The new `tenant_membership` row id.

Example

Request

POST https://api.auth.productcraft.co/{app_slug}/v1/me/tenant-invites/accept
Authorization: Bearer YOUR_TOKEN
Content-Type: application/json

{
  "code": "tinv_9dK2mQ7pR4vXbN1sT6yZ0hLcJeW3fAgU"
}

Response

{
  "tenant_id": "string",
  "role_id": "string",
  "role_name": "member",
  "membership_id": "string"
}