Assistant Create API
Create a new Assistant programmatically
Creates a new Assistant in your workspace programmatically. The created assistant can be used via the chat completions endpoint or accessed through the Langdock UI.Documentation Index
Fetch the complete documentation index at: https://docs.langdock.com/llms.txt
Use this file to discover all available pages before exploring further.
AGENT_API scope. Created Assistants are automatically shared with the API key for use in chat completions.Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Name of the Assistant (1-80 characters) |
description | string | No | Description of what the Assistant does (max 500 chars) |
emoji | string | No | Emoji icon for the Assistant (e.g., ”🤖“) |
instruction | string | No | System prompt/instructions for the Assistant (max 40000 chars) |
inputType | string | No | Input type: “PROMPT” or “STRUCTURED” (default: “PROMPT”) |
model | string | No | Model identifier (deployment name from the Models API) |
creativity | number | No | Temperature between 0-1 (default: 0.3) |
conversationStarters | string[] | No | Array of suggested prompts to help users get started |
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 Assistant |
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) |
extendedThinking | boolean | No | Enable extended thinking mode (default: false) |
Actions Configuration
Each action in theactions array should contain:
actionId(required) - UUID of the action from an enabled integrationrequiresConfirmation(optional) - Whether to require user confirmation before executing (default: true)
Input Fields Configuration
When usinginputType: "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 |
emailDomain | string | No | Allowed email domain for EMAIL type fields |
TEXT- Single line text inputMULTI_LINE_TEXT- Multi-line text areaNUMBER- Numeric inputCHECKBOX- Boolean checkboxFILE- File uploadSELECT- Dropdown selectionDATE- Date pickerEMAIL- Email address
Obtaining Attachment IDs
To include attachments with your Assistant, first upload files using the Upload Attachment API. This will return attachment UUIDs that you can include in theattachments array.
Examples
Creating a Basic Assistant
Validation Rules
The API enforces several validation rules:- Model - Must be in your workspace’s active models list
- Actions - Must belong to integrations enabled in your workspace
- Attachments - Must exist in your workspace and not be deleted
- Permissions - Your API key must have the
createAssistantspermission - Name - Must be between 1-80 characters
- Description - Maximum 500 characters
- Instruction - Maximum 40000 characters
- Creativity - Must be between 0 and 1
Important Notes
- Created Assistants are automatically shared with your API key for use in chat completions
- The API key creator becomes the owner and can manage the Assistant in the UI
- Attachments are bidirectionally linked to the Assistant
- The Assistant type is set to
AGENT(notWORKFLOWorPROJECT) createdByandworkspaceIdare automatically set from your API key
Response Format
Success Response (201 Created)
Error Handling
Migrating to Agents API
The new Agents API offers improved compatibility with modern AI SDKs. The create endpoint has similar functionality with updated parameter names. See the equivalent endpoint in the Agents API:- Agent Create API - Uses
agentIdinstead ofassistantId
Authorizations
API key as Bearer token. Format "Bearer YOUR_API_KEY"
Body
Name of the agent
1 - 255Description of what the agent does
256Emoji icon for the agent (e.g., "🤖")
System prompt/instructions for the agent
16384Input type for the agent
PROMPT, STRUCTURED Model ID to use (see Models for Agent API)
Temperature for response generation
0 <= x <= 1Array of suggested prompts to help users get started
Array of action objects for custom integrations
Array of form field definitions (for STRUCTURED input type)
Array of attachment UUIDs to include with the agent
Enable web search capability
Enable image generation capability
Enable code interpreter capability
Enable canvas capability