Patricia Invitations API
The invitations API from Patricia — 2 operation(s) for invitations.
The invitations API from Patricia — 2 operation(s) for invitations.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/patricia-app:patricia-app-invitations-api"
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: Patricia Invitations API
version: 0.1.0
tags:
- name: Invitations
paths:
/v1/invitations/previews:
post:
tags:
- Invitations
summary: Preview an invitation
operationId: preview_invitation_v1_invitations_previews_post
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/InvitationPreviewRequest'
required: true
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/InvitationPreviewResponse'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/v1/invitations/{token}/accept:
post:
tags:
- Invitations
summary: Accept an invitation
description: 'Accept a workspace invitation token and receive a session token pair.
The raw token from the invitation email is the credential for the ordinary
case: an invitee with no existing account accepts anonymously and lands
logged in (access + refresh tokens) scoped to the invitation''s tenant with
the invited role. An ``Authorization`` header is optional, and needed only
to complete the one case below that a token alone cannot: POST anonymously
first, and send the bearer only if this endpoint asks for it.
Errors:
- **404**: unknown token.
- **400**: expired or revoked invitation.
- **409**: invitation already accepted, the workspace membership could not be
linked to the account that accepted it, or the workspace has no active owner and
the invitation would bring back its last owner row with a lower role
(``errors[0].type`` is ``last_owner``). The second is not retryable by the
invitee: the acceptance is rolled back and an admin has to sort the membership
out, most often because that person already belongs to this workspace under
another address. The third is rolled back too and the invitation stays pending:
the workspace needs an owner restored, which Patricia support escalates.
- **401** ``INVITATION_SIGN_IN_REQUIRED``: the invited address already has an
account. Sign in, then POST this endpoint again with the bearer token; the
invitation is untouched and still usable.
- **403** ``INVITATION_WRONG_ACCOUNT``: a bearer was sent, but it is signed in
as somebody other than the invited address''s owner — most often a forwarded
link. Sign in as the invited address and retry. The invitation is untouched,
and the message deliberately does not say who it was for.
- **403** ``FORBIDDEN``: every other refusal on this route — the account needs
recovery, the account can no longer be used, the invitation went to a secondary
address rather than the account''s main one, the two identity planes disagree
about who is joining, or the membership did not come out active. The invitation
stays pending in all of them. They share the generic code on purpose: the
dashboard shows the message, and there is no action the invitee can take that a
distinct code would unlock. Deliberately not enumerated in the response
description — a count there goes stale the first time one is added.'
operationId: accept_invitation_v1_invitations__token__accept_post
security:
- HTTPBearer: []
- {}
parameters:
- name: token
in: path
required: true
schema:
type: string
description: The raw invitation token received via email
title: Token
description: The raw invitation token received via email
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/TokenResponse'
'401':
description: '`INVITATION_SIGN_IN_REQUIRED` — the invited address already has an account. Sign in and POST this endpoint again with the bearer token; nothing was consumed.'
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'403':
description: '`INVITATION_WRONG_ACCOUNT` — a bearer was sent, but it belongs to someone other than the invited address''s owner. Sign in as the invited address and retry; nothing was consumed. Every OTHER 403 on this route carries the generic `FORBIDDEN` code, is not retryable by the invitee, and needs an admin; the message says which case it is. The invitation stays pending in all of them.'
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'409':
description: '`CONFLICT` — the invitation was already accepted, the workspace membership could not be linked to the account that accepted it, or the workspace has no active owner and the invitation would bring back its last owner row with a lower role (`errors[0].type` is `last_owner`). The second is not retryable: the acceptance is rolled back and an admin has to sort the membership out, most often because that person already belongs to this workspace under another address. The third is rolled back too and the invitation stays pending: the workspace needs an owner restored, which Patricia support escalates.'
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
components:
schemas:
ValidationError:
properties:
loc:
items:
anyOf:
- type: string
- type: integer
type: array
title: Location
msg:
type: string
title: Message
type:
type: string
title: Error Type
input:
title: Input
ctx:
type: object
title: Context
type: object
required:
- loc
- msg
- type
title: ValidationError
SignInSetupMethod:
properties:
code:
type: string
title: Code
label:
type: string
title: Label
available:
type: boolean
title: Available
reason:
anyOf:
- type: string
- type: 'null'
title: Reason
action:
type: string
enum:
- provider
- first_password
- email_password
title: Action
type: object
required:
- code
- label
- available
- action
title: SignInSetupMethod
LandingHint:
type: string
enum:
- pending_invitation
- diverted_unknown_workspace
title: LandingHint
description: 'A non-authorization hint explaining WHY a session landed where it did.
The dashboard reads it to show the right next step instead of a bare landing. It never grants
access: the token''s tenant claim (or its absence) is the sole authority. Two values, and they
differ in whether the session has a workspace at all:
``PENDING_INVITATION`` lands TENANT-LESS — a returning user with at least one pending invitation
and no active available home. It is NOT "only pending memberships": the branch is chosen on
``has_pending`` before the deactivated/unavailable fallback, so a user holding a pending invite
alongside deactivated or unavailable ones lands here too. The SSO guard declines to mint an empty
duplicate tenant, and the hint points them at accepting the invite / signing in from the
connected workspace.
``DIVERTED_UNKNOWN_WORKSPACE`` lands WITH an active workspace — a returning user who signed in
from a chat workspace Patricia does not know. The guard diverts them to their existing primary
workspace rather than minting a second one, and the hint is what lets the dashboard say so and
offer a deliberate way to create a separate workspace instead of failing silently.'
ErrorResponse:
properties:
code:
type: string
title: Code
message:
type: string
title: Message
errors:
anyOf:
- items:
additionalProperties: true
type: object
type: array
- type: 'null'
title: Errors
type: object
required:
- code
- message
title: ErrorResponse
description: Standard error envelope, matching exception handler output.
InvitationPreviewRequest:
properties:
token:
type: string
maxLength: 512
minLength: 1
title: Token
additionalProperties: false
type: object
required:
- token
title: InvitationPreviewRequest
InvitationPreviewResponse:
properties:
workspace_name:
type: string
title: Workspace Name
methods:
items:
$ref: '#/components/schemas/SignInSetupMethod'
type: array
title: Methods
type: object
required:
- workspace_name
- methods
title: InvitationPreviewResponse
TokenResponse:
properties:
access_token:
type: string
title: Access Token
refresh_token:
type: string
title: Refresh Token
token_type:
type: string
title: Token Type
default: bearer
expires_in:
type: integer
title: Expires In
landing_hint:
anyOf:
- $ref: '#/components/schemas/LandingHint'
- type: 'null'
decision_key:
anyOf:
- type: string
- type: 'null'
title: Decision Key
type: object
required:
- access_token
- refresh_token
- expires_in
title: TokenResponse
description: Access + refresh token pair. ``expires_in`` is the access-token lifetime (seconds).
HTTPValidationError:
properties:
detail:
items:
$ref: '#/components/schemas/ValidationError'
type: array
title: Detail
type: object
title: HTTPValidationError
securitySchemes:
HTTPBearer:
type: http
scheme: bearer