Quantum Nexus Multi Tenancy API

The Multi-tenancy API from Quantum Nexus — 4 operation(s) for multi-tenancy.

GitHub OpenAPI

Operations 9

POST /api/v1/organizations Create an organization (multi-tenancy) #
GET /api/v1/organizations List the organizations of the user #
GET /api/v1/organizations/{id} Detail of an organization (includes all keys) #
PATCH /api/v1/organizations/{id} Update name / description of the org #
DELETE /api/v1/organizations/{id} Delete the whole organization #
POST /api/v1/organizations/{id}/keys Create a sub-key (child) in the organization #
GET /api/v1/organizations/{id}/keys List all the keys of the organization (master + children) #
PATCH /api/v1/organizations/{id}/keys/{keyId} Update a sub-key (active / scopes / childLabel) #
DELETE /api/v1/organizations/{id}/keys/{keyId} Revoke (soft-delete) a sub-key #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • 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.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/nexusquantum-legal:nexusquantum-legal-multi-tenancy-api"
All apis
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.

Get an API 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 Specification

nexusquantum-legal-multi-tenancy-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Nexus Legal Multi Tenancy API
  version: 1.95.0
  description: 'Multi-jurisdictional legal analysis API with a multi-agent architecture and Zero Retention. ## Output language


    `language` (and the language implied by the jurisdiction) sets the language the text is written in. For `es` and `en` the delivered text is also measured: when a substantial part of it came back in the other of the two, a block headed `⚠️ LANGUAGE OF THIS REPORT` (`⚠️ IDIOMA DE ESTE INFORME` when `es` was requested) is added at the end of the text. It works the same with any engine, BYO included. - **When there is no block**: it is not a confirmation. Other languages are not measured, and neither is a text too short or too mixed to tell. - **With BYO**: how closely the output follows the request depends on your engine. - **If the output language is essential to your workflow**: check it on your side against the `analysis` string. ## The verdict travels INSIDE the text — read this before you parse a response


    Every string this API returns that a lawyer reads — `analysis`, `answer`, `report`, `draft`, `synthesisText`, and the string fields of structured results like `applicableLaw[]` — carries the citation verdict **inline**, not only in the `citationChecks` object beside it. **What you will actually see:**


    ```

    An acknowledgement does not revive a claim already barred: section 29(7) of the

    Limitation Act 1980 【✓】. See also [2019] EWHC 3556 (Comm)

    【◻ not checked — the reason is in this citation''s note】. ---

    DETERMINISTIC CITATION CHECK (against the official corpus)

    1 verified · 1 not checked. ◻ **Not checked** — they were not compared against any official corpus…

    ```


    - **Inline marker**: a `【…】` block immediately after each citation, in the response language. The glyph carries the verdict: `✓` verified · `⚠` a warning (e.g. the decision exists but a party you named does not appear in it) · `⛔` broken · `◻` not checked. - **Footer**: a `---` block at the end with the tally and, for anything not clean, the list of citations and why. **Why it is in the text and not only in the JSON.** Whoever copies an answer into an email, a brief or a .docx takes the PROSE. The `citationChecks` object does not travel with it. A verdict that only exists in a field beside the text is a verdict the reader can lose without noticing. **If you parse these strings**: markers are the only `【…】` sequences we emit, so they are safe to strip with a single regex if your pipeline needs the raw prose — but do not strip them from anything a human will read. `citationChecks` remains the machine-readable source of truth for counts and per-citation status; the markers are the same verdict, placed where it cannot get lost. **Idempotent**: annotating an already-annotated text does not duplicate markers or the footer. ## Streaming: `verifiedText` on the `done` event


    On SSE routes the client already holds the raw prose by the time the verifier finishes, so the closing `{type:"done"}` event carries `verifiedText`: the same answer with the verdict already in it. **If it is present, render it in place of the concatenated `text_delta` chunks.** It is omitted when there is nothing to annotate, in which case the deltas are already final. The REST wrappers do this for you — `/v1/consulta`, `/v1/chat` and the rest aggregate server-side and hand you the annotated text — so this only concerns you if you consume the SSE stream directly. ## Base capabilities


    - **Mode=deep**: the Node A (Claude Opus 4.7) + Node B (DeepSeek V4-Pro) chain audits adversarially. 2 credits. Returns an `audit` object with structured findings (hallucinations, false citations, omissions). - **Direct models**: calls through the providers'' own APIs (Anthropic, DeepSeek) with no proxies — lower latency, better rate limits. - **Stable Stripe-style error format**: `error.type`, `error.code`, `error.request_id`, `error.details` + backward-compat aliases. ## Errors and rate limits


    - **Branch on `error.code`.** A code you do not recognise is handled by its `error.type`.'
  contact:
    name: Nexus Legal
    email: support@nexusquantum.legal
    url: https://legal.nexusquantum.legal/developers
  license:
    name: Commercial
    url: https://nexusquantum.legal/terms
servers:
- url: https://legal.nexusquantum.legal
  description: Production
security:
- ApiKeyAuth: []
tags:
- name: Multi-tenancy
paths:
  /api/v1/organizations:
    post:
      summary: Create an organization (multi-tenancy)
      description: 'Creates an organization and promotes the current key to `role: master`. Only keys with `role: solo` (default) can create orgs. `role: child` keys receive 403. A `master` key that already belongs to another org receives 409 `ALREADY_MASTER`.


        Use case: distributor / partner that needs to serve N end clients with separate keys + usage rollup. After creating the org, use `POST /api/v1/organizations/{id}/keys` to generate sub-keys (`role: child`).'
      operationId: createOrganization
      security:
      - ApiKeyAuth: []
      tags:
      - Multi-tenancy
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - name
              properties:
                name:
                  type: string
                  minLength: 2
                  maxLength: 80
                description:
                  type: string
                  maxLength: 300
            example:
              name: Acme Legal LATAM
              description: Distributor LATAM with TimeBillingX + CaseTracking integration
      responses:
        '201':
          description: Org created. The authenticated key is promoted to master.
          content:
            application/json:
              schema:
                type: object
                properties:
                  organization:
                    type: object
                    properties:
                      id:
                        type: string
                        format: uuid
                      name:
                        type: string
                      description:
                        type:
                        - string
                        - 'null'
                      created_at:
                        type: string
                        format: date-time
                  masterKeyId:
                    type: string
                    format: uuid
        '403':
          description: A child role cannot create orgs.
        '409':
          description: Key is already master of another org.
        '422':
          description: Limit of 5 orgs per user reached.
      x-codeSamples:
      - lang: TypeScript
        label: '@nexus-legal/sdk'
        source: "import { NexusClient } from \"@nexus-legal/sdk\";\n\nconst nexus = new NexusClient({ apiKey: process.env.NEXUS_API_KEY! });\n\nconst { organization, masterKeyId } = await nexus.organizations.create({\n  name: \"Acme Legal LATAM\",\n});\nconsole.log(\"Org created:\", organization.id, \"master:\", masterKeyId);"
      - lang: Python
        label: nexus-legal
        source: 'from nexus_legal import NexusClient


          nexus = NexusClient(api_key=os.environ["NEXUS_API_KEY"])


          result = nexus.organizations.create(name="Acme Legal LATAM")

          print("Org created:", result["organization"]["id"], "master:", result["masterKeyId"])'
    get:
      summary: List the organizations of the user
      operationId: listOrganizations
      security:
      - ApiKeyAuth: []
      tags:
      - Multi-tenancy
      responses:
        '200':
          description: Array of orgs with a sub_keys count for each one.
          content:
            application/json:
              schema:
                type: object
                properties:
                  organizations:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          format: uuid
                        name:
                          type: string
                        description:
                          type:
                          - string
                          - 'null'
                        created_at:
                          type: string
                          format: date-time
                        sub_keys:
                          type: integer
                          description: Active sub-keys in this org
  /api/v1/organizations/{id}:
    get:
      summary: Detail of an organization (includes all keys)
      operationId: getOrganization
      security:
      - ApiKeyAuth: []
      tags:
      - Multi-tenancy
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
          format: uuid
      responses:
        '200':
          description: Org + array of keys (master first, children ordered by created_at DESC).
          content:
            application/json:
              schema:
                type: object
                properties:
                  organization:
                    $ref: '#/components/schemas/Organization'
                  keys:
                    type: array
                    items:
                      $ref: '#/components/schemas/OrgKey'
        '403':
          description: You are not master of this org.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Org does not exist.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
    patch:
      summary: Update name / description of the org
      operationId: updateOrganization
      security:
      - ApiKeyAuth: []
      tags:
      - Multi-tenancy
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
          format: uuid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  minLength: 2
                  maxLength: 80
                description:
                  type: string
                  maxLength: 300
      responses:
        '200':
          description: Org updated.
          content:
            application/json:
              schema:
                type: object
                properties:
                  organization:
                    $ref: '#/components/schemas/Organization'
        '403':
          description: You are not master of this org.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
    delete:
      summary: Delete the whole organization
      description: Revokes all sub-keys (active=false), releases the master_key (back to role=solo) and deletes the org. A destructive operation, but the data is preserved for the audit trail.
      operationId: deleteOrganization
      security:
      - ApiKeyAuth: []
      tags:
      - Multi-tenancy
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
          format: uuid
      responses:
        '200':
          description: Org deleted + sub-keys revoked.
          content:
            application/json:
              schema:
                type: object
                properties:
                  deleted_organization_id:
                    type: string
                    format: uuid
                  revoked_sub_keys:
                    type: integer
        '403':
          description: You are not master of this org.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /api/v1/organizations/{id}/keys:
    post:
      summary: Create a sub-key (child) in the organization
      description: 'The master generates a sub-key for an end client. The scopes are a strict subset of the master scopes (no escalation possible). The secret is returned ONLY ONCE.


        Usage is attributed to this sub-key, visible via `GET /api/v1/usage?organization_id=` with a breakdown by `child_label`.'
      operationId: createSubKey
      security:
      - ApiKeyAuth: []
      tags:
      - Multi-tenancy
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
          format: uuid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - childLabel
              properties:
                childLabel:
                  type: string
                  minLength: 2
                  maxLength: 80
                  description: Name of the end client, e.g. 'Despacho Vázquez'
                scopes:
                  type: array
                  items:
                    type: string
                    enum:
                    - analyze
                    - query
                    - mcp
                expiresInDays:
                  type: integer
                  minimum: 1
                  maximum: 3650
            example:
              childLabel: Despacho Vázquez
              scopes:
              - analyze
              - query
              expiresInDays: 365
      responses:
        '201':
          description: Sub-key created. The `key` field is shown only once.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubKeyCreated'
        '403':
          description: You are not master of this org.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Limit of 200 sub-keys per org reached, or invalid scopes.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      x-codeSamples:
      - lang: TypeScript
        label: '@nexus-legal/sdk'
        source: "const sk = await nexus.organizations.createKey(orgId, {\n  childLabel: \"Despacho Vázquez\",\n  scopes:     [\"analyze\", \"query\"],\n});\n// sk.key is shown ONLY ONCE. Hand it to the end client over a\n// secure channel (shared vault, not email). Do not log it in production.\nconsole.log(\"✓ Sub-key created:\", sk.key_prefix);"
    get:
      summary: List all the keys of the organization (master + children)
      operationId: listOrgKeys
      security:
      - ApiKeyAuth: []
      tags:
      - Multi-tenancy
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
          format: uuid
      responses:
        '200':
          description: Array of keys ordered by role (master first), then created_at DESC.
          content:
            application/json:
              schema:
                type: object
                properties:
                  keys:
                    type: array
                    items:
                      $ref: '#/components/schemas/OrgKey'
        '403':
          description: You are not master of this org.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /api/v1/organizations/{id}/keys/{keyId}:
    patch:
      summary: Update a sub-key (active / scopes / childLabel)
      description: The master cannot be modified from this route (it will return 409). Manage the master from the web console (`/developers`) while signed in.
      operationId: updateSubKey
      security:
      - ApiKeyAuth: []
      tags:
      - Multi-tenancy
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
          format: uuid
      - name: keyId
        in: path
        required: true
        schema:
          type: string
          format: uuid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                active:
                  type: boolean
                scopes:
                  type: array
                  items:
                    type: string
                    enum:
                    - analyze
                    - query
                    - mcp
                childLabel:
                  type: string
                  maxLength: 80
      responses:
        '200':
          description: Sub-key updated.
          content:
            application/json:
              schema:
                type: object
                properties:
                  api_key:
                    $ref: '#/components/schemas/OrgKey'
        '403':
          description: You are not master of this org.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: You tried to mutate the master from this route. Manage it from the web console (`/developers`) while signed in.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
    delete:
      summary: Revoke (soft-delete) a sub-key
      description: 'Marks the sub-key as `active: false`. Preserves the audit trail and usage stats. The master cannot be revoked from here (409); use `DELETE /api/v1/organizations/{id}` to destroy the whole org.'
      operationId: revokeSubKey
      security:
      - ApiKeyAuth: []
      tags:
      - Multi-tenancy
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
          format: uuid
      - name: keyId
        in: path
        required: true
        schema:
          type: string
          format: uuid
      responses:
        '200':
          description: Sub-key revoked.
          content:
            application/json:
              schema:
                type: object
                properties:
                  revoked_key_id:
                    type: string
                    format: uuid
        '403':
          description: You are not master of this org.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: You tried to revoke the master from this route.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    OrgKey:
      type: object
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
        key_prefix:
          type: string
          description: First 12 chars (nlk_xxxxxxxx). The rest is NOT exposed.
        role:
          type: string
          enum:
          - solo
          - master
          - child
        child_label:
          type:
          - string
          - 'null'
        scopes:
          type: array
          items:
            type: string
        tier:
          type: string
          enum:
          - standard
          - premium
          - enterprise
        rate_limit_rpm:
          type: integer
        active:
          type: boolean
        created_at:
          type: string
          format: date-time
        last_used_at:
          type:
          - string
          - 'null'
          format: date-time
        expires_at:
          type:
          - string
          - 'null'
          format: date-time
    ErrorResponse:
      type: object
      required:
      - error
      description: Stripe-style error envelope returned by apiError() on ALL v1 routes. `error` is an OBJECT {type, code, message, request_id, details?}; the top-level `error_message`/`code` are backward-compat (deprecated v1.7). A generated client must deserialize `error` as an object, not as a string.
      properties:
        error:
          type: object
          required:
          - type
          - code
          - message
          properties:
            type:
              type: string
              example: invalid_request_error
            code:
              type: string
              example: VALIDATION_ERROR
            message:
              type: string
            request_id:
              type: string
            details:
              type: object
              description: Optional. An engine failure carries what you need in order to decide what to do next, and a `429` says whose ceiling you reached. Each field is present only when it was measured, and `details` is omitted entirely rather than sent empty.
              properties:
                retryable:
                  type: boolean
                  description: Whether retrying this exact request can succeed. Absent means not measured — do not read absence as `true`.
                refunded:
                  type: boolean
                  description: Whether the credit for this call was returned. Absent means not measured.
                reason:
                  type: string
                  description: Short machine-readable cause.
                  example: provider_timeout
                provider:
                  type: string
                  description: Which engine failed. On a BYO tenant this is the difference between checking your own key and opening a ticket with us.
                  example: Anthropic (BYO)
                error_class:
                  type: string
                scope:
                  type: string
                  enum:
                  - ip
                  - user
                  - organization
                  description: 'On a `429`: whose ceiling you reached.'
                retry_after_seconds:
                  type: integer
                  description: 'On a `429`: seconds to wait, the same value as the `Retry-After` header.'
                limit_per_minute:
                  type: integer
                  description: 'On a `429`: the per-minute ceiling you reached.'
        error_message:
          type: string
          description: Backward-compat (deprecated v1.7).
        code:
          type: string
          description: Backward-compat (deprecated v1.7).
    Organization:
      type: object
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
        description:
          type:
          - string
          - 'null'
        created_at:
          type: string
          format: date-time
        sub_keys:
          type: integer
          description: Active sub-keys in this org (present only in the list endpoint).
    SubKeyCreated:
      type: object
      properties:
        key:
          type: string
          description: Sub-key plaintext (`nlk_…`). SHOWN ONLY ONCE. Store it securely.
          example: nlk_EXAMPLE_ONLY_NOT_A_REAL_KEY_0000000000000000000000000000
        api_key:
          $ref: '#/components/schemas/OrgKey'
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
      bearerFormat: nlk_...