Create a new agent programmatically
api.langdock.com with your deployment’s base URL: <deployment-url>/api/publicAGENT_API scope. Created agents are automatically shared with the API key for use in chat completions.| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Name of the agent (1-80 characters) |
description | string | No | Description of what the agent does (max 500 chars) |
emoji | string | No | Emoji icon for the agent (max 16 chars, e.g., ”🤖“) |
instruction | string | No | System prompt/instructions for the agent (max 40000 chars) |
inputType | string | No | Input type: “PROMPT” or “STRUCTURED” (default: “PROMPT”) |
model | string | No | Model identifier to use (deployment name from the Models API). Uses workspace default if not provided |
creativity | number | No | Temperature between 0-1 (default: 0.3) |
conversationStarters | string[] | No | Array of suggested prompts to help users get started (max 20, each 1-255 chars) |
actions | array | No | Array of action objects for custom integrations |
inputFields | array | No | Array of form field definitions (for STRUCTURED input type) |
attachments | string[] | No | Array of attachment UUIDs to include with the agent |
webSearch | boolean | No | Enable web search capability (default: false) |
imageGeneration | boolean | No | Enable image generation capability (default: false) |
dataAnalyst | boolean | No | Enable code interpreter capability (default: false) |
canvas | boolean | No | Enable canvas capability (default: false) |
actions array should contain:
actionId (required) - UUID of the action from an enabled integrationrequiresConfirmation (optional) - Whether to require user confirmation before executing (default: true)inputType: "STRUCTURED", you can define form fields in the inputFields array:
| Field | Type | Required | Description |
|---|---|---|---|
slug | string | Yes | Unique identifier for the field |
type | string | Yes | Field type (see supported types below) |
label | string | Yes | Display label for the field |
description | string | No | Help text for the field |
required | boolean | No | Whether the field is required (default: false) |
order | number | Yes | Display order (0-indexed) |
options | string[] | No | Options for SELECT type fields |
fileTypes | string | No | Allowed file types for FILE type fields (nullable) |
TEXT - Single line text inputMULTI_LINE_TEXT - Multi-line text areaNUMBER - Numeric inputCHECKBOX - Boolean checkboxFILE - File uploadSELECT - Dropdown selectionDATE - Date pickerattachments array.
createAgents permissioncreatedBy and workspaceId are automatically set from your API keyAPI key as Bearer token. Format "Bearer YOUR_API_KEY"
64163842560 <= x <= 164Array of UUID strings identifying attachments for this message