---
title: "Import skill"
method: POST
path: "/api/skills/import"
tags: ["Skills"]
---

# Import skill

`POST /api/skills/import`

## Request

- Base URL: `https://app.cotool.ai`
- URL: `https://app.cotool.ai/api/skills/import`
- Auth: HTTP bearer

Import a skill package payload and create the skill.

## Request body

- object
  - `name` string, required: Machine-safe skill name used in sandbox paths and imports
  - `userId` string, uuid, nullable: User owner for user-scoped skills; null or omitted creates an organization skill
  - `description` string, required: Description of what this skill teaches an agent to do
  - `instructionPrompt` string, required: Primary instruction prompt content for this skill
  - `requiredTools` string[]: Optional required tool types for this skill
  - `references` object[]: Optional references for initial version creation
    - `filename` string, required: Relative path from skill root
    - `directory` 'references' | 'assets' | 'scripts': Top-level skill directory where this file resides
    - `sizeBytes` integer
    - `content` string, required: File content (empty string allowed)

## Response `200`

Successful response

- object
  - `id` string, required: Unique identifier for the skill
  - `organizationId` string, required: Unique identifier of the organization that owns this skill
  - `name` string, required: Machine-safe skill name used in sandbox paths and imports
  - `description` string, required: Description of what this skill teaches an agent to do
  - `requiredTools` string[], required: Optional required tool types for this skill
  - `userId` string, nullable, required: User ID that owns this user-scoped skill, or null for organization skills
  - `createdByUserId` string, nullable, required: User ID that created this skill, or null for system-created records
  - `updatedByUserId` string, nullable: User ID that last edited this skill, or null for system edits or unknown authorship
  - `createdBy` object, nullable: Display identity of the user that created this skill
    - `name` string, nullable, required: The user's profile display name, falling back to their email
    - `imageUrl` string, nullable, required: The user's profile image URL, if one is available
  - `updatedBy` object, nullable: Display identity of the user that last edited this skill
    - `name` string, nullable, required: The user's profile display name, falling back to their email
    - `imageUrl` string, nullable, required: The user's profile image URL, if one is available
  - `createdAt` string, required: Timestamp when the skill was created
  - `updatedAt` string, required: Timestamp when the skill was last updated
  - `deletedAt` string, nullable, required: Timestamp when the skill was soft-deleted, or null if active
  - `source` union, required: Origin and ownership semantics for this skill
    - object
      - `type` 'user-generated', required
    - object
      - `type` 'gitops', required
      - `syncSource` string, required: Sync backend managing this skill
    - object
      - `type` 'system-generated', required
    - object
      - `type` 'integration', required
      - `toolType` string, required: Parent integration type
  - `displayName` string: Human-readable skill name when it differs from the machine-safe name
  - `usedByAgentCount` number: How many agents currently use this skill
  - `invocationCount30d` number: Distinct chats in the last 30 days where an agent read this skill from the sandbox
  - `currentVersion` number: Current version number of this skill
  - `instructionPrompt` string, required: Primary instruction prompt content for this skill
  - `references` object[]: Resource files for the active/current version
    - `id` string, uuid, required: Unique identifier for the reference file record
    - `skillVersionId` string, uuid, required: Version ID this reference belongs to
    - `filename` string, required: Relative path from skill root (for example references/guide.md)
    - `directory` 'references' | 'assets' | 'scripts', required: Top-level skill directory where this file resides
    - `sizeBytes` integer, required: UTF-8 byte size of the file content
    - `content` string: Optional file content (included in version detail / export flows)
    - `createdAt` string: Timestamp when this file was stored

## Other responses

- `400`: Bad request — input validation failed or the request was malformed
- `401`: Unauthorized — missing or invalid API key / session
- `403`: Forbidden — the authenticated user lacks the required permissions
- `500`: Internal server error

---

[API](https://skmtc.dev/cotool/apis/cotool-api.md) - [All operations](https://skmtc.dev/cotool/apis/cotool-api/llms.txt) - [OpenAPI document](https://skmtc.dev/cotool/apis/cotool-api/revisions/f5abe0add203?raw)
