Import an agent from AGENTS.md
curl --request POST \
--url https://{host}/v2/workspaces/slug:agent-factory/webhooks/v1/agents/import \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"agents_md": "---\nname: \"_test_import_export_agent\"\ndescription: \"A test agent for import/export round-trip\"\nmodel: \"gpt-4o-mini\"\ntemperature: 0.7\nmax_tokens: 2048\n---\n\nYou are a test assistant created via AGENTS.md import.\n"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
agents_md: '---\nname: "_test_import_export_agent"\ndescription: "A test agent for import/export round-trip"\nmodel: "gpt-4o-mini"\ntemperature: 0.7\nmax_tokens: 2048\n---\n\nYou are a test assistant created via AGENTS.md import.\n'
})
};
fetch('https://{host}/v2/workspaces/slug:agent-factory/webhooks/v1/agents/import', 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/import"
payload = { "agents_md": "---
name: \"_test_import_export_agent\"
description: \"A test agent for import/export round-trip\"
model: \"gpt-4o-mini\"
temperature: 0.7
max_tokens: 2048
---
You are a test assistant created via AGENTS.md import.
" }
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",
"imported": true
}{
"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": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}Agents
Import an agent from AGENTS.md
Parse an AGENTS.md document (YAML front matter + markdown
instructions) and create a new agent from it. Provisions a
service account; failure to provision rolls back the creation.
POST
/
v1
/
agents
/
import
Import an agent from AGENTS.md
curl --request POST \
--url https://{host}/v2/workspaces/slug:agent-factory/webhooks/v1/agents/import \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"agents_md": "---\nname: \"_test_import_export_agent\"\ndescription: \"A test agent for import/export round-trip\"\nmodel: \"gpt-4o-mini\"\ntemperature: 0.7\nmax_tokens: 2048\n---\n\nYou are a test assistant created via AGENTS.md import.\n"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
agents_md: '---\nname: "_test_import_export_agent"\ndescription: "A test agent for import/export round-trip"\nmodel: "gpt-4o-mini"\ntemperature: 0.7\nmax_tokens: 2048\n---\n\nYou are a test assistant created via AGENTS.md import.\n'
})
};
fetch('https://{host}/v2/workspaces/slug:agent-factory/webhooks/v1/agents/import', 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/import"
payload = { "agents_md": "---
name: \"_test_import_export_agent\"
description: \"A test agent for import/export round-trip\"
model: \"gpt-4o-mini\"
temperature: 0.7
max_tokens: 2048
---
You are a test assistant created via AGENTS.md import.
" }
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",
"imported": true
}{
"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": {}
}{
"error": "<string>",
"message": "<string>",
"details": {}
}Authorizations
BearerAuthOrgApiKeyAuth
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
application/json
Full AGENTS.md document (front matter + markdown).
Maximum string length:
200000Was this page helpful?