SMAO API Documentation
Public APIAssistants

Update an assistant

Partial update — only included fields are changed. phone_number and carrier are read-only and cannot be updated via this endpoint. Cross-resource refs are validated to belong to your organization.

When introduction is included, the successful response confirms that the new opening text has been committed to the active assistant configuration used by the dashboard and by newly initialized calls. Existing localized translations are regenerated asynchronously; already initialized or in-progress calls keep the configuration they loaded earlier. A code-managed line whose greeting is owned by an enterprise line profile returns 409 Conflict.

pre_call_webhook is merged: omit it to preserve it, or send null to remove it and its credentials. A supplied object requires enabled and, when enabled, url; other omitted fields retain their values. A supplied header map replaces all custom headers; null clears them. Omit auth to preserve authentication, or send null to remove it. With the same auth type, omitted secrets/passwords are retained. Changing auth type removes its old fields and requires the new credential (except for none). Missing required credentials return 400. Disabling preserves credentials; clearing removes them.

Enterprise assistants reject webhook mutations with 409. A concurrent clear or auth-state change that invalidates the merge also returns 409 without applying any part of this PATCH; read the current configuration before submitting an updated request. Saving never fires the webhook. The assigned prompt must contain @preCallData to use its response.

PATCH
/assistants/{assistant_id}
AuthorizationBearer <token>

API key in the Authorization: Bearer <key> header. Keys are created in the SMAO dashboard (Settings → API Keys).

In: header

Path Parameters

assistant_idstring
Match^[a-f0-9]{24}$
name?string
Length1 <= length <= 100
description?string
Lengthlength <= 500
language?string
Value in"de" | "en" | "fr" | "it" | "de-CH" | "es" | "pt" | "tr" | "sv" | "fi"
voice_id?string

Voice ID. Use a value returned by GET /voices. An existing legacy ID may remain unchanged, but changing to a legacy, unknown, or unavailable ID returns 400.

company_name?string
Length1 <= length <= 200
company_industry?string
Length1 <= length <= 200
introduction?string

Replaces the canonical original opening text atomically. If language is omitted, the current original introduction language is retained; stale translations are discarded and regenerated asynchronously.

Length1 <= length <= 5000
record_call?boolean
speed?number

Voice playback rate multiplier. Some voices only support 0.8–1.2; out-of-range values for such voices return 400.

Range0.7 <= value <= 1.2
tts_style_level?number

Voice style level from 0 (calm) to 1 (expressive).

Multiple Of0.01
Range0 <= value <= 1
background_ambience?string

Background ambience bed mixed under the assistant voice during phone calls.

Value in"clean" | "office"
interruptable?boolean
appointment_booking_enabled?boolean
contextual_asr_correction_enabled?boolean

Per-turn LLM correction of misrecognised proper nouns (names, companies, products) in caller transcripts, using the assistant's own contacts, employees, glossary and knowledge. Adds latency on turns that carry a candidate. Default false.

allow_preferred_language?boolean
whitelist?boolean
prompt_id?string|null
Match^[a-f0-9]{24}$
email_prompt_id?string|null
Match^[a-f0-9]{24}$
knowledge_group_ids?array<string>
glossary_group_ids?array<string>
pronunciation_group_ids?array<string>
forwarding_group_ids?array<string>
contact_group_ids?array<string>
calendar_ids?array<string>
Itemsitems <= 1
tool_ids?array<string>

Webhook-type tools only. Integration-type / internal tools cannot be referenced via the public API and will return 404 on create/update.

analysis_ids?array<string>
pre_call_webhook?object|null

Null clears the configuration. A supplied object requires enabled and, when enabled, a nonempty HTTPS url. Any supplied nonempty url must be valid HTTPS even when disabled; disabled configurations also accept null or an empty string. A host is required, ports must be numeric, and percent escapes must contain two hexadecimal digits. String length limits count Unicode characters. Other omitted fields preserve their values on PATCH. Initial defaults are POST, empty headers/body template, no authentication and 5000 ms. See PreCallWebhook for runtime behavior.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X PATCH "https://api.smao.ai/api/v1/assistants/65f8fa6f1a9d8e0012ab34cd" \  -H "Content-Type: application/json" \  -d '{    "pre_call_webhook": {      "enabled": true,      "url": "https://crm.example.com/lookup",      "auth": {        "type": "bearer",        "secret": "example-only-token"      }    }  }'
{
  "data": {
    "id": "65f8fa6f1a9d8e0012ab34cd",
    "name": "Sarah",
    "description": "Receptionist assistant for inbound calls.",
    "language": "de",
    "voice_id": "cgSgspJ2msm6clMCkdW9",
    "record_call": true,
    "speed": 0.7,
    "tts_style_level": 1,
    "background_ambience": "clean",
    "interruptable": true,
    "appointment_booking_enabled": true,
    "contextual_asr_correction_enabled": true,
    "allow_preferred_language": true,
    "whitelist": true,
    "introduction": "string",
    "company_name": "string",
    "company_industry": "string",
    "phone_number": "+491701234567",
    "carrier": "string",
    "prompt_id": "65a1234567890abcdef01234",
    "email_prompt_id": "65a1234567890abcdef05678",
    "knowledge_group_ids": [
      "65a1234567890abcdef01234"
    ],
    "glossary_group_ids": [
      "65a1234567890abcdef01234"
    ],
    "pronunciation_group_ids": [
      "65a1234567890abcdef01234"
    ],
    "forwarding_group_ids": [
      "65a1234567890abcdef01234"
    ],
    "contact_group_ids": [
      "65a1234567890abcdef01234"
    ],
    "calendar_ids": [
      "65a1234567890abcdef01234"
    ],
    "tool_ids": [
      "65a1234567890abcdef01234"
    ],
    "analysis_ids": [
      "65a1234567890abcdef01234"
    ],
    "pre_call_webhook": {
      "enabled": true,
      "url": "https://crm.example.com/lookup",
      "method": "POST",
      "headers": {
        "X-Caller": "@callerNumber"
      },
      "body_template": "{\"caller\":\"@callerNumber\",\"session\":\"@sessionId\"}",
      "timeout_ms": 5000,
      "auth": {
        "type": "bearer"
      }
    },
    "created_at": "2019-08-24T14:15:22Z",
    "updated_at": "2019-08-24T14:15:22Z"
  }
}
{
  "error": {
    "code": "validation_failed",
    "message": "Validation failed"
  }
}
{
  "error": {
    "code": "unauthorized",
    "message": "Missing API key"
  }
}
{
  "error": {
    "code": "subscription_required",
    "message": "This feature is not available in your current subscription. Please upgrade to a higher plan"
  }
}
{
  "error": {
    "code": "forbidden",
    "message": "No permission"
  }
}
{
  "error": {
    "code": "not_found",
    "message": "Not found"
  }
}
{
  "error": {
    "code": "conflict",
    "message": "Group is assigned to an assistant"
  }
}
{
  "error": {
    "code": "rate_limit_exceeded",
    "message": "Rate limit exceeded"
  }
}
{
  "error": {
    "code": "internal_error",
    "message": "An unexpected error occurred."
  }
}