Skip to main content
POST
/
v1
/
links
Create Link
curl --request POST \
  --url https://api.agenthuman.com/v1/links \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "agent_id": "<string>",
  "name": "<string>",
  "expires_at": "<string>",
  "use_limit": 123
}
'
{
  "success": true,
  "link": {
    "link_id": "lnk_01J8ZK4R2N5M6P7Q8W4T",
    "name": "Product Demo",
    "url": "https://app.agenthuman.com/s/lnk_01J8ZK4R2N5M6P7Q8W4T",
    "agent": {
      "agent_id": "agnt_01J8ZK4R2N5M6P7Q8W4T",
      "name": "Support Agent",
      "avatar_image_url": "https://cdn.example.com/avatars/support.jpg",
      "created_at": "2024-01-15T10:00:00Z",
      "voice_agent": {
        "provider": "ElevenLabs",
        "agent_id": "el_agent_xxxxxxxxxxxxxxxx",
        "auth_method": "public"
      }
    },
    "status": "active",
    "uses": 0,
    "use_limit": 100,
    "created_at": "2024-01-15T10:30:00Z",
    "expires_at": "2024-02-15T10:30:00Z"
  }
}
What This Does: Generates a public URL that anyone can visit to start a session with the specified agent. You can set an expiry date and a maximum number of sessions.

Body

agent_id
string
required
The ID of the agent this link points to (starts with agnt_). Must belong to the authenticated user.
name
string
A friendly display name for the link (e.g. "Product Demo", "Support Bot Q1"). Optional — if not provided, a default name is generated based on the current date.
expires_at
string
ISO 8601 timestamp after which the link stops accepting sessions. Optional — omit for a link that never expires.
use_limit
number
Maximum number of sessions this link can start. Must be a positive integer. Optional — omit for unlimited sessions.

Response

success
boolean
Whether the link was created successfully.
The created Link object, including the nested Agent.
{
  "success": true,
  "link": {
    "link_id": "lnk_01J8ZK4R2N5M6P7Q8W4T",
    "name": "Product Demo",
    "url": "https://app.agenthuman.com/s/lnk_01J8ZK4R2N5M6P7Q8W4T",
    "agent": {
      "agent_id": "agnt_01J8ZK4R2N5M6P7Q8W4T",
      "name": "Support Agent",
      "avatar_image_url": "https://cdn.example.com/avatars/support.jpg",
      "created_at": "2024-01-15T10:00:00Z",
      "voice_agent": {
        "provider": "ElevenLabs",
        "agent_id": "el_agent_xxxxxxxxxxxxxxxx",
        "auth_method": "public"
      }
    },
    "status": "active",
    "uses": 0,
    "use_limit": 100,
    "created_at": "2024-01-15T10:30:00Z",
    "expires_at": "2024-02-15T10:30:00Z"
  }
}