Skip to main content

Skills

A Skill gives an agent instructions for its task. The agent uses its bound AI resource for the model and base instructions. The runtime adds the Skill's Markdown to those instructions.

Create a Skill​

POST https://app.predictabledialogs.com/v1/skills

Creates a Skill and attaches it to the specified agent. The runtime uses it as the default Skill for a new chat turn.

For a complete setup:

  1. Create an agent with POST /v1/agents. Save the returned data.id.
  2. Create an AI resource with POST /v1/ai, then attach it to the agent.
  3. Create the Skill using the agent's data.id. You can also create the Skill before attaching the AI resource.
FieldTypeRequiredDescription
agentIdstringYesThe agent's data.id from the Agents API.
skillMarkdownstringYesNonblank Markdown instructions, up to 20,000 characters.

Example request​

curl -X POST https://app.predictabledialogs.com/v1/skills \
-H "Authorization: Bearer $PD_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"agentId": "cmp0ss8n40005wlwnh9wi6u99",
"skillMarkdown": "## Support\nAsk for the order number before helping with order status."
}'

Response​

Returns 201 Created with the new Skill and its generated name.

{
"data": {
"id": "cmp0ws9yx000iwqpfq37mts20",
"agentId": "cmp0ss8n40005wlwnh9wi6u99",
"name": "My-Website-Chatbot-primary-skill",
"skillMarkdown": "## Support\nAsk for the order number before helping with order status."
}
}
StatusMeaning
400The agent ID or Skill Markdown is invalid.
401The bearer token is missing or invalid.
403The delegated OAuth token lacks the pd:write scope.
404The agent could not be found in the token's organization.
409The agent already has an enabled required Skill. The existing Skill is preserved.
429The request exceeded the rate limit.