Create Skill
Create a new Skill in your workspace
Creates a Skill in your workspace. The API key creator becomes the Skill owner and can manage it in the UI. System Skills, templates, and Skill Packs are excluded.
Base URL
https://api.ajan.io/skills/v1Required Scopes
This endpoint requires the SKILL_API scope.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Skill name. Maximum: 64 characters. |
slug | string | No | Stable Skill slug. Must use lowercase letters, numbers, and dashes. Maximum: 100 characters. |
description | string | No | Description used to explain when the Skill should apply. Maximum: 1024 characters. |
instructions | string | Yes | Skill instructions. Maximum: 50000 characters. |
integrationIds | string\[] | No | Integration UUIDs to attach to the Skill. Each integration must be enabled in your workspace. |
Example
javascript
const axios = require("axios");
async function createSkill() {
const response = await axios.post(
"https://api.ajan.io/skills/v1",
{
name: "Support Reply Style",
slug: "support-reply-style",
description: "Applies the support team's tone and escalation rules.",
instructions: "Write concise replies, include the next best action, and escalate billing issues to the account owner.",
integrationIds: []
},
{
headers: {
Authorization: "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
}
}
);
console.log("Created Skill:", response.data.skill.id);
}
createSkill();Response Format
Success Response (201 Created)
typescript
{
skill: {
id: string;
name: string;
slug: string;
description: string;
instructions: string;
integrationIds: string[];
createdAt: string;
updatedAt: string;
};
}Error Handling
| Status Code | Description |
|---|---|
| 400 | Invalid request body or inaccessible integrationIds |
| 401 | Invalid or missing API key |
| 403 | Missing SKILL_API scope, Skills product access, or create permission |
| 409 | Skill slug conflict |
| 429 | Rate limit exceeded |
| 500 | Internal server error |
OpenAPI
openapi: 3.0.0
info:
title: ajan API
version: 3.0.0
servers:
- url: https://api.ajan.io
description: Production
security:
- bearerAuth: []
paths:
/skills/v1:
post:
tags:
- Skills
summary: Create a Skill
description: Creates a Skill in your workspace.
operationId: createSkill
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CreateSkillRequest'
responses:
'201':
description: Skill created successfully
content:
application/json:
schema:
$ref: '#/components/schemas/SkillResponse'
'400':
description: Invalid request body
'401':
description: Invalid or missing API key
'403':
description: Missing required scope or create permission
'409':
description: Skill slug conflict
'429':
description: Rate limit exceeded
'500':
description: Internal server error
components:
schemas:
CreateSkillRequest:
type: object
required:
- name
- instructions
additionalProperties: false
properties:
name:
type: string
maxLength: 64
minLength: 1
description: Skill name.
slug:
type: string
maxLength: 100
pattern: ^[a-z0-9-]+$
description: Stable Skill slug.
description:
type: string
maxLength: 1024
description: Description used to explain when the Skill should apply.
instructions:
type: string
maxLength: 50000
minLength: 1
description: Skill instructions.
integrationIds:
type: array
items:
type: string
format: uuid
description: Integration IDs to attach to the Skill.
SkillResponse:
type: object
required:
- skill
properties:
skill:
$ref: '#/components/schemas/Skill'
Skill:
type: object
required:
- id
- name
- slug
- description
- instructions
- integrationIds
- createdAt
- updatedAt
properties:
id:
type: string
format: uuid
description: Unique identifier for the Skill.
name:
type: string
maxLength: 64
description: Skill name.
slug:
type: string
maxLength: 100
pattern: ^[a-z0-9-]+$
description: Stable Skill slug.
description:
type: string
maxLength: 1024
description: Description used to explain when the Skill should apply.
instructions:
type: string
maxLength: 50000
description: Skill instructions.
integrationIds:
type: array
items:
type: string
format: uuid
description: >-
Integration IDs attached to the Skill. Each integration must be
enabled in your workspace.
createdAt:
type: string
format: date-time
description: ISO 8601 timestamp for Skill creation.
updatedAt:
type: string
format: date-time
description: ISO 8601 timestamp for the latest Skill update.
securitySchemes:
bearerAuth:
type: http
scheme: bearer
bearerFormat: API Key
description: API key as Bearer token. Format "Bearer YOUR_API_KEY"