Trillet AI logo

Provision an agent

Trillet OEM API: Gives one of your customers a working, tested agent from a single request.

POSThttps://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.

Loading code example
Loading code example

Authorizations

Authorizationstringheaderrequired

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Header Parameters

Idempotency-Keystringrequired

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.

Length: >= 1, <= 255

Body

tenantobjectrequired

The customer. A live tenant with this externalId is used as it is; otherwise one is created from these fields.

tenant.externalIdstringrequired
Length: >= 1, <= 128
tenant.namestring

Defaults to business.name.

Length: >= 1, <= 100
tenant.region"us" | "au"
Allowed values: "us" | "au"
tenant.packagestring | null
Length: >= 1, <= 64
tenant.industrystring | null
Length: >= 1, <= 64
tenant.externalRefsobject | null
tenant.metadataobject
tenant.limitsobject
businessobjectrequired

What you know about the business. Anything you send wins over what its website says.

business.namestringrequired
Length: >= 1, <= 120
business.websitestring

Read to fill in what you did not send.

Length: <= 300
business.aboutstring

A few lines about the business.

Length: <= 4000
business.industrystring
Length: <= 120
business.timezonestring

An IANA timezone, such as Europe/Zurich.

Length: <= 60
business.factsobject
business.openingHoursarray<object>
Required array length: <= 14 elements
business.rulesarray<string>
Required array length: <= 12 elements
business.urgentMeansstring

What counts as urgent for this business.

Length: <= 200
business.captureFieldsarray<object>
Required array length: <= 6 elements
business.scriptstring

The business's own call script

Length: <= 20000
templateany

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.

languagesarray<"en" | "de" | "fr" | "it" | "es">

One agent per language. The first is the one callers reach. Defaults to the language of the website, or English.

Required array length: <= 4 elements
voicesobject

A voice ID per language code. A local voice is chosen when left out.

transferNumberstring

Where calls are transferred to a person. Leave out for a message-taking agent.

Length: <= 40
bookingLinkUrlstring

An https booking page the agent can text to callers.

Length: <= 500
notificationsobject
notifications.emailstring

Where the business receives call summaries and alerts.

Length: <= 200
notifications.summaryboolean

Email a summary after each call.

Default: true
notifications.urgentboolean

Add a workflow that emails urgent calls at once.

Default: false
notifications.callbacksboolean

Add a workflow that emails call-back requests.

Default: false
testsobject
tests.skipboolean

Build without test calls.

Default: false
tests.passRatenumber

The share of test calls that must pass for the receptionist to be ready.

Required range: x >= 0, x <= 1
Default: 0.8
goLive"auto" | "approval"

approval holds a passing receptionist as needs_review until you approve it.

Allowed values: "auto" | "approval"
Default: "auto"

Response

application/json

The job was queued.

objectstringrequired
tenantCreatedbooleanrequired

Whether this request created the tenant.

jobobjectrequired
job.objectstringrequired
job.idstringrequired
Pattern: ^[a-fA-F0-9]{24}$
job.type"provision"required
Allowed values: "provision"
job.status"queued" | "running" | "succeeded" | "failed"required
Allowed values: "queued" | "running" | "succeeded" | "failed"
job.stage"reading" | "building" | "testing" | "finishing" | null

Where a running job is. null otherwise.

Allowed values: "reading" | "building" | "testing" | "finishing" | null
job.tenantIdstring | null
job.attemptsinteger
job.resultobject | null

Set when a provisioning job succeeds.

job.errorobject | null
job.createdAtstring | null<date-time>
job.startedAtstring | null<date-time>
job.finishedAtstring | null<date-time>
tenantobjectrequired
tenant.objectstringrequired
tenant.idstringrequired

Use it in paths and as x-workspace-id on standard endpoints.

Pattern: ^[a-fA-F0-9]{24}$
tenant.externalIdstringrequired

Your ID for this customer.

tenant.namestringrequired
tenant.status"active" | "suspended" | "deleted" | "provisioning_failed"required
Allowed values: "active" | "suspended" | "deleted" | "provisioning_failed"
tenant.region"us" | "au"required
Allowed values: "us" | "au"
tenant.packagestring | null

Your own label for the plan or package this customer is on.

tenant.industrystring | null

Your own label for the customer's industry.

tenant.externalRefsobject

Further IDs of your own for this customer, by name. Not unique. Names are not constructor, prototype or __proto__.

tenant.metadataobjectrequired
tenant.limitsobjectrequired
tenant.suspendedAtstring | null<date-time>
tenant.suspendedReasonstring | null
tenant.deletedAtstring | null<date-time>
tenant.createdAtstring<date-time>required
receptionistobjectrequired
receptionist.objectstringrequired
receptionist.tenantIdstringrequired
Pattern: ^[a-fA-F0-9]{24}$
receptionist.businessNamestring | null
receptionist.status"building" | "ready" | "needs_review" | "failed"required
Allowed values: "building" | "ready" | "needs_review" | "failed"
receptionist.reviewReason"tests_failed" | "tests_unavailable" | "approval_required" | null
Allowed values: "tests_failed" | "tests_unavailable" | "approval_required" | null
receptionist.goLive"auto" | "approval"
Allowed values: "auto" | "approval"
receptionist.frontDoorAgentIdstring | null

The agent callers reach first. Assign the customer's number to this one.

receptionist.agentsarray<object>required
receptionist.testsobjectrequired
receptionist.openQuestionsarray<object>

Things the test calls could not settle from what was provided.

receptionist.workflowsarray<object>
receptionist.templateobject | null

The template sent with the request, as sent.

receptionist.jobIdstring | null
receptionist.approvedAtstring | null<date-time>
receptionist.createdAtstring | null<date-time>
receptionist.updatedAtstring | null<date-time>

Last updated on