Ресурс

AI Agent

Manages custom AI agents. Deploy AI agents anywhere and connect them to your project for automated incident management.

Модель AI Agent

Свойства

  • Имя
    _id
    Тип
    Object ID
    Описание

    ID of this object

  • Имя
    createdAt
    Тип
    Date
    Описание

    Date and Time when the object was created.

  • Имя
    updatedAt
    Тип
    Date
    Описание

    Date and Time when the object was updated.

  • Имя
    key
    Тип
    TextОбязательно
    Описание

  • Имя
    name
    Тип
    NameОбязательно
    Описание

  • Имя
    description
    Тип
    Description
    Описание

  • Имя
    slug
    Тип
    SlugОбязательно
    Описание

    Friendly globally unique name for your object

  • Имя
    aiAgentVersion
    Тип
    VersionОбязательно
    Описание

  • Имя
    lastAlive
    Тип
    Date
    Описание

  • Имя
    iconFile
    Тип
    File
    Описание

    AI Agent Icon

  • Имя
    iconFileId
    Тип
    Object ID
    Описание

    AI Agent Icon File ID

  • Имя
    project
    Тип
    Project
    Описание

  • Имя
    projectId
    Тип
    Object ID
    Описание

  • Имя
    createdByUser
    Тип
    User
    Описание

  • Имя
    createdByUserId
    Тип
    Object ID
    Описание

    User ID who created this object (if this object was created by a User)

  • Имя
    connectionStatus
    Тип
    Text
    Описание

    Connection Status of the AI Agent

  • Имя
    isDefault
    Тип
    BooleanОбязательно
    Описание

    Is this the default AI Agent for the project? When set, this agent will be used for automated tasks.

  • Имя
    labels
    Тип
    Label
    Описание

    Relation to Labels Array where this object is categorized in.

GETorPOST/api/ai-agent/get-list

Список

Этот метод возвращает постраничный список ваших объектов «AI Agent». По умолчанию на странице до десяти записей.

Необязательные query-параметры

  • limit
    число
    Сколько объектов вернуть. По умолчанию 10, максимум 100
  • skip
    число
    Сколько объектов пропустить (для пагинации)

Необязательное тело запроса

Запрос списка

POST
/api/ai-agent/get-list?skip=0&limit=10
Заголовки
Content-Type: application/json
ApiKey: YOUR_API_KEY
Тело
{
  "select": {
    "name": true,
    "slug": true,
    "createdByUserId": true,
    "description": true,
    "iconFileId": true
  },
  "query": {
    "key": "Example value"
  },
  "sort": {
    "createdAt": -1
  }
}

Ответ

{
  "count": 10,
  "limit": 10,
  "skip": 0,
  "data": [
    {
      "_id": "37681bd0-28fe-11f1-b591-3fdcef396aba",
      "name": "My AI Agent",
      "slug": "my-ai-agent",
      "createdByUserId": "e5f6a7b8-c9d0-1234-ef12-345678901234",
      "description": "AI agent for automated incident triage and response",
      "iconFileId": "c3d4e5f6-a7b8-9012-cdef-123456789012"
    },
    {
      "_id": "3768df20-28fe-11f1-b591-3fdcef396aba",
      "name": "My AI Agent",
      "slug": "my-ai-agent",
      "createdByUserId": "e5f6a7b8-c9d0-1234-ef12-345678901234",
      "description": "AI agent for automated incident triage and response",
      "iconFileId": "c3d4e5f6-a7b8-9012-cdef-123456789012"
    },
    {
      "_id": "3768df21-28fe-11f1-b591-3fdcef396aba",
      "name": "My AI Agent",
      "slug": "my-ai-agent",
      "createdByUserId": "e5f6a7b8-c9d0-1234-ef12-345678901234",
      "description": "AI agent for automated incident triage and response",
      "iconFileId": "c3d4e5f6-a7b8-9012-cdef-123456789012"
    }
  ]
}
GETorPOST/api/ai-agent/:id/get-item

Получить по ID

Возвращает объект «AI Agent» по идентификатору.

  • id
    строка
    ID объекта

Необязательное тело запроса

  • select
    По умолчанию возвращается только ID; для других полей используйте select. Подробнее: как выбирать поля.

Запрос одного объекта

POST
/api/ai-agent/:id/get-item
Заголовки
Content-Type: application/json
ApiKey: YOUR_API_KEY
Тело
{
  "select": {
    "name": true,
    "slug": true,
    "createdByUserId": true,
    "description": true,
    "iconFileId": true
  }
}

Ответ

{
  "_id": "37681bd0-28fe-11f1-b591-3fdcef396aba",
  "name": "My AI Agent",
  "slug": "my-ai-agent",
  "createdByUserId": "e5f6a7b8-c9d0-1234-ef12-345678901234",
  "description": "AI agent for automated incident triage and response",
  "iconFileId": "c3d4e5f6-a7b8-9012-cdef-123456789012"
}
POST/api/ai-agent/count

Количество

Возвращает количество ваших объектов «AI Agent».

Необязательное тело запроса

Запрос количества

POST
/api/ai-agent/count
Заголовки
Content-Type: application/json
ApiKey: YOUR_API_KEY
Тело
{
  "query": {
    "key": "Example value"
  }
}

Ответ

{
  "count": 107
}
POST/api/ai-agent

Создать AI Agent

Создаёт новый объект.

Запрос создания

POST
/api/ai-agent
Заголовки
Content-Type: application/json
ApiKey: YOUR_API_KEY
Тело
{
  "data": {
    "name": "My AI Agent",
    "createdByUserId": "e5f6a7b8-c9d0-1234-ef12-345678901234",
    "description": "AI agent for automated incident triage and response",
    "iconFileId": "c3d4e5f6-a7b8-9012-cdef-123456789012",
    "projectId": "5f8b9c0d-e1a2-4b3c-8d5e-6f7a8b9c0d1e"
  }
}

Ответ

{
  "_id": "37681bd0-28fe-11f1-b591-3fdcef396aba",
  "name": "My AI Agent",
  "slug": "my-ai-agent",
  "createdByUserId": "e5f6a7b8-c9d0-1234-ef12-345678901234",
  "description": "AI agent for automated incident triage and response",
  "iconFileId": "c3d4e5f6-a7b8-9012-cdef-123456789012"
}
PUT/api/ai-agent/:id

Обновить по ID

Обновляет объект по ID.

Альтернативные методы

Если клиент не поддерживает PUT, используйте POST или GET с теми же заголовками и телом:

POST/api/ai-agent/:id/update-item
GET/api/ai-agent/:id/update-item

Запрос обновления

PUT
/api/ai-agent/:id
Заголовки
Content-Type: application/json
ApiKey: YOUR_API_KEY
Тело
{
  "data": {
    "name": "My AI Agent",
    "description": "AI agent for automated incident triage and response",
    "iconFileId": "c3d4e5f6-a7b8-9012-cdef-123456789012"
  }
}

Ответ

{}
DELETE/api/ai-agent/:id

Удалить по ID

Удаляет объект по ID.

Альтернативные методы

Если клиент не поддерживает DELETE, используйте POST или GET с теми же заголовками и телом:

POST/api/ai-agent/:id/delete-item
GET/api/ai-agent/:id/delete-item

Запрос удаления

DELETE
/api/ai-agent/:id
Заголовки
Content-Type: application/json
ApiKey: YOUR_API_KEY

Ответ

{}

Права доступа

Для операций с ресурсом у ключа API должны быть права. При их отсутствии вернётся ответ 4xx.

Права на чтение

Нужны для чтения AI Agent

  • Public
  • Project Owner
  • Project Admin
  • Project Member
  • Read AI Agent
  • Read All Project Resources

Права на создание

Нужны для создания AI Agent

  • Project Owner
  • Project Admin
  • Project Member
  • Create AI Agent

Права на обновление

Нужны для обновления AI Agent

  • Project Owner
  • Project Admin
  • Project Member
  • Edit AI Agent

Права на удаление

Нужны для удаления AI Agent

  • Project Owner
  • Project Admin
  • Project Member
  • Delete AI Agent