curl --request POST \
--url https://{host}/v2/workspaces/slug:agent-factory/webhooks/v1/agents \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"instructions": "You are a helpful test assistant."
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({instructions: 'You are a helpful test assistant.'})
};
fetch('https://{host}/v2/workspaces/slug:agent-factory/webhooks/v1/agents', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://{host}/v2/workspaces/slug:agent-factory/webhooks/v1/agents"
payload = { "instructions": "You are a helpful test assistant." }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "<string>",
"name": "<string>",
"status": "draft",
"serviceAccountId": "<string>",
"createdAt": "2023-11-07T05:31:56Z"
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}Create a new agent
Create a new agent in the caller’s organization. The agent starts
in draft status and private visibility. A service account is
provisioned automatically; failure to provision rolls back the
creation.
curl --request POST \
--url https://{host}/v2/workspaces/slug:agent-factory/webhooks/v1/agents \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"instructions": "You are a helpful test assistant."
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({instructions: 'You are a helpful test assistant.'})
};
fetch('https://{host}/v2/workspaces/slug:agent-factory/webhooks/v1/agents', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://{host}/v2/workspaces/slug:agent-factory/webhooks/v1/agents"
payload = { "instructions": "You are a helpful test assistant." }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "<string>",
"name": "<string>",
"status": "draft",
"serviceAccountId": "<string>",
"createdAt": "2023-11-07T05:31:56Z"
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}Authorizations
User-bound credential carrying an identity: either a session JWT
or a user access token (at:*) generated from the user settings UI.
Send as Authorization: Bearer <token>.
Org API keys (iak_*) are not accepted here - they carry
no user identity. Use the x-prismeai-api-key header instead
(see OrgApiKeyAuth).
Body
System prompt / agent instructions.
100000256Plain string, or an object of per-locale strings.
4096128simple, workflow, agent_light, agent_full, orchestrator 64Conversation starter prompts (max 10).
Persisted only when provided; otherwise the workspace default applies (max_turns has no profile default). 0 and negative values are rejected.
x >= 1Overrides the profile default when provided.
Overrides the profile default when provided.
Hide child attributes
Hide child attributes
file_search, mcp, function ^[a-zA-Z0-9_-]+$Required for file_search.
MCP server URL (for mcp).
Required for function.
JSON Schema describing the function tool's parameters.
Controls whether the model can use a given tool on a given turn.
user_first tools are replaced by a same-named, schema-less stub with
a "disabled" description on each turn, unless the user explicitly
summons the tool from the chat input via metadata.tool_choice.
Eligible tool types: function and mcp. file_search, skill,
guardrail, and system types are exempt and always behave as auto.
Was this page helpful?