Skills
Restore a skill revision
Restore an earlier revision’s content as a new revision.
POST
/
api
/
v2
/
skills
/
{name}
/
revisions
/
{number}
/
restore
from hai_agents import Client
client = Client()
skill = client.skills.restore_skill_revision(name="acme/excel", number=1, if_match='"2"')
print(skill.body)
import { HaiAgentsClient } from "hai-agents";
const client = new HaiAgentsClient();
const skill = await client.skills.restoreSkillRevision({ name: "acme/excel", number: 1, ifMatch: '"2"' });
console.log(skill.body);
curl -X POST https://agp.eu.hcompany.ai/api/v2/skills/acme/excel/revisions/1/restore \
-H "Authorization: Bearer $HAI_API_KEY" \
-H 'If-Match: "2"'
{
"name": "acme/excel",
"description": "Use when the task reads or edits an Excel workbook.",
"body": "Read each sheet as a table, with the header row as keys.",
"source": null,
"url_pattern": null,
"compatibility": null,
"files": {},
"executable_files": []
}
Behavior
History is never rewritten: the content of revisionnumber becomes the skill’s next revision, with the message Restored from vN and restored_from set to N. Agents use it from their next session, except those pinned to another revision with name:N. Restoring content equal to the current one changes nothing.
The restored content is checked like an update.
Headers
string
The
ETag of the revision you based this rollback on, for example "2". If the skill has moved past it, the restore fails with 412. Omit it, or send *, to restore regardless.Path parameters
string
required
The skill’s
name, for example acme/excel or extract-table-data.integer
required
The revision to restore, from List revisions.
Response
200 with the restored skill object, with its new revision in the ETag header.
from hai_agents import Client
client = Client()
skill = client.skills.restore_skill_revision(name="acme/excel", number=1, if_match='"2"')
print(skill.body)
import { HaiAgentsClient } from "hai-agents";
const client = new HaiAgentsClient();
const skill = await client.skills.restoreSkillRevision({ name: "acme/excel", number: 1, ifMatch: '"2"' });
console.log(skill.body);
curl -X POST https://agp.eu.hcompany.ai/api/v2/skills/acme/excel/revisions/1/restore \
-H "Authorization: Bearer $HAI_API_KEY" \
-H 'If-Match: "2"'
{
"name": "acme/excel",
"description": "Use when the task reads or edits an Excel workbook.",
"body": "Read each sheet as a table, with the header row as keys.",
"source": null,
"url_pattern": null,
"compatibility": null,
"files": {},
"executable_files": []
}
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. Also sent for an unknown revision. |
410 | The revision’s stored content fails current validation. |
412 | If-Match names a revision that isn’t the current one. The ETag header has the current one. |
Was this page helpful?
⌘I
from hai_agents import Client
client = Client()
skill = client.skills.restore_skill_revision(name="acme/excel", number=1, if_match='"2"')
print(skill.body)
import { HaiAgentsClient } from "hai-agents";
const client = new HaiAgentsClient();
const skill = await client.skills.restoreSkillRevision({ name: "acme/excel", number: 1, ifMatch: '"2"' });
console.log(skill.body);
curl -X POST https://agp.eu.hcompany.ai/api/v2/skills/acme/excel/revisions/1/restore \
-H "Authorization: Bearer $HAI_API_KEY" \
-H 'If-Match: "2"'
{
"name": "acme/excel",
"description": "Use when the task reads or edits an Excel workbook.",
"body": "Read each sheet as a table, with the header row as keys.",
"source": null,
"url_pattern": null,
"compatibility": null,
"files": {},
"executable_files": []
}