> ## Documentation Index
> Fetch the complete documentation index at: https://hub.hcompany.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Create a skill

> Create a reusable skill in your catalog.

Creates a new skill in your catalog. Returns `201`.

**Returns** the created [Skill](/computer-use-agents/skills/overview) object.

***

## Request body

The body is the [Skill](/computer-use-agents/skills/overview) object. See that page for the full meaning of each field; the constraints that matter when creating one are below.

<ParamField body="name" type="string" required>
  Catalog identifier, kebab-case with an optional single `org/` namespace prefix. The `h/` prefix is reserved for H's catalog (rejected with `403`) and marks the skill as reserved; any other name creates a custom skill, private to your organization. Immutable after creation.
</ParamField>

<ParamField body="description" type="string" required>
  One-line routing hint used for discovery. Non-empty.
</ParamField>

<ParamField body="body" type="string" required>
  The Markdown prompt fragment the agent receives at runtime. Non-empty.
</ParamField>

<ParamField body="source" type="string">
  Optional provenance URL.
</ParamField>

<ParamField body="url_pattern" type="string">
  Optional, informational regex hinting at URLs where this skill applies. 1 to 1024 characters.
</ParamField>

***

## Examples

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://agp.eu.hcompany.ai/api/v2/skills \
    -H "Authorization: Bearer $HAI_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "name": "extract-table-data",
      "description": "Extract structured data from HTML tables into JSON.",
      "body": "When you encounter an HTML table, extract all rows and columns into a JSON array of objects. Each object should use the table headers as keys.",
      "source": "https://github.com/myorg/skills"
    }'
  ```

  ```python Python theme={null}
  from hai_agents import Client

  client = Client()

  skill = client.skills.create_skill(
      name="extract-table-data",
      description="Extract structured data from HTML tables into JSON.",
      body="When you encounter an HTML table, extract all rows and columns into a JSON array of objects. Each object should use the table headers as keys.",
      source="https://github.com/myorg/skills",
  )
  print(skill.name)
  ```

  ```typescript TypeScript theme={null}
  import { HaiAgentsClient } from "hai-agents";

  const client = new HaiAgentsClient();

  const skill = await client.skills.createSkill({
    name: "extract-table-data",
    description: "Extract structured data from HTML tables into JSON.",
    body: "When you encounter an HTML table, extract all rows and columns into a JSON array of objects. Each object should use the table headers as keys.",
    source: "https://github.com/myorg/skills",
  });
  console.log(skill.name);
  ```
</CodeGroup>

```json Response theme={null}
{
  "name": "extract-table-data",
  "description": "Extract structured data from HTML tables into JSON.",
  "body": "When you encounter an HTML table...",
  "source": "https://github.com/myorg/skills",
  "url_pattern": null
}
```

***

## Errors

| Status | Cause                                                                    |
| ------ | ------------------------------------------------------------------------ |
| `403`  | Attempted to use the reserved `h/` namespace.                            |
| `409`  | A skill with this name already exists in your catalog.                   |
| `422`  | Body fails validation; common cases: empty `body`, invalid `name` shape. |
