Patricia Tenants API
The tenants API from Patricia — 2 operation(s) for tenants.
The tenants API from Patricia — 2 operation(s) for tenants.
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-tenants-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 Tenants API
version: 0.1.0
tags:
- name: Tenants
paths:
/v1/tenants:
get:
tags:
- Tenants
summary: Search tenants
description: List tenants with filtering, sorting, and pagination.
operationId: list_items_v1_tenants_get
security:
- HTTPBearer: []
parameters:
- name: q
in: query
required: false
schema:
anyOf:
- type: string
- type: 'null'
description: ANTLR filter expression
title: Q
description: ANTLR filter expression
- name: limit
in: query
required: false
schema:
anyOf:
- type: integer
maximum: 500
minimum: 1
- type: 'null'
description: Page size
title: Limit
description: Page size
- name: sort_by
in: query
required: false
schema:
anyOf:
- type: string
- type: 'null'
description: Sort expression (e.g. created_at:desc)
title: Sort By
description: Sort expression (e.g. created_at:desc)
- name: fields
in: query
required: false
schema:
anyOf:
- type: string
- type: 'null'
description: Field projection (e.g. id,name)
title: Fields
description: Field projection (e.g. id,name)
- name: pq
in: query
required: false
schema:
anyOf:
- type: string
- type: 'null'
description: Pagination cursor query
title: Pq
description: Pagination cursor query
- name: from_prev
in: query
required: false
schema:
type: boolean
description: Backward pagination flag
default: false
title: From Prev
description: Backward pagination flag
- name: X-Tenant-Id
in: header
required: false
schema:
anyOf:
- type: string
- type: 'null'
title: X-Tenant-Id
responses:
'200':
description: Paginated tenant list.
content:
application/json:
schema:
$ref: '#/components/schemas/models__identity__Tenant__SearchValidator'
'401':
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'400':
description: Bad request
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'403':
description: 'Forbidden. Inspect response body `code` for the specific reason (for example: PERMISSION_DENIED, EMAIL_NOT_VERIFIED, TENANT_ACCESS_REQUIRED, ROLE_UNRESOLVED)'
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'422':
description: Validation error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
post:
tags:
- Tenants
summary: Create Workspace
description: 'Create a new, separate workspace for the authenticated user and return a session scoped to it.
The deliberate way to a second workspace now that the returning-user guard no longer mints one from an
unknown Slack. JWT-only (``require_user``) so it works even from a tenant-less pending session; it never
selects among existing memberships, so it is not the tenant chooser. The required ``Idempotency-Key``
header makes a retry safe: the same key returns the SAME workspace (never a duplicate), and reusing a
key with a different body is a 409. Adopt the returned token pair to enter the new workspace.'
operationId: create_workspace_v1_tenants_post
security:
- HTTPBearer: []
parameters:
- name: Idempotency-Key
in: header
required: true
schema:
type: string
minLength: 1
maxLength: 255
title: Idempotency-Key
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CreateWorkspaceRequest'
responses:
'201':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/TokenResponse'
'401':
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'403':
description: Email verification required (EMAIL_NOT_VERIFIED)
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'409':
description: Conflict
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'422':
description: Validation error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
/v1/tenants/{id}:
get:
tags:
- Tenants
summary: Get tenant
description: Retrieve a single tenant by ID.
operationId: get_item_v1_tenants__id__get
security:
- HTTPBearer: []
parameters:
- name: id
in: path
required: true
schema:
type: string
format: uuid
title: Id
- name: X-Tenant-Id
in: header
required: false
schema:
anyOf:
- type: string
- type: 'null'
title: X-Tenant-Id
responses:
'200':
description: The requested tenant.
content:
application/json:
schema:
$ref: '#/components/schemas/models__identity__Tenant__FullValidator'
'401':
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'400':
description: Bad request
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'403':
description: 'Forbidden. Inspect response body `code` for the specific reason (for example: PERMISSION_DENIED, EMAIL_NOT_VERIFIED, TENANT_ACCESS_REQUIRED, ROLE_UNRESOLVED)'
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'404':
description: Not found
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'422':
description: Validation error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
put:
tags:
- Tenants
summary: Update tenant
description: Full update (PUT) of a tenant.
operationId: update_item_v1_tenants__id__put
security:
- HTTPBearer: []
parameters:
- name: id
in: path
required: true
schema:
type: string
format: uuid
title: Id
- name: X-Tenant-Id
in: header
required: false
schema:
anyOf:
- type: string
- type: 'null'
title: X-Tenant-Id
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/models__identity__Tenant__UpdateValidator'
responses:
'200':
description: The updated tenant.
content:
application/json:
schema:
$ref: '#/components/schemas/models__identity__Tenant__FullValidator'
'401':
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'400':
description: Bad request
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'403':
description: 'Forbidden. Inspect response body `code` for the specific reason (for example: PERMISSION_DENIED, EMAIL_NOT_VERIFIED, TENANT_ACCESS_REQUIRED, ROLE_UNRESOLVED)'
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'404':
description: Not found
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'409':
description: Conflict
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'422':
description: Validation error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
patch:
tags:
- Tenants
summary: Partial update tenant
description: Partial update (PATCH) of a tenant.
operationId: merge_item_v1_tenants__id__patch
security:
- HTTPBearer: []
parameters:
- name: id
in: path
required: true
schema:
type: string
format: uuid
title: Id
- name: X-Tenant-Id
in: header
required: false
schema:
anyOf:
- type: string
- type: 'null'
title: X-Tenant-Id
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/models__identity__Tenant__MergeValidator'
responses:
'200':
description: The updated tenant.
content:
application/json:
schema:
$ref: '#/components/schemas/models__identity__Tenant__FullValidator'
'401':
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'400':
description: Bad request
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'403':
description: 'Forbidden. Inspect response body `code` for the specific reason (for example: PERMISSION_DENIED, EMAIL_NOT_VERIFIED, TENANT_ACCESS_REQUIRED, ROLE_UNRESOLVED)'
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'404':
description: Not found
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'409':
description: Conflict
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'422':
description: Validation error
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
components:
schemas:
models__identity__Tenant__FullValidator:
properties:
id:
type: string
format: uuid
title: Id
display_name:
type: string
title: Display Name
status_code:
$ref: '#/components/schemas/TenantStatus'
settings:
additionalProperties: true
type: object
title: Settings
monthly_cap_micro_usd:
type: integer
title: Monthly Cap Micro Usd
onboarding_completed:
type: boolean
title: Onboarding Completed
skill_testing_workspace:
type: boolean
title: Skill Testing Workspace
created_at:
type: string
format: date-time
title: Created At
updated_at:
type: string
format: date-time
title: Updated At
type: object
required:
- id
- display_name
- status_code
- settings
- monthly_cap_micro_usd
- onboarding_completed
- skill_testing_workspace
- created_at
- updated_at
title: FullValidator
description: Response shape for GET / POST / PUT / PATCH.
TenantStatus:
type: string
enum:
- active
- suspended
- cancelled
title: TenantStatus
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.'
CreateWorkspaceRequest:
properties:
name:
anyOf:
- type: string
maxLength: 255
- type: 'null'
title: Name
description: Workspace name (a friendly default is used if omitted).
additionalProperties: false
type: object
title: CreateWorkspaceRequest
description: 'Payload for the explicit "create a new / separate workspace" action.
An ``Idempotency-Key`` header (required by the route) makes a retry safe. The response is a fresh
token pair scoped to the new workspace, which the caller adopts to enter the workspace it just created.'
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.
models__identity__Tenant__MergeValidator:
properties:
display_name:
anyOf:
- type: string
- type: 'null'
title: Display Name
monthly_cap_micro_usd:
anyOf:
- type: integer
- type: 'null'
title: Monthly Cap Micro Usd
updated_at:
anyOf:
- type: string
format: date-time
- type: 'null'
title: Updated At
additionalProperties: false
type: object
title: MergeValidator
description: 'PATCH body: every field optional; only those set are written.
No ``status_code``, for the reason ``UpdateValidator`` gives.'
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).
models__identity__Tenant__SearchValidator:
properties:
items:
items:
$ref: '#/components/schemas/models__identity__Tenant__FullValidator'
type: array
title: Items
first:
anyOf:
- type: string
- type: 'null'
title: First
next:
anyOf:
- type: string
- type: 'null'
title: Next
previous:
anyOf:
- type: string
- type: 'null'
title: Previous
type: object
required:
- items
title: SearchValidator
description: Typed cursor-paginated list response.
models__identity__Tenant__UpdateValidator:
properties:
display_name:
type: string
title: Display Name
monthly_cap_micro_usd:
type: integer
title: Monthly Cap Micro Usd
updated_at:
type: string
format: date-time
title: Updated At
additionalProperties: false
type: object
required:
- display_name
- monthly_cap_micro_usd
- updated_at
title: UpdateValidator
description: 'PUT body: full update of mutable fields (carries ``updated_at`` for the stale check).
No ``status_code``: workspace liveness is not a client-writable field. See the column.'
securitySchemes:
HTTPBearer:
type: http
scheme: bearer