---
title: "Схемы API: часть 4"
description: "JSON Schema входных данных и ответов: SyncRun — EndpointSearchRequest. Поля, обязательность и ограничения API."
group: "Техническая документация"
order: 48
---

## Адреса этого стенда

- Документация: https://context4.me/docs.md
- Индекс для агента: https://context4.me/docs/agent-index.json
- Консоль и подключения: https://console.context4.me/integrations
- MCP: https://context4.me/mcp
- HTTP API: https://context4.me/v1
- Composio base URL: https://context4.me/compat/context4/v1
- OpenAPI: https://context4.me/docs/openapi.json
- Каталог HTTP/MCP: https://context4.me/docs/api-index.json
- Маршруты Composio: https://context4.me/docs/compat-routes.json
- Коннекторы: https://context4.me/docs/connectors.json


# Схемы API: часть 4

Точные имена полей, required, enum, nullable и ограничения сохранены из [OpenAPI](https://context4.me/docs/openapi.json). `$ref` разрешается относительно `components.schemas` полного документа. Все части: [1](https://context4.me/docs/api-schemas-1.md), [2](https://context4.me/docs/api-schemas-2.md), [3](https://context4.me/docs/api-schemas-3.md), [4](https://context4.me/docs/api-schemas-4.md).

## SyncRun


```json
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "example": "9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"
    },
    "sync_id": {
      "type": "string",
      "format": "uuid",
      "example": "9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"
    },
    "kind": {
      "type": "string",
      "enum": [
        "backfill",
        "incremental",
        "manual"
      ]
    },
    "status": {
      "type": "string",
      "enum": [
        "planned",
        "running",
        "deferred",
        "completed",
        "failed"
      ]
    },
    "fetched": {
      "type": "integer",
      "minimum": 0
    },
    "created": {
      "type": "integer",
      "minimum": 0
    },
    "updated": {
      "type": "integer",
      "minimum": 0
    },
    "deleted": {
      "type": "integer",
      "minimum": 0
    },
    "error_code": {
      "type": [
        "string",
        "null"
      ],
      "maxLength": 120
    },
    "backoff_reason": {
      "type": [
        "string",
        "null"
      ],
      "maxLength": 200
    },
    "started_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "example": "2026-07-16T12:00:00.000Z"
    },
    "completed_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "example": "2026-07-16T12:00:00.000Z"
    },
    "duration_ms": {
      "type": [
        "integer",
        "null"
      ],
      "minimum": 0
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "example": "2026-07-16T12:00:00.000Z"
    }
  },
  "required": [
    "id",
    "sync_id",
    "kind",
    "status",
    "fetched",
    "created",
    "updated",
    "deleted",
    "error_code",
    "backoff_reason",
    "started_at",
    "completed_at",
    "duration_ms",
    "created_at"
  ],
  "additionalProperties": false
}
```

## SyncRecordList

Связанные схемы: [SyncRecord](https://context4.me/docs/api-schemas-4.md#syncrecord).

```json
{
  "type": "object",
  "properties": {
    "data": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/SyncRecord"
      }
    },
    "next_cursor": {
      "type": [
        "string",
        "null"
      ],
      "minLength": 1,
      "maxLength": 400,
      "description": "Cursor for the next page; null when exhausted"
    }
  },
  "required": [
    "data",
    "next_cursor"
  ],
  "additionalProperties": false
}
```

## SyncRecord


```json
{
  "type": "object",
  "properties": {
    "external_id": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200
    },
    "entity": {
      "type": "string",
      "pattern": "^[A-Za-z0-9][A-Za-z0-9_.-]{0,79}$"
    },
    "change_type": {
      "type": "string",
      "enum": [
        "created",
        "updated",
        "deleted"
      ]
    },
    "mod_cursor": {
      "type": "string",
      "minLength": 1,
      "maxLength": 64
    },
    "payload": {
      "type": [
        "object",
        "null"
      ],
      "additionalProperties": {}
    },
    "run_id": {
      "type": "string",
      "format": "uuid",
      "example": "9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"
    },
    "recorded_at": {
      "type": "string",
      "format": "date-time",
      "example": "2026-07-16T12:00:00.000Z"
    }
  },
  "required": [
    "external_id",
    "entity",
    "change_type",
    "mod_cursor",
    "payload",
    "run_id",
    "recorded_at"
  ],
  "additionalProperties": false
}
```

## SyncReplay


```json
{
  "type": "object",
  "properties": {
    "replayed": {
      "type": "integer",
      "minimum": 0
    }
  },
  "required": [
    "replayed"
  ],
  "additionalProperties": false
}
```

## SyncableEntityList


```json
{
  "type": "object",
  "properties": {
    "data": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string",
            "pattern": "^[A-Za-z0-9][A-Za-z0-9_.-]{0,79}$"
          },
          "title": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "strategy": {
            "type": "string",
            "enum": [
              "incremental",
              "snapshot-diff"
            ]
          },
          "default_schedule_minutes": {
            "type": "integer",
            "minimum": 1,
            "maximum": 10080
          }
        },
        "required": [
          "key",
          "title",
          "strategy",
          "default_schedule_minutes"
        ],
        "additionalProperties": false
      }
    }
  },
  "required": [
    "data"
  ],
  "additionalProperties": false
}
```

## SyncDeliveryCapabilities


```json
{
  "type": "object",
  "properties": {
    "channel_version": {
      "type": "string",
      "minLength": 1,
      "maxLength": 40
    },
    "envelope_schema_versions": {
      "type": "array",
      "items": {
        "type": "integer",
        "minimum": 1
      },
      "minItems": 1
    },
    "max_payload_bytes": {
      "type": "integer",
      "minimum": 1
    },
    "max_envelope_bytes": {
      "type": "integer",
      "minimum": 1
    },
    "max_key_bytes": {
      "type": "integer",
      "minimum": 1
    },
    "payload_measurement": {
      "type": "string",
      "enum": [
        "utf8-json"
      ]
    },
    "delete_semantics": {
      "type": "string",
      "enum": [
        "logical-delete-null-payload",
        "two-step-logical-delete-then-tombstone"
      ]
    },
    "retraction": {
      "type": "object",
      "properties": {
        "header": {
          "type": "string",
          "minLength": 1,
          "maxLength": 80
        },
        "marker": {
          "type": "string",
          "minLength": 1,
          "maxLength": 80
        },
        "grace_ms": {
          "type": "integer",
          "minimum": 1
        },
        "min_compaction_lag_ms": {
          "type": "integer",
          "minimum": 1
        },
        "delete_retention_ms": {
          "type": "integer",
          "minimum": 1
        }
      },
      "required": [
        "header",
        "marker",
        "grace_ms",
        "min_compaction_lag_ms",
        "delete_retention_ms"
      ],
      "additionalProperties": false
    },
    "oversized_record_code": {
      "type": "string",
      "minLength": 1,
      "maxLength": 80
    }
  },
  "required": [
    "channel_version",
    "envelope_schema_versions",
    "max_payload_bytes",
    "max_envelope_bytes",
    "max_key_bytes",
    "payload_measurement",
    "delete_semantics",
    "retraction",
    "oversized_record_code"
  ],
  "additionalProperties": false
}
```

## SyncExportSession


```json
{
  "type": "object",
  "properties": {
    "export_id": {
      "type": "string",
      "format": "uuid",
      "example": "9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"
    },
    "organization_id": {
      "type": "string",
      "pattern": "^[a-zA-Z0-9_-]{1,200}$"
    },
    "workspace_id": {
      "type": "string",
      "format": "uuid",
      "example": "9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "example": "2026-07-16T12:00:00.000Z"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time",
      "example": "2026-07-16T12:00:00.000Z"
    },
    "schema_fingerprint": {
      "type": [
        "string",
        "null"
      ],
      "pattern": "^sha256:[a-f0-9]{64}$"
    },
    "expires_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "example": "2026-07-16T12:00:00.000Z"
    },
    "range": {
      "type": "object",
      "properties": {
        "after_cursor": {
          "type": [
            "string",
            "null"
          ],
          "pattern": "^(0|[1-9][0-9]{0,18})$"
        },
        "through_cursor": {
          "type": "string",
          "pattern": "^(0|[1-9][0-9]{0,18})$"
        }
      },
      "required": [
        "after_cursor",
        "through_cursor"
      ],
      "additionalProperties": false
    },
    "sync_id": {
      "type": "string",
      "format": "uuid",
      "example": "9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"
    },
    "entity": {
      "type": "string",
      "pattern": "^[A-Za-z0-9][A-Za-z0-9_.-]{0,79}$"
    },
    "state": {
      "type": "string",
      "enum": [
        "preparing",
        "running",
        "complete",
        "range_expired",
        "archive_unavailable",
        "digest_mismatch",
        "cancelled",
        "failed"
      ]
    },
    "frontier": {
      "type": "object",
      "properties": {
        "mod_cursor": {
          "type": "string",
          "minLength": 1,
          "maxLength": 20
        },
        "captured_at": {
          "type": "string",
          "format": "date-time",
          "example": "2026-07-16T12:00:00.000Z"
        },
        "source_epoch": {
          "type": "string",
          "format": "uuid",
          "example": "9b2f6f2e-4b0a-4bd2-8b7e-3f8a1c2d4e5f"
        }
      },
      "required": [
        "mod_cursor",
        "captured_at",
        "source_epoch"
      ],
      "additionalProperties": false
    },
    "publication_barrier": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "partition": {
            "type": "integer",
            "minimum": 0
          },
          "offset": {
            "type": "string",
            "minLength": 1,
            "maxLength": 20
          }
        },
        "required": [
          "partition",
          "offset"
        ],
        "additionalProperties": false
      }
    },
    "publication_channel": {
      "type": "string",
      "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._-]{0,248}$"
    },
    "progress": {
      "type": "object",
      "properties": {
        "records": {
          "type": "integer",
          "minimum": 0
        },
        "encoded_bytes": {
          "type": "integer",
          "minimum": 0
        }
      },
      "required": [
        "records",
        "encoded_bytes"
      ],
      "additionalProperties": false
    },
    "record_count": {
      "type": [
        "integer",
        "null"
      ],
      "minimum": 0
    },
    "digest": {
      "type": [
        "string",
        "null"
      ],
      "minLength": 1,
      "maxLength": 71
    },
    "terminal_reason": {
      "type": [
        "string",
        "null"
      ],
      "maxLength": 200
    },
    "delivery": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "enum": [
            "bounded-replay-topic"
          ]
        },
        "channel": {
          "type": "string",
          "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._-]{0,248}$"
        },
        "export_key": {
          "type": "string",
          "minLength": 1,
          "maxLength": 200
        },
        "delivery_generation": {
          "type": "integer",
          "exclusiveMinimum": 0
        },
        "state": {
          "type": "string",
          "enum": [
            "pending",
            "publishing",
            "complete",
            "failed",
            "cancelled"
          ]
        },
        "records": {
          "type": "string",
          "pattern": "^(0|[1-9][0-9]{0,19})$"
        },
        "terminal_positions": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": "object",
            "properties": {
              "partition": {
                "type": "integer",
                "minimum": 0
              },
              "offset": {
                "type": "string",
                "pattern": "^(0|[1-9][0-9]*)$"
              }
            },
            "required": [
              "partition",
              "offset"
            ],
            "additionalProperties": false
          },
          "minItems": 1
        },
        "completed_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "example": "2026-07-16T12:00:00.000Z"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time",
          "example": "2026-07-16T12:00:00.000Z"
        },
        "error": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 200
        }
      },
      "required": [
        "kind",
        "channel",
        "export_key",
        "delivery_generation",
        "state",
        "records",
        "terminal_positions",
        "completed_at",
        "updated_at",
        "error"
      ],
      "additionalProperties": false
    },
    "parts": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "index": {
            "type": "integer",
            "minimum": 0
          },
          "after_cursor": {
            "type": "string",
            "minLength": 1,
            "maxLength": 20
          },
          "through_cursor": {
            "type": "string",
            "minLength": 1,
            "maxLength": 20
          },
          "records": {
            "type": "integer",
            "minimum": 1
          },
          "encoded_bytes": {
            "type": "integer",
            "minimum": 1
          },
          "digest": {
            "type": "string",
            "minLength": 1,
            "maxLength": 71
          },
          "download_url": {
            "type": [
              "string",
              "null"
            ],
            "minLength": 1,
            "maxLength": 4096
          }
        },
        "required": [
          "index",
          "after_cursor",
          "through_cursor",
          "records",
          "encoded_bytes",
          "digest",
          "download_url"
        ],
        "additionalProperties": false
      }
    }
  },
  "required": [
    "export_id",
    "sync_id",
    "entity",
    "state",
    "frontier",
    "publication_barrier",
    "progress",
    "record_count",
    "digest",
    "terminal_reason",
    "parts"
  ],
  "additionalProperties": false
}
```

## SyncProviderListResponse


```json
{
  "type": "object",
  "properties": {
    "data": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string",
            "pattern": "^[a-z0-9][a-z0-9-]{1,78}$",
            "example": "bitrix24"
          },
          "display_name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          }
        },
        "required": [
          "key",
          "display_name"
        ],
        "additionalProperties": false
      }
    },
    "next_cursor": {
      "type": [
        "string",
        "null"
      ],
      "minLength": 1,
      "maxLength": 400,
      "description": "Cursor for the next page; null when exhausted"
    }
  },
  "required": [
    "data",
    "next_cursor"
  ],
  "additionalProperties": false
}
```

## EndpointListResponse

Связанные схемы: [EndpointSummary](https://context4.me/docs/api-schemas-4.md#endpointsummary).

```json
{
  "type": "object",
  "properties": {
    "data": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/EndpointSummary"
      }
    },
    "next_cursor": {
      "type": [
        "string",
        "null"
      ],
      "minLength": 1,
      "maxLength": 400,
      "description": "Cursor for the next page; null when exhausted"
    }
  },
  "required": [
    "data",
    "next_cursor"
  ],
  "additionalProperties": false
}
```

## EndpointSummary


```json
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "pattern": "^(?:GET|POST|PUT|PATCH|DELETE|HEAD) \\/[\\x21-\\x7e]{0,240}$",
      "example": "GET /api/v4/leads/{id}"
    },
    "connector_id": {
      "type": "string",
      "pattern": "^[a-z0-9][a-z0-9-]{1,78}$",
      "example": "bitrix24"
    },
    "group": {
      "type": "string",
      "minLength": 1,
      "maxLength": 64,
      "description": "The vendor's own grouping of the endpoint (its spec tag or resource)",
      "example": "leads"
    },
    "method": {
      "type": "string",
      "enum": [
        "GET",
        "POST",
        "PUT",
        "PATCH",
        "DELETE",
        "HEAD"
      ]
    },
    "path": {
      "type": "string",
      "minLength": 1,
      "maxLength": 500,
      "pattern": "^\\/",
      "example": "/api/v4/leads/{id}"
    },
    "summary": {
      "type": [
        "string",
        "null"
      ],
      "maxLength": 2000
    },
    "call_url": {
      "type": "string",
      "minLength": 1,
      "maxLength": 600,
      "description": "The mirror URL that calls this endpoint: `/v1/api/{connectorId}` followed by the vendor path",
      "example": "/v1/api/amocrm/api/v4/leads/{id}"
    },
    "risk": {
      "type": "string",
      "enum": [
        "read",
        "write",
        "destructive",
        "external_send"
      ],
      "description": "What calling it does to the world, as a floor: read, write, destructive or external_send (reaches a person outside the vendor)"
    },
    "sensitive": {
      "type": "boolean",
      "description": "Its schemas name credentials or personal data (a floor)"
    },
    "idempotent": {
      "type": "boolean"
    },
    "paging_kind": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "page",
        "offset",
        "cursor",
        "next-link",
        "header-cursor",
        "rpc-start",
        "relay",
        null
      ],
      "description": "How a listing pages, or null when pages cannot be collected from it"
    },
    "descriptor_digest": {
      "type": [
        "string",
        "null"
      ],
      "pattern": "^[0-9a-f]{64}$",
      "description": "sha256 of the endpoint's contract (method, path, schemas, risk, idempotency — not its paging or summary); null only for a row seeded before descriptors existed",
      "example": "089fed2ebbff74aa8cd059e02cedb06f5fa5044a8e86ff7b457e75a90b8341fa"
    },
    "removed_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "example": "2026-07-16T12:00:00.000Z",
      "description": "When a lock regeneration dropped the endpoint; null while it is live. A removed endpoint is listed only with `include_removed=true`"
    }
  },
  "required": [
    "id",
    "connector_id",
    "group",
    "method",
    "path",
    "summary",
    "call_url"
  ],
  "additionalProperties": false
}
```

## EndpointDetail

Связанные схемы: [PagingDescriptor](https://context4.me/docs/api-schemas-4.md#pagingdescriptor).

```json
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "pattern": "^(?:GET|POST|PUT|PATCH|DELETE|HEAD) \\/[\\x21-\\x7e]{0,240}$",
      "example": "GET /api/v4/leads/{id}"
    },
    "connector_id": {
      "type": "string",
      "pattern": "^[a-z0-9][a-z0-9-]{1,78}$",
      "example": "bitrix24"
    },
    "group": {
      "type": "string",
      "minLength": 1,
      "maxLength": 64,
      "description": "The vendor's own grouping of the endpoint (its spec tag or resource)",
      "example": "leads"
    },
    "method": {
      "type": "string",
      "enum": [
        "GET",
        "POST",
        "PUT",
        "PATCH",
        "DELETE",
        "HEAD"
      ]
    },
    "path": {
      "type": "string",
      "minLength": 1,
      "maxLength": 500,
      "pattern": "^\\/",
      "example": "/api/v4/leads/{id}"
    },
    "summary": {
      "type": [
        "string",
        "null"
      ],
      "maxLength": 2000
    },
    "call_url": {
      "type": "string",
      "minLength": 1,
      "maxLength": 600,
      "description": "The mirror URL that calls this endpoint: `/v1/api/{connectorId}` followed by the vendor path",
      "example": "/v1/api/amocrm/api/v4/leads/{id}"
    },
    "risk": {
      "type": "string",
      "enum": [
        "read",
        "write",
        "destructive",
        "external_send"
      ],
      "description": "What calling it does to the world, as a floor: read, write, destructive or external_send (reaches a person outside the vendor)"
    },
    "sensitive": {
      "type": "boolean",
      "description": "Its schemas name credentials or personal data (a floor)"
    },
    "idempotent": {
      "type": "boolean"
    },
    "paging_kind": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "page",
        "offset",
        "cursor",
        "next-link",
        "header-cursor",
        "rpc-start",
        "relay",
        null
      ],
      "description": "How a listing pages, or null when pages cannot be collected from it"
    },
    "descriptor_digest": {
      "type": [
        "string",
        "null"
      ],
      "pattern": "^[0-9a-f]{64}$",
      "description": "sha256 of the endpoint's contract (method, path, schemas, risk, idempotency — not its paging or summary); null only for a row seeded before descriptors existed",
      "example": "089fed2ebbff74aa8cd059e02cedb06f5fa5044a8e86ff7b457e75a90b8341fa"
    },
    "removed_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "example": "2026-07-16T12:00:00.000Z",
      "description": "When a lock regeneration dropped the endpoint; null while it is live. A removed endpoint is listed only with `include_removed=true`"
    },
    "input_schema": {
      "description": "JSON Schema of the call input: an object with optional `path`, `query`, `header` and `body` members, self-contained (`$defs` included)"
    },
    "output_schema": {},
    "paging": {
      "$ref": "#/components/schemas/PagingDescriptor"
    }
  },
  "required": [
    "id",
    "connector_id",
    "group",
    "method",
    "path",
    "summary",
    "call_url"
  ],
  "additionalProperties": false,
  "description": "One raw endpoint with its input and (when published) output schema, and its paging descriptor"
}
```

## PagingDescriptor


```json
{
  "type": [
    "object",
    "null"
  ],
  "properties": {
    "kind": {
      "type": "string",
      "enum": [
        "page",
        "offset",
        "cursor",
        "next-link",
        "header-cursor",
        "rpc-start",
        "relay"
      ]
    },
    "records": {
      "type": "string",
      "maxLength": 500,
      "description": "Pointer to the records array in the output; `\"\"` is the whole document",
      "example": "/_embedded/leads"
    },
    "max_page_size": {
      "type": "integer",
      "exclusiveMinimum": 0
    },
    "inputs": {
      "type": "object",
      "additionalProperties": {
        "type": "string",
        "maxLength": 500,
        "description": "RFC 6901 JSON pointer into the endpoint's input or output document",
        "example": "/query/page"
      },
      "description": "Input pointers by role: page, size, cursor, offset, start, first, after"
    },
    "next": {
      "type": "object",
      "additionalProperties": {
        "type": "string",
        "maxLength": 500
      },
      "description": "Where the next page is named: output pointers by role (link, cursor, end_cursor, has_next_page) or `header`, a response header name"
    }
  },
  "required": [
    "kind",
    "records",
    "max_page_size",
    "inputs"
  ],
  "additionalProperties": false
}
```

## ConnectorOpenApiDocument


```json
{
  "type": "object",
  "properties": {
    "openapi": {
      "type": "string",
      "enum": [
        "3.1.0"
      ]
    },
    "info": {
      "type": "object",
      "additionalProperties": {}
    },
    "servers": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": {}
      }
    },
    "paths": {
      "type": "object",
      "additionalProperties": {}
    },
    "components": {
      "type": "object",
      "additionalProperties": {}
    }
  },
  "required": [
    "openapi",
    "info",
    "servers",
    "paths",
    "components"
  ],
  "additionalProperties": {}
}
```

## EndpointSearchResponse

Связанные схемы: [EndpointSearchItem](https://context4.me/docs/api-schemas-4.md#endpointsearchitem).

```json
{
  "type": "object",
  "properties": {
    "items": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/EndpointSearchItem"
      }
    },
    "scope": {
      "type": "object",
      "properties": {
        "connectors": {
          "type": "array",
          "items": {
            "type": "string",
            "pattern": "^[a-z0-9][a-z0-9-]{1,78}$",
            "example": "bitrix24"
          },
          "description": "The connectors the search ran over: those of the caller's usable connections, narrowed by `connectors`. Empty when nothing is usable — then `items` is empty too, never an error"
        },
        "index": {
          "type": "string",
          "enum": [
            "ratel",
            "ilike"
          ]
        }
      },
      "required": [
        "connectors",
        "index"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "items",
    "scope"
  ],
  "additionalProperties": false
}
```

## EndpointSearchItem


```json
{
  "type": "object",
  "properties": {
    "connector_id": {
      "type": "string",
      "pattern": "^[a-z0-9][a-z0-9-]{1,78}$",
      "example": "bitrix24"
    },
    "endpoint_id": {
      "type": "string",
      "pattern": "^(?:GET|POST|PUT|PATCH|DELETE|HEAD) \\/[\\x21-\\x7e]{0,240}$",
      "example": "GET /api/v4/leads/{id}"
    },
    "method": {
      "type": "string",
      "enum": [
        "GET",
        "POST",
        "PUT",
        "PATCH",
        "DELETE",
        "HEAD"
      ]
    },
    "path": {
      "type": "string",
      "minLength": 1,
      "maxLength": 500,
      "pattern": "^\\/",
      "example": "/api/v4/leads/{id}"
    },
    "summary": {
      "type": [
        "string",
        "null"
      ],
      "maxLength": 2000
    },
    "group": {
      "type": "string",
      "minLength": 1,
      "maxLength": 64
    },
    "risk": {
      "type": "string",
      "enum": [
        "read",
        "write",
        "destructive",
        "external_send"
      ]
    },
    "sensitive": {
      "type": "boolean"
    },
    "idempotent": {
      "type": "boolean"
    },
    "paging_kind": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "page",
        "offset",
        "cursor",
        "next-link",
        "header-cursor",
        "rpc-start",
        "relay",
        null
      ]
    },
    "descriptor_digest": {
      "type": [
        "string",
        "null"
      ],
      "pattern": "^[0-9a-f]{64}$",
      "description": "sha256 of the endpoint's contract (method, path, schemas, risk, idempotency — not its paging or summary); null only for a row seeded before descriptors existed",
      "example": "089fed2ebbff74aa8cd059e02cedb06f5fa5044a8e86ff7b457e75a90b8341fa"
    },
    "score": {
      "type": "number",
      "minimum": 0,
      "maximum": 1,
      "description": "Relevance relative to the best hit of this answer: the top hit is 1, the rest in (0, 1]; a fallback answer scores every hit 1"
    }
  },
  "required": [
    "connector_id",
    "endpoint_id",
    "method",
    "path",
    "summary",
    "group",
    "risk",
    "sensitive",
    "idempotent",
    "paging_kind",
    "descriptor_digest",
    "score"
  ],
  "additionalProperties": false
}
```

## EndpointSearchRequest


```json
{
  "type": "object",
  "properties": {
    "query": {
      "type": "string",
      "minLength": 1,
      "maxLength": 500,
      "description": "Free text, Russian or English",
      "example": "list the labels of a repository"
    },
    "connectors": {
      "type": "array",
      "items": {
        "type": "string",
        "pattern": "^[a-z0-9][a-z0-9-]{1,78}$",
        "example": "bitrix24"
      },
      "maxItems": 50,
      "description": "Narrows the scope to these connectors; a connector the caller has no usable connection for is dropped, never added"
    },
    "borrowers": {
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 256
      },
      "maxItems": 200,
      "description": "The principals whose connections this search may use (exact `end_user_ref` match, never widened). Omitted: every active connection of the API key's workspace",
      "example": [
        "ws_a1b2c3:u_d4e5f6",
        "ws_a1b2c3:a_workspace"
      ]
    },
    "limit": {
      "type": "integer",
      "minimum": 1,
      "maximum": 50,
      "default": 20
    }
  },
  "required": [
    "query"
  ],
  "additionalProperties": false
}
```

