---
title: "Provision an agent"
description: "Trillet OEM API: Gives one of your customers a working, tested agent from a single request."
openapi: /public/openapi/trillet-oem.yaml POST /partner/v1/agents/provision
lastUpdated: "2026-11-26"
---

> **For AI agents:** the complete documentation index is at [llms.txt](https://docs.trillet.ai/llms.txt). Append `.md` to any page URL for its markdown version.

`POST https://api.trillet.ai/partner/v1/agents/provision`

Gives one of your customers a working agent from a single request. The tenant is found by
`tenant.externalId`, or created when no live tenant has it. A job then builds one agent per
language from the business details and your template, calls it with test callers, fixes
what they find and calls again.

Answers `202` at once. Follow the job with `GET /partner/v1/jobs/{jobId}` or the
`provision.*` events. A build takes about 6 to 10 minutes.

Needs `tenants:write` and `resources:write`. `Idempotency-Key` is required.

## Authentication

- `partnerKey` — http bearer (tpk_live_...)

## Header parameters

- `Idempotency-Key` (string, required) — 1 to 255 printable ASCII characters, no spaces. A retry with the same key and request returns the stored response for 24 hours instead of running again. Failed responses are stored too, except `5xx`, `401`, `403`, `409` and `429`: after fixing the cause of a `4xx` such as `402` `insufficient_funds`, retry with a new key.

## Request body

- Content type: `application/json`
  - request body (object)
    - `tenant` (object, required) — The customer. A live tenant with this `externalId` is used as it is; otherwise one is created from these fields.
      - `externalId` (string, required)
      - `name` (string) — Defaults to `business.name`.
      - `region` (string, one of: us, au)
      - `package` (string | null)
      - `industry` (string | null)
      - `externalRefs` (object | null)
      - `metadata` (object)
      - `limits` (object)
        - `monthlySpendCap` (number | null) — Monthly spend cap in USD. `null` means no cap. `0` blocks all paid work.
    - `business` (object, required) — What you know about the business. Anything you send wins over what its website says.
      - `name` (string, required)
      - `website` (string) — Read to fill in what you did not send.
      - `about` (string) — A few lines about the business.
      - `industry` (string)
      - `timezone` (string) — An IANA timezone, such as `Europe/Zurich`.
      - `facts` (object)
        - `hours` (string)
        - `services` (string)
        - `pricing` (string)
        - `faqs` (string)
        - `location` (string)
        - `other` (string)
      - `openingHours` (array)
        - `items` (object)
          - `day` (string) — Full English day name.
          - `open` (string) — `HH:MM`
          - `close` (string) — `HH:MM`
      - `rules` (array)
        - `items` (string)
      - `urgentMeans` (string) — What counts as urgent for this business.
      - `captureFields` (array)
        - `items` (object)
          - `name` (string, required)
          - `type` (string, one of: text, number, boolean, selector)
          - `options` (array)
            - items: … (nested further)
          - `description` (string)
      - `script` (string) — The business's own call script
    - `template` — Your template for this kind of customer: the text of your template file, or an object with the text and any parts you want applied exactly. Used for this build and kept on the receptionist as sent.
      - (anyOf)
        - value (string)
        - value (object)
          - `name` (string)
          - `text` (string)
          - `rules` (array)
            - items: … (nested further)
          - `captureFields` (array)
            - items: … (nested further)
          - `urgentMeans` (string)
    - `languages` (array) — One agent per language. The first is the one callers reach. Defaults to the language of the website, or English.
      - `items` (string, one of: en, de, fr, it, es)
    - `voices` (object) — A voice ID per language code. A local voice is chosen when left out.
    - `transferNumber` (string) — Where calls are transferred to a person. Leave out for a message-taking agent.
    - `bookingLinkUrl` (string) — An `https` booking page the agent can text to callers.
    - `notifications` (object)
      - `email` (string) — Where the business receives call summaries and alerts.
      - `summary` (boolean, default: true) — Email a summary after each call.
      - `urgent` (boolean, default: false) — Add a workflow that emails urgent calls at once.
      - `callbacks` (boolean, default: false) — Add a workflow that emails call-back requests.
    - `tests` (object)
      - `skip` (boolean, default: false) — Build without test calls.
      - `passRate` (number, default: 0.8) — The share of test calls that must pass for the receptionist to be `ready`.
    - `goLive` (string, one of: auto, approval, default: "auto") — `approval` holds a passing receptionist as `needs_review` until you approve it.

## Response 202

The job was queued.
  - response (object)
    - `object` (string, required)
    - `tenantCreated` (boolean, required) — Whether this request created the tenant.
    - `job` (object, required)
      - `object` (string, required)
      - `id` (string, required)
      - `type` (string, required, one of: provision)
      - `status` (string, required, one of: queued, running, succeeded, failed)
      - `stage` (string | null, one of: reading, building, testing, finishing, null) — Where a running job is. `null` otherwise.
      - `tenantId` (string | null)
      - `attempts` (integer)
      - `result` (object | null) — Set when a provisioning job succeeds.
        - `receptionistStatus` (string, one of: ready, needs_review)
        - `reviewReason` (string | null, one of: tests_failed, tests_unavailable, approval_required, null)
        - `frontDoorAgentId` (string)
        - `agents` (array)
          - `items` (object)
            - language: … (nested further)
            - agentId: … (nested further)
            - callFlowId: … (nested further)
        - `tests` (object)
          - `total` (integer | null) — Test calls that connected.
          - `passedFirst` (integer | null) — Passed before any fix.
          - `passed` (integer | null) — Passed after fixes.
          - `passRate` (number | null)
          - `requiredPassRate` (number | null)
          - `fixesApplied` (integer | null)
          - `skipped` (boolean)
          - `unavailable` (boolean) — The test calls could not run.
      - `error` (object | null)
        - `code` (string)
        - `message` (string)
      - `createdAt` (string | null, date-time)
      - `startedAt` (string | null, date-time)
      - `finishedAt` (string | null, date-time)
    - `tenant` (object, required)
      - `object` (string, required)
      - `id` (string, required) — Use it in paths and as `x-workspace-id` on standard endpoints.
      - `externalId` (string, required) — Your ID for this customer.
      - `name` (string, required)
      - `status` (string, required, one of: active, suspended, deleted, provisioning_failed)
      - `region` (string, required, one of: us, au)
      - `package` (string | null) — Your own label for the plan or package this customer is on.
      - `industry` (string | null) — Your own label for the customer's industry.
      - `externalRefs` (object) — Further IDs of your own for this customer, by name. Not unique. Names are not `constructor`, `prototype` or `__proto__`.
      - `metadata` (object, required)
      - `limits` (object, required)
        - `monthlySpendCap` (number | null) — Monthly spend cap in USD. `null` means no cap. `0` blocks all paid work.
      - `suspendedAt` (string | null, date-time)
      - `suspendedReason` (string | null)
      - `deletedAt` (string | null, date-time)
      - `createdAt` (string, date-time, required)
    - `receptionist` (object, required)
      - `object` (string, required)
      - `tenantId` (string, required)
      - `businessName` (string | null)
      - `status` (string, required, one of: building, ready, needs_review, failed)
      - `reviewReason` (string | null, one of: tests_failed, tests_unavailable, approval_required, null)
      - `goLive` (string, one of: auto, approval)
      - `frontDoorAgentId` (string | null) — The agent callers reach first. Assign the customer's number to this one.
      - `agents` (array, required)
        - `items` (object)
          - `language` (string)
          - `label` (string | null)
          - `agentId` (string)
          - `callFlowId` (string)
          - `knowledgeBaseId` (string | null)
          - `voiceId` (string | null)
          - `frontDoor` (boolean)
      - `tests` (object, required)
        - `total` (integer | null) — Test calls that connected.
        - `passedFirst` (integer | null) — Passed before any fix.
        - `passed` (integer | null) — Passed after fixes.
        - `passRate` (number | null)
        - `requiredPassRate` (number | null)
        - `fixesApplied` (integer | null)
        - `skipped` (boolean)
        - `unavailable` (boolean) — The test calls could not run.
      - `openQuestions` (array) — Things the test calls could not settle from what was provided.
        - `items` (object)
          - `question` (string)
          - `why` (string)
      - `workflows` (array)
        - `items` (object)
      - `template` (object | null) — The template sent with the request, as sent.
      - `jobId` (string | null)
      - `approvedAt` (string | null, date-time)
      - `createdAt` (string | null, date-time)
      - `updatedAt` (string | null, date-time)

## Response 400

The request is malformed, a field is invalid, or the body has a field the endpoint does not accept. `error.param` names the field when there is one.
  - response (object)
    - `error` (object, required)
      - `type` (string, required, one of: invalid_request_error, authentication_error, permission_error, conflict_error, rate_limit_error, api_error, idempotency_error)
      - `code` (string, required) — A stable code. Handle errors by `code`, not by `message`.
      - `message` (string, required)
      - `param` (string) — The request field the error is about, when there is one.
      - `requestId` (string | null) — Include it when you contact support. Not present on idempotency errors.

## Response 401

Authentication failed. A key that is unknown or revoked returns `invalid_api_key`, an
account without Trillet OEM returns `partner_not_enabled`, and a partner key sent in
`x-api-key` returns `partner_key_wrong_header`. No credential, a user session or a user API
key returns `partner_key_required`. Handle a `401` by
status, not only by `error.code`.
  - response
    - (oneOf)
      - value (object)
        - `error` (object, required)
          - `type` (string, required, one of: invalid_request_error, authentication_error, permission_error, conflict_error, rate_limit_error, api_error, idempotency_error)
          - `code` (string, required) — A stable code. Handle errors by `code`, not by `message`.
          - `message` (string, required)
          - `param` (string) — The request field the error is about, when there is one.
          - `requestId` (string | null) — Include it when you contact support. Not present on idempotency errors.
      - value (object)
        - `error` (string, required)

## Response 403

`missing_scope`, `provisioning_not_enabled` (automatic building is not enabled on your account) or `key_restricted` (a key restricted to some tenants cannot create one).
  - response (object)
    - `error` (object, required)
      - `type` (string, required, one of: invalid_request_error, authentication_error, permission_error, conflict_error, rate_limit_error, api_error, idempotency_error)
      - `code` (string, required) — A stable code. Handle errors by `code`, not by `message`.
      - `message` (string, required)
      - `param` (string) — The request field the error is about, when there is one.
      - `requestId` (string | null) — Include it when you contact support. Not present on idempotency errors.

## Response 409

`receptionist_exists`, `provision_in_progress`, `tenant_suspended`, `tenant_limit_reached`, or an idempotency conflict.
  - response (object)
    - `error` (object, required)
      - `type` (string, required, one of: invalid_request_error, authentication_error, permission_error, conflict_error, rate_limit_error, api_error, idempotency_error)
      - `code` (string, required) — A stable code. Handle errors by `code`, not by `message`.
      - `message` (string, required)
      - `param` (string) — The request field the error is about, when there is one.
      - `requestId` (string | null) — Include it when you contact support. Not present on idempotency errors.

## Response 422

`idempotency_key_reused`: the same `Idempotency-Key` was sent with a different request.
  - response (object)
    - `error` (object, required)
      - `type` (string, required, one of: invalid_request_error, authentication_error, permission_error, conflict_error, rate_limit_error, api_error, idempotency_error)
      - `code` (string, required) — A stable code. Handle errors by `code`, not by `message`.
      - `message` (string, required)
      - `param` (string) — The request field the error is about, when there is one.
      - `requestId` (string | null) — Include it when you contact support. Not present on idempotency errors.

## Response 429

`provision_limit_reached`: your account's provisioning jobs for the last 24 hours are used up.
  - response (object)
    - `error` (object, required)
      - `type` (string, required, one of: invalid_request_error, authentication_error, permission_error, conflict_error, rate_limit_error, api_error, idempotency_error)
      - `code` (string, required) — A stable code. Handle errors by `code`, not by `message`.
      - `message` (string, required)
      - `param` (string) — The request field the error is about, when there is one.
      - `requestId` (string | null) — Include it when you contact support. Not present on idempotency errors.

## Response 503

`queue_unavailable`. Retry with a new `Idempotency-Key`.
  - response (object)
    - `error` (object, required)
      - `type` (string, required, one of: invalid_request_error, authentication_error, permission_error, conflict_error, rate_limit_error, api_error, idempotency_error)
      - `code` (string, required) — A stable code. Handle errors by `code`, not by `message`.
      - `message` (string, required)
      - `param` (string) — The request field the error is about, when there is one.
      - `requestId` (string | null) — Include it when you contact support. Not present on idempotency errors.


---

📦 **OpenAPI specs:** Every OpenAPI specification referenced by this documentation is available as a single download — https://docs.trillet.ai/api-specs.zip
