Skills
Patch a skill
Patch some fields of a skill and keep the rest.
PATCH
/
api
/
v2
/
skills
/
{name}
from hai_agents import Client
client = Client()
skill = client.skills.patch_skill(
name="extract-table-data",
description="Use when the task asks for data in an HTML table, as JSON or CSV.",
)
print(skill.description)
import { HaiAgentsClient } from "hai-agents";
const client = new HaiAgentsClient();
const skill = await client.skills.patchSkill({
name: "extract-table-data",
description: "Use when the task asks for data in an HTML table, as JSON or CSV.",
});
console.log(skill.description);
curl -X PATCH https://agp.eu.hcompany.ai/api/v2/skills/extract-table-data \
-H "Authorization: Bearer $HAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"description": "Use when the task asks for data in an HTML table, as JSON or CSV."}'
Behavior
Each patch is saved as a new revision. Sendnull to clear an optional field, like source or url_pattern. description and body can’t be null. The merged result is validated like a full update.
Headers
The
ETag of the revision you based this change on, for example "3". If the skill has moved past it, the write fails with 412. Omit it, or send *, to apply your fields to whatever is current.Path parameters
Query parameters
A note stored on the new revision, such as why you made the change. Up to 500 characters. Shown by List revisions.
Request body
Any subset of these skill fields:description, body, source, url_pattern, and compatibility. name can’t change.
Response
200 with the updated skill object, with its new revision in the ETag header.
from hai_agents import Client
client = Client()
skill = client.skills.patch_skill(
name="extract-table-data",
description="Use when the task asks for data in an HTML table, as JSON or CSV.",
)
print(skill.description)
import { HaiAgentsClient } from "hai-agents";
const client = new HaiAgentsClient();
const skill = await client.skills.patchSkill({
name: "extract-table-data",
description: "Use when the task asks for data in an HTML table, as JSON or CSV.",
});
console.log(skill.description);
curl -X PATCH https://agp.eu.hcompany.ai/api/v2/skills/extract-table-data \
-H "Authorization: Bearer $HAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"description": "Use when the task asks for data in an HTML table, as JSON or CSV."}'
Errors
| Status | Cause |
|---|---|
400 | The path carries a name:N pin, or If-Match is not a single revision tag. |
403 | The skill is reserved (h/) and read-only. |
404 | Not found, or not in your organization. |
409 | Without If-Match, the skill kept changing while the patch was merged. Retry. |
412 | If-Match names a revision that isn’t the current one. The ETag header has the current one: read it, reapply your change, and retry. |
422 | The merged spec fails validation, for example description or body set to null or empty. |
Was this page helpful?
⌘I
from hai_agents import Client
client = Client()
skill = client.skills.patch_skill(
name="extract-table-data",
description="Use when the task asks for data in an HTML table, as JSON or CSV.",
)
print(skill.description)
import { HaiAgentsClient } from "hai-agents";
const client = new HaiAgentsClient();
const skill = await client.skills.patchSkill({
name: "extract-table-data",
description: "Use when the task asks for data in an HTML table, as JSON or CSV.",
});
console.log(skill.description);
curl -X PATCH https://agp.eu.hcompany.ai/api/v2/skills/extract-table-data \
-H "Authorization: Bearer $HAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"description": "Use when the task asks for data in an HTML table, as JSON or CSV."}'