Agents

Welcome recording

Play your own audio the instant the caller picks up, instead of the agent speaking its opening line.

Useful when the first thing a caller hears has to be exact every time — a brand intro, a recorded disclosure, a voice artist's greeting.

AI    ▸ your recording plays
CALLER▸ says whatever they say
AI    ▸ the agent picks up the conversation

The caller is listened to the whole time the recording plays — they're never cut off, and nothing they say is lost. The moment the audio ends, the agent hears it and replies.


1. Upload the audio

curl -X POST https://platform.eurekatechlabs.com/v1/welcome-messages \
  -H "Authorization: Bearer ek_live_YOUR_KEY" \
  -F "name=Clinic greeting" \
  -F "file=@greeting.wav"

Response — 201:

{
  "id": "wm_xxxxxxxxxxxx",
  "name": "Clinic greeting",
  "status": "ready",
  "sourceUrl": "https://.../welcome/.../source.wav",
  "transcript": "Thanks for calling Sharma Dental, how can I help?",
  "durationMs": 4200,
  "error": null,
  "createdAt": "2025-05-26T10:30:00Z"
}

Upload is synchronous — we convert the audio and transcribe it before answering, so status is already final. ready means it's usable.

Rule Limit
Format mp3, wav, m4a
Length 30 seconds max
Size 5 MB max

Keep it short. The caller can't get anything done until it finishes, and they will not wait through thirty seconds of branding.


2. Attach it to an agent

Set welcomeMessageId in the agent config:

{
  "model": "nirwana-1-flash",
  "voiceId": "asha",
  "systemPrompt": "You are the receptionist for Sharma Dental.",
  "welcomeMessageId": "wm_xxxxxxxxxxxx"
}

That's it. Works on saved agents and inline agents, on outbound and inbound calls, and over the Voice Socket.


It replaces `firstMessage`

An agent opens a call one way. With a welcomeMessageId set, the recording plays and firstMessage is not spoken — you don't need to remove it, and it's still there if you switch back.

The agent is told what the recording said, so it won't greet you a second time. That's what the transcript on the upload is for.

You set The caller hears
firstMessage only The agent speaks it, in its own voice.
welcomeMessageId only Your recording.
Both Your recording. firstMessage is ignored.
Neither Nothing — the agent waits for the caller to speak first.

Attaching a welcome message that isn't ready is rejected when you save the agent, not silently at call time.


In the transcript

The recording appears as the first assistant turn, tagged so you can tell it from speech the agent generated:

"transcript": [
  {
    "role": "assistant",
    "text": "Thanks for calling Sharma Dental, how can I help?",
    "timestamp": "2025-05-26T10:32:01.2Z",
    "source": "pre_recorded_greeting"
  },
  { "role": "user", "text": "Hi, I need to book a cleaning.", "timestamp": "2025-05-26T10:32:06.9Z" }
]

source only appears on a pre-recorded greeting — ordinary agent turns don't carry it. It's in the call.ended payload and in the stored call record.

The recording is part of the call recording too, the same as anything else the caller heard.

On the Voice Socket, the greeting is not sent as a live transcript frame — it appears in the final transcript and in call.ended.


Managing them

# List everything in your product
curl https://platform.eurekatechlabs.com/v1/welcome-messages \
  -H "Authorization: Bearer ek_live_YOUR_KEY"

# Fetch one
curl https://platform.eurekatechlabs.com/v1/welcome-messages/wm_xxxxxxxxxxxx \
  -H "Authorization: Bearer ek_live_YOUR_KEY"

# Retire one
curl -X DELETE https://platform.eurekatechlabs.com/v1/welcome-messages/wm_xxxxxxxxxxxx \
  -H "Authorization: Bearer ek_live_YOUR_KEY"

Uploading and deleting need the agents:write scope; reading needs agents:read.

Deleting is safe. Agents already saved with a recording keep playing it — the audio is stored with each saved version of the agent. A deleted recording just stops appearing in the list and can no longer be attached to anything new. To actually change what a live agent plays, upload a new recording and point the agent at it.


If something goes wrong

A rejected upload tells you why, and nothing is stored:

{ "error": "VALIDATION_ERROR", "message": "the recording is 45.0s; the limit is 30s" }

If the audio can't be fetched when a call starts, the call still connects — the agent falls back to speaking firstMessage if you've set one, so a caller never picks up to silence. This is the one case where keeping a firstMessage alongside a recording earns its place.


Next