Skip to main content
A partner serves many customers of its own through NDI. Each customer is a tenant: a separate NDI organization with its own workspaces, files, jobs, domains, access labels, schemas and limits. The partner holds one API key for all of them and names the tenant on every request.

Acting for a tenant

Send these headers with the partner key on every /v1 route: Everything the request reads or creates belongs to that tenant alone: another tenant’s resources answer 404 exactly as if they did not exist. Platform domains and extraction schemas stay visible to every tenant. A service actor can read its own jobs and their result files. The partner controls workspace access for the credentials it issues. For service jobs the partner’s job.usage_finalized webhook includes data.external_service_id. The field is omitted for jobs without a service actor. A malformed X-NDI-Tenant answers 404 like an unknown one, so no answer tells you which tenants exist. A partner key acts for a tenant only through X-NDI-Tenant: X-NDI-External-Account is for service keys that are not a partner’s. The legacy /api/v1 routes, including /api/v1/example and /api/v1/health/load, answer 403 to a partner key.

Managing tenants

Call these with the partner key and without X-NDI-Tenant. PUT accepts display_name (up to 128 characters), disabled, data_retention, zero_retention_result_hold_seconds, limits (rpm, max_concurrent_jobs) and workspace_storage_limit_bytes. Creating a tenant past the partner’s tenant cap answers 409 tenant_limit_reached; disabled tenants count toward the cap.
  • rpm is the tenant’s requests per minute. A request over it answers 429.
  • max_concurrent_jobs is how many parse, split, classify, categorize, extract, ground and agent jobs the tenant may have running at once. More jobs wait in the queue instead of being refused. NDI’s own per-tenant cap applies when it is lower, so this setting can lower a tenant’s concurrency but not raise it. Ingestion isn’t counted.
  • Passing wait_seconds on /v1 waits for the admitted job; it does not change how max_concurrent_jobs applies. There is no separate concurrency cap for these waits. max_concurrent_sync limits synchronous calls such as the legacy synchronous API and /v1/systemone, not wait_seconds long-polls. A child tenant inherits its partner’s max_concurrent_sync at creation; PUT /v1/tenants cannot set it. The wait itself is bounded: the parameter accepts at most 300 seconds. For retained jobs, a deployment may end the wait earlier and answer 202 with the running job; poll GET /v1/jobs/{job_id}. Zero-retention jobs are exempt from that deployment limit, except jobs of a tenant that opted in to the 24 hour result hold, which can be polled instead (see Jobs).
  • A limit above the partner’s own is lowered to it. The partner’s own limit is the lower of its own value and its partner-wide cap (partner.rpm, partner.concurrent_jobs), when one is set.
  • Lowering the partner’s limits later doesn’t rewrite existing tenants. The partner-wide caps bound all of its tenants together, and so each of them too.
  • workspace_storage_limit_bytes is the most current source-file data, in bytes, the tenant may hold across its managed workspaces. Must be a positive integer. Omit it to keep the current allowance; send null to remove the tenant’s own allowance, after which it follows the deployment default (unlimited unless NDI configured one). The allowance is not returned on the tenant object. Uploads that would go over it answer 409 storage_limit_exceeded. Workspaces on customer storage aren’t counted. It is enforced only on deployments that enabled workspace storage limits.
  • data_retention is how the tenant’s document operations retain data, short or zero_retention. The legacy wire value short now keeps content until explicit deletion. Omit it on create to inherit your own setting, or on update to leave the tenant’s setting unchanged. The tenant is returned with the stored setting in force for it. Disabling new Zero retention provisioning does not downgrade existing Zero retention tenants. Under zero_retention, NDI returns document results inline with wait_seconds. PDF Parse also supports delivery to customer storage. Other requests without a wait answer 422 wait_required_for_zero_retention, unless the tenant opted in to the 24 hour result hold below. Setting zero_retention on a deployment that has not enabled it answers 422 invalid_request.
  • zero_retention_result_hold_seconds is 0 (the default) or 86400. 86400 opts a zero_retention tenant in to keeping each result readable by polling for 24 hours after its job finishes, so a create needs no inline wait. It takes effect only where the deployment enables result holds. Jobs delivered to customer storage (result_delivery: "workspace") are never held: they keep no Nace copy and no 24 hour window, even for an opted-in tenant. A job keeps the value its tenant had when it was accepted. Omit the field on update to leave it unchanged; any other value answers 422 invalid_request. The tenant is returned with the value in force. | Case | Status | error.code | |---|---|---| | The key is not a partner’s | 422 | partner_required | | The partner was disabled while PUT ran (afterwards its key answers 401) | 403 | access_denied | | X-NDI-Tenant sent to a management route | 422 | invalid_request | | No tenant with that external_ref (GET, DELETE) | 404 | tenant_not_found | | A new tenant past the partner’s tenant cap | 409 | tenant_limit_reached |

Purging a tenant

DELETE /v1/tenants/{external_ref}?purge=true permanently deletes everything the tenant holds. It cannot be undone. Without purge=true, DELETE only disables the tenant and keeps its data. Call it with the partner key and no X-NDI-Tenant, like the other management routes. The call answers 202 with a tenant_purge job. The tenant is disabled at once and its running jobs are cancelled. Every file’s bytes, every result, cache entry and webhook payload of the tenant is then deleted, and its keys are revoked. Only anonymized metadata is kept: the job records (ids, kinds, statuses, timestamps, pages, units, bytes, credits, token counts per model and error codes, with no job names, inputs, results or error messages), an anonymized record for each deleted file and for each console user whose only organization it was, the tenant’s workspaces and keys as renamed rows with no settings and no usable key hash, and its other records (memberships, invitations, uploads, webhook endpoints and events, access labels) marked deleted, with no names, addresses, URLs, secrets or payloads. See What we keep after deletion. Poll the job with GET /v1/jobs/{job_id} using the partner key and without X-NDI-Tenant; a partner may read only the purge jobs it owns this way. When the job has succeeded, its result reports what the verification pass found: A purge that ends with verified: false is still a succeeded job: the report says what is left, and repeating the DELETE runs the purge again. A purge already queued or running is returned as it is. Once a purge has verified clean, the external_ref no longer resolves: repeating the call answers 404 tenant_not_found, and a later PUT creates a new, empty tenant.

Usage across tenants

With the partner key and no X-NDI-Tenant, GET /v1/usage?group_by=tenant returns one bucket per tenant, keyed by its external_ref, over the same period_start/period_end window as any usage report. Disabled tenants are included, since their usage is still owed. Only your own tenants are counted. One tenant’s usage is the ordinary GET /v1/usage with X-NDI-Tenant. group_by=tenant with X-NDI-Tenant, a workspace_id, or a key that is not a partner’s answers 422 invalid_request. Any other grouping from the partner key without X-NDI-Tenant, and any request with X-NDI-External-Account, answers 400 tenant_required.