İçeriğe geç
ajan.io

Belgeler menüsü

Bu sayfada

Beceriyi Güncelle

Mevcut bir Beceriyi güncelleyin

Çalışma alanınızdaki mevcut bir Beceriyi günceller. Yalnızca değiştirmek istediğiniz alanları ekleyin.

Temel URL

https://api.ajan.io/skills/v1/{skillId}

Özel dağıtımlar Tüm isteklerde api.ajan.com'i /api/public ile değiştirin.

Gerekli Kapsamlar

Bu uç nokta SKILL_API kapsamını gerektirir.

Beceriye editör erişimi gerektirir.

Parametreler

Yol Parametreleri

ParametreTürGerekliAçıklama
skillIddizeEvetGüncellenecek Yeteneğin UUID'si.

İstek Gövdesi

ParametreTürAçıklama
namedizeBeceri adı. Maksimum: 64 karakter.
slugdizeKararlı Beceri sümüklüböceği. Küçük harf, rakam ve kısa çizgi kullanılmalıdır. Maksimum: 100 karakter.
descriptiondizeAçıklama, Becerinin ne zaman uygulanması gerektiğini açıklamak için kullanılır. Maksimum: 1024 karakter.
instructionsdizeBeceri talimatları. Maksimum: 50000 karakter.
integrationIdsdize\[]Beceriye eklenecek entegrasyon UUID'leri. Geçerli entegrasyon listesinin yerini alır. Her entegrasyonun çalışma alanınızda etkinleştirilmesi gerekir.

Örnek

javascript
const axios = require("axios");

async function updateSkill(skillId) {
  const response = await axios.patch(
    `https://api.ajan.io/skills/v1/${skillId}`,
    {
      description: "Applies the support team's latest tone and escalation rules.",
      instructions: "Write concise replies, include the next best action, and escalate billing or security issues to the account owner."
    },
    {
      headers: {
        Authorization: "Bearer YOUR_API_KEY",
        "Content-Type": "application/json"
      }
    }
  );

  console.log("Updated Skill:", response.data.skill.updatedAt);
}

updateSkill("550e8400-e29b-41d4-a716-446655440000");

Yanıt Formatı

Başarılı Yanıt (200 Tamam)

typescript
{
  skill: {
    id: string;
    name: string;
    slug: string;
    description: string;
    instructions: string;
    integrationIds: string[];
    createdAt: string;
    updatedAt: string;
  };
}

Hata İşleme

Durum KoduAçıklama
400Geçersiz istek gövdesi, eksik güncelleme alanları veya erişilemiyor integrationIds
401Geçersiz veya eksik API anahtarı
403SKILL_API kapsamı, Beceri ürün erişimi veya düzenleyici erişimi eksik
404Beceri bulunamadı
409Beceri sümüklü böcek çatışması
429Oran sınırı aşıldı
500Dahili sunucu hatası

ajan, API anahtarınızı korumak ve uygulamalarınızın güvende kalmasını sağlamak için tarayıcı kaynaklı istekleri kasıtlı olarak engeller. Daha fazla bilgi için lütfen API Key Best Practices hakkındaki kılavuzumuza bakın.

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/{skillId}:
    patch:
      tags:
        - Skills
      summary: Update a Skill
      description: Updates an existing Skill in your workspace.
      operationId: updateSkill
      parameters:
        - $ref: '#/components/parameters/SkillId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateSkillRequest'
      responses:
        '200':
          description: Skill updated 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 editor access
        '404':
          description: Skill not found
        '409':
          description: Skill slug conflict
        '429':
          description: Rate limit exceeded
        '500':
          description: Internal server error
components:
  parameters:
    SkillId:
      name: skillId
      in: path
      required: true
      description: UUID of the Skill.
      schema:
        type: string
        format: uuid
  schemas:
    UpdateSkillRequest:
      type: object
      minProperties: 1
      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. Replaces the current
            integration list.
    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"