Skip to main content

Skills API and SDK reference

Beta

This feature is in Beta. Account admins can manage access to this feature from the account console Previews page. See Manage account-level previews.

Use these examples to automate skill management. The API represents each skill as a Skill resource named skills/{catalog}.{schema}.{skill}. To author and publish a skill with an agent, see Create and share skills. For privileges and governance, see Govern skills. Skills don't have Terraform or Declarative Automation Bundles resources.

Prerequisites​

  • Set up a governed schema for skills.

  • Have the required permissions for your operation.

  • Install and authenticate the client you plan to use. The REST API has no version requirement; each tool and SDK has a minimum version:

    SDK snippets assume an authenticated workspace client, w; Modular SDK snippets assume an authenticated Unity Gateway client, c in Go and client in JavaScript.

API operations​

The Skills REST API provides these operations. Each also requires USE CATALOG and USE SCHEMA on the parent. Follow each link for its fields, permissions, and responses.

Operation

Use case

Required permissions

Create

Create a skill and provision its bundle storage.

CREATE VOLUME on the schema

Upload

Upload SKILL.md and any supporting files through the Files API.

WRITE VOLUME and READ VOLUME on the skill

Finalize

Read and validate SKILL.md, then set the skill's bundle name and description.

READ VOLUME on the skill

List

Find skills you can access in a schema.

READ VOLUME, READ METADATA, or MANAGE on the skill

Get

Read a skill's metadata and current etag.

READ VOLUME, READ METADATA, or MANAGE on the skill

Update

Change the skill's comment.

MANAGE on the skill

Delete

Remove a skill and its bundle.

MANAGE on the skill

Operation

Use case

Required permissions

Create

Create a skill and provision its bundle storage.

CREATE VOLUME on the schema

Upload

Upload SKILL.md and any supporting files through the Files API.

WRITE VOLUME and READ VOLUME on the skill

Finalize

Read and validate SKILL.md, then set the skill's bundle name and description.

READ VOLUME on the skill

List

Find skills you can access in a schema.

READ VOLUME, READ METADATA, or MANAGE on the skill

Get

Read a skill's metadata and current etag.

READ VOLUME, READ METADATA, or MANAGE on the skill

Update

Change the skill's comment.

MANAGE on the skill

Delete

Remove a skill and its bundle.

MANAGE on the skill

The skill's owner holds all of these on the skill. See Grant access to skills.

Create a skill​

Creating a skill takes three steps: create the skill, upload its bundle, then finalize it. Until you finalize a skill, its bundle name and description are empty.

Step 1: Create the skill​

Create the skill in a schema. comment is the only field you can set. Databricks derives name, bundle_name, and description.

Replace main.default.my_skill and data-team with your own values.

Send a POST to /api/2.1/unity-catalog/skills, passing parent and skill_id as query parameters:

Bash
databricks api post \
"/api/2.1/unity-catalog/skills?parent=schemas/main.default&skill_id=my_skill" \
--json '{"comment": "Team-shared math helper skill"}'

Step 2: Upload the bundle​

Upload SKILL.md, and any supporting files, to the skill's storage path, /Skills/<catalog>/<schema>/<skill>/, through the Files API. SKILL.md must start with YAML frontmatter that sets name and description. Save this example as SKILL.md:

Markdown
---
name: my-skill
description: A team-shared skill that helps with basic math.
---

# My Skill

Step-by-step guidance the agent follows when this skill is loaded.

Send a PUT to the Files API. Set DATABRICKS_HOST to your workspace URL, such as https://my-workspace.cloud.databricks.com, and DATABRICKS_TOKEN to a token. This example passes the token to curl on standard input so it doesn't appear in the process list:

Bash
curl --request PUT --config - --data-binary @SKILL.md \
--header "Content-Type: application/octet-stream" \
"${DATABRICKS_HOST}/api/2.0/fs/files/Skills/main/default/my_skill/SKILL.md?overwrite=true" \
<<< "header = \"Authorization: Bearer ${DATABRICKS_TOKEN}\""

Step 3: Finalize the skill​

Finalizing reads and validates SKILL.md, then sets the skill's bundle_name and description from its frontmatter. If you change the bundle later, finalize again.

Bash
databricks api post "/api/2.1/unity-catalog/skills/main.default.my_skill/finalize" --json '{}'

Find a skill​

List the skills you can access in a schema, then get a skill's metadata by its resource name.

Bash
databricks api get "/api/2.1/unity-catalog/skills?parent=schemas/main.default"

databricks api get "/api/2.1/unity-catalog/skills/main.default.my_skill"

When the list response includes next_page_token, pass it as page_token in the next request. Continue until next_page_token is absent or empty.

The CLI and Python iterator handle pagination for you.

Grant access​

These examples grant READ VOLUME on the skill, which lets the principal read the skill and download its bundle. For the other skill privileges, see Grant access to skills.

Bash
databricks api patch \
"/api/2.1/unity-catalog/permissions/skill/main.default.my_skill" \
--json '{
"changes": [
{ "principal": "data-team", "add": ["READ_VOLUME"] }
]
}'

Update a skill​

These examples update the skill's comment, the only field you can change. The skill's name can't be changed. To change a skill's contents, upload the new bundle and finalize the skill again.

For a conditional update, first get the skill and pass its etag with the update. The update succeeds only if the skill hasn't changed since that read. URL-encode the etag when adding it to a REST query string.

Bash
databricks api patch \
"/api/2.1/unity-catalog/skills/main.default.my_skill?update_mask=comment" \
--json '{"comment": "Updated: team-shared math helper"}'

Delete a skill​

Deleting a skill removes it and its bundle. Agents can no longer load it.

You can also pass the skill's current etag to make deletion conditional on it not having changed since the last read. URL-encode the etag in REST query strings.

Bash
databricks api delete "/api/2.1/unity-catalog/skills/main.default.my_skill"

Additional resources​