# AI artifacts

> LLM providers, prompt templates, knowledge resources and bindings, agents, tools and connectors.

Source: https://docs.sommatic.ai/en/api/reference/cognitive-infrastructure/

## Create a new agent profile.

`POST /cognitive-infrastructure/cognitive-assets/agent-profile/`

Returns the created agent profile with data provided.

Authentication: Bearer token

### Request body

Agent profile object to be created.

- `organization_id` (string): Identifier of the organization (tenant) that owns this profile.
- `slug` (string, required): Stable semantic key uniquely identifying this profile (e.g. agent.support_router).
- `name` (string, required): Human-readable profile name used in editors, logs and documentation.
- `description` (string): Optional description that explains the cognitive role of this agent (e.g. "Support router AI").
- `llm_provider_slug` (string): Identifier of the LLM provider configuration (LLMProviderModel) used by default for reasoning, tool calls and message generation. Can be overridden per node.
- `default_prompt_template_id` (string): Optional reference to a PromptTemplateModel used as the system prompt or behavioral scaffold.
- `cognitive_tool_ids` (array<string>): List of CognitiveToolModel keys this agent is allowed to invoke during reasoning.
- `memory_store_ids` (array<string>): Optional list of MemoryStoreModel identifiers available to this agent for conversational memory, contextual retrieval or long-term state.
- `datasource_ids` (array<string>): Optional list of DatasourceModel identifiers the agent may query during reasoning (read-only or governed writes).
- `behavior_policies` (object): Optional structured object defining behavioral rules such as temperature bounds, guardrails, safety mode, chain-of-thought visibility, tone, style, max reasoning depth, tool-use preference and fallback strategy.
- `safety_rules` (array<object>): Optional list of safety constraints enforced before or after reasoning steps (e.g. PII masking, role-based output filtering, compliance checks).
- `max_tool_calls_per_step` (integer): Optional upper bound on how many tool invocations this agent may perform in a single reasoning cycle.
- `max_reasoning_steps` (integer): Optional limit on iterative reasoning or tool-use loops for safety and performance.
- `audit_level` (string): Level of auditing applied to this agent's cognitive operations.
- `tags` (array<string>): Optional free-form tags for search, governance and classification.
- `is_system` (boolean): True if this profile is managed by the platform rather than created by the tenant.
- `is_enabled` (boolean): True if this agent profile is currently available for use.
- `is_deprecated` (boolean): True if this profile is deprecated and should not be used for new flows.

### Responses

- `200`: OK.
- `500`: Something was wrong while you make this action.

### Example request

```bash
curl -X POST "https://api.sommatic.ai/cognitive-infrastructure/cognitive-assets/agent-profile/" \
  -H "Authorization: Bearer $SOMMATIC_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
       "slug": "<slug>",
       "name": "<name>"
     }'
```

## Update an existing agent profile.

`PATCH /cognitive-infrastructure/cognitive-assets/agent-profile/`

Updates the data of an existing agent profile with the data provided.

Authentication: Bearer token

### Request body

Agent profile object to be created.

- `organization_id` (string): Identifier of the organization (tenant) that owns this profile.
- `slug` (string, required): Stable semantic key uniquely identifying this profile (e.g. agent.support_router).
- `name` (string, required): Human-readable profile name used in editors, logs and documentation.
- `description` (string): Optional description that explains the cognitive role of this agent (e.g. "Support router AI").
- `llm_provider_slug` (string): Identifier of the LLM provider configuration (LLMProviderModel) used by default for reasoning, tool calls and message generation. Can be overridden per node.
- `default_prompt_template_id` (string): Optional reference to a PromptTemplateModel used as the system prompt or behavioral scaffold.
- `cognitive_tool_ids` (array<string>): List of CognitiveToolModel keys this agent is allowed to invoke during reasoning.
- `memory_store_ids` (array<string>): Optional list of MemoryStoreModel identifiers available to this agent for conversational memory, contextual retrieval or long-term state.
- `datasource_ids` (array<string>): Optional list of DatasourceModel identifiers the agent may query during reasoning (read-only or governed writes).
- `behavior_policies` (object): Optional structured object defining behavioral rules such as temperature bounds, guardrails, safety mode, chain-of-thought visibility, tone, style, max reasoning depth, tool-use preference and fallback strategy.
- `safety_rules` (array<object>): Optional list of safety constraints enforced before or after reasoning steps (e.g. PII masking, role-based output filtering, compliance checks).
- `max_tool_calls_per_step` (integer): Optional upper bound on how many tool invocations this agent may perform in a single reasoning cycle.
- `max_reasoning_steps` (integer): Optional limit on iterative reasoning or tool-use loops for safety and performance.
- `audit_level` (string): Level of auditing applied to this agent's cognitive operations.
- `tags` (array<string>): Optional free-form tags for search, governance and classification.
- `is_system` (boolean): True if this profile is managed by the platform rather than created by the tenant.
- `is_enabled` (boolean): True if this agent profile is currently available for use.
- `is_deprecated` (boolean): True if this profile is deprecated and should not be used for new flows.

### Responses

- `200`: OK.
- `500`: Something was wrong while you make this action.

### Example request

```bash
curl -X PATCH "https://api.sommatic.ai/cognitive-infrastructure/cognitive-assets/agent-profile/" \
  -H "Authorization: Bearer $SOMMATIC_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
       "slug": "<slug>",
       "name": "<name>"
     }'
```

## Delete a agent profile by its id.

`DELETE /cognitive-infrastructure/cognitive-assets/agent-profile/`

Deletes a agent profile based on the provided ID.

Authentication: Bearer token

### Request body

ID of the agent profile to delete

- `id` (string)

### Responses

- `200`: OK.
- `500`: Something went wrong while performing this action.

### Example request

```bash
curl -X DELETE "https://api.sommatic.ai/cognitive-infrastructure/cognitive-assets/agent-profile/" \
  -H "Authorization: Bearer $SOMMATIC_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
       "id": "<id>"
     }'
```

## Get an agent profile by query selector.

`GET /cognitive-infrastructure/cognitive-assets/agent-profile/{queryselector}`

Returns the agent profile information that matches the query selector an search specified in the route.

Authentication: Bearer token

### Parameters

- `queryselector` (path, enum, required): Is the filter available for this query Allowed values: `id`, `organization-id`, `all`.
- `search` (query, string): Keyword to search for entities.
- `include_status` (query, string): Optional status parameter to include agent profiles of a specific status.
- `exclude_status` (query, string): Optional status parameter to exclude agent profiles of a specific status.
- `page` (query, integer): Page number, starting at 1 (default 1).
- `pageSize` (query, integer): Records per page (default 25).

### Responses

- `200`: OK.
- `500`: Something was wrong while you make this action.

### Example request

```bash
curl -X GET "https://api.sommatic.ai/cognitive-infrastructure/cognitive-assets/agent-profile/<queryselector>" \
  -H "Authorization: Bearer $SOMMATIC_TOKEN"
```

## Create a new cognitive tool.

`POST /cognitive-infrastructure/cognitive-assets/cognitive-tool/`

Returns the created cognitive tool with data provided.

Authentication: Bearer token

### Request body

Cognitive tool object to be created.

- `organization_id` (string): Identifier of the organization (tenant) that owns this tool.
- `project_id` (string): Optional project ID (tenant scope) that owns the tool.
- `slug` (string, required): Stable semantic key uniquely identifying this tool (e.g. tool.openai_async_chat).
- `name` (string, required): Human-readable tool name used in editors, prompts and documentation.
- `description` (string): Human-readable explanation of the tool’s purpose, side effects and intended usage domain.
- `invocation_kind` (string, required): Type of capability implemented by the tool: "http-endpoint", "internal-function", "sub-flow", "vector-query", "database-operation", "identity-check", etc.
- `execution_mode` (string): Execution mode for this tool: "sync" for immediate inline results returned to the calling agent, "async" for deferred completion handled via callbacks or resume events, or "stream" for incremental result delivery when supported by the underlying connector or provider.
- `async_result_strategy` (string): Optional strategy used when execution_mode is "async", such as "callback-ingress", "resume-flow-instance", or "fire-and-forget".
- `async_result_ingress_binding_slug` (string): Optional reference to an IngressBindingModel key used to receive asynchronous completion payloads.
- `connector_slug` (string): Optional reference to the ConnectorModel used when this tool interacts with an external system.
- `endpoint_key` (string): Optional reference to an EndpointTemplateModel used for HTTP or RPC operations.
- `target_flow_slug` (string): Optional flow key used when the tool executes a versioned sub-flow.
- `parameter_schema` (object): JSON-schema-like definition describing the typed parameters required to invoke the tool.
- `result_schema` (object): JSON-schema-like structure describing the normalized result object.
- `agent_result_projection` (object): Optional mapping rules that transform raw backend responses into the normalized result schema.
- `requires_auth_context` (boolean): Whether this tool requires an authenticated identity context.
- `allowed_agent_profile_ids` (array<string>): Optional list of AgentProfileModel identifiers allowed to invoke this tool.
- `allowed_operator_slugs` (array<string>): Optional list of operator types that may reference this tool.
- `safety_classification` (string): Safety level of this tool: "read-only", "idempotent-write", "state-changing", "sensitive", or "high-risk".
- `safety_rules` (array<object>): Structured constraints or preconditions validated before tool invocation.
- `max_invocations_per_run` (integer): Soft limit on how many times an agent may call this tool in a single execution.
- `timeout_ms` (integer): Timeout in milliseconds for tool execution.
- `audit_level` (string): Level of auditing applied to this tool.
- `tags` (array<string>): Optional tags for catalog search and grouping.
- `is_system` (boolean): Indicates if this tool is managed by the platform.
- `is_enabled` (boolean): Indicates if this tool is enabled.
- `is_deprecated` (boolean): Indicates if this tool is deprecated.

### Responses

- `200`: OK.
- `500`: Something was wrong while you make this action.

### Example request

```bash
curl -X POST "https://api.sommatic.ai/cognitive-infrastructure/cognitive-assets/cognitive-tool/" \
  -H "Authorization: Bearer $SOMMATIC_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
       "slug": "<slug>",
       "name": "<name>",
       "invocation_kind": "<invocation_kind>"
     }'
```

## Update an existing cognitive tool.

`PATCH /cognitive-infrastructure/cognitive-assets/cognitive-tool/`

Updates the data of an existing cognitive tool with the data provided.

Authentication: Bearer token

### Request body

Cognitive tool object to be created.

- `organization_id` (string): Identifier of the organization (tenant) that owns this tool.
- `project_id` (string): Optional project ID (tenant scope) that owns the tool.
- `slug` (string, required): Stable semantic key uniquely identifying this tool (e.g. tool.openai_async_chat).
- `name` (string, required): Human-readable tool name used in editors, prompts and documentation.
- `description` (string): Human-readable explanation of the tool’s purpose, side effects and intended usage domain.
- `invocation_kind` (string, required): Type of capability implemented by the tool: "http-endpoint", "internal-function", "sub-flow", "vector-query", "database-operation", "identity-check", etc.
- `execution_mode` (string): Execution mode for this tool: "sync" for immediate inline results returned to the calling agent, "async" for deferred completion handled via callbacks or resume events, or "stream" for incremental result delivery when supported by the underlying connector or provider.
- `async_result_strategy` (string): Optional strategy used when execution_mode is "async", such as "callback-ingress", "resume-flow-instance", or "fire-and-forget".
- `async_result_ingress_binding_slug` (string): Optional reference to an IngressBindingModel key used to receive asynchronous completion payloads.
- `connector_slug` (string): Optional reference to the ConnectorModel used when this tool interacts with an external system.
- `endpoint_key` (string): Optional reference to an EndpointTemplateModel used for HTTP or RPC operations.
- `target_flow_slug` (string): Optional flow key used when the tool executes a versioned sub-flow.
- `parameter_schema` (object): JSON-schema-like definition describing the typed parameters required to invoke the tool.
- `result_schema` (object): JSON-schema-like structure describing the normalized result object.
- `agent_result_projection` (object): Optional mapping rules that transform raw backend responses into the normalized result schema.
- `requires_auth_context` (boolean): Whether this tool requires an authenticated identity context.
- `allowed_agent_profile_ids` (array<string>): Optional list of AgentProfileModel identifiers allowed to invoke this tool.
- `allowed_operator_slugs` (array<string>): Optional list of operator types that may reference this tool.
- `safety_classification` (string): Safety level of this tool: "read-only", "idempotent-write", "state-changing", "sensitive", or "high-risk".
- `safety_rules` (array<object>): Structured constraints or preconditions validated before tool invocation.
- `max_invocations_per_run` (integer): Soft limit on how many times an agent may call this tool in a single execution.
- `timeout_ms` (integer): Timeout in milliseconds for tool execution.
- `audit_level` (string): Level of auditing applied to this tool.
- `tags` (array<string>): Optional tags for catalog search and grouping.
- `is_system` (boolean): Indicates if this tool is managed by the platform.
- `is_enabled` (boolean): Indicates if this tool is enabled.
- `is_deprecated` (boolean): Indicates if this tool is deprecated.

### Responses

- `200`: OK.
- `500`: Something was wrong while you make this action.

### Example request

```bash
curl -X PATCH "https://api.sommatic.ai/cognitive-infrastructure/cognitive-assets/cognitive-tool/" \
  -H "Authorization: Bearer $SOMMATIC_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
       "slug": "<slug>",
       "name": "<name>",
       "invocation_kind": "<invocation_kind>"
     }'
```

## Delete a cognitive tool by its id.

`DELETE /cognitive-infrastructure/cognitive-assets/cognitive-tool/`

Deletes a cognitive tool based on the provided ID.

Authentication: Bearer token

### Request body

ID of the cognitive tool to delete

- `id` (string)

### Responses

- `200`: OK.
- `500`: Something went wrong while performing this action.

### Example request

```bash
curl -X DELETE "https://api.sommatic.ai/cognitive-infrastructure/cognitive-assets/cognitive-tool/" \
  -H "Authorization: Bearer $SOMMATIC_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
       "id": "<id>"
     }'
```

## Get a cognitive tool by query selector.

`GET /cognitive-infrastructure/cognitive-assets/cognitive-tool/{queryselector}`

Returns the cognitive tool information that matches the query selector an search specified in the route.

Authentication: Bearer token

### Parameters

- `queryselector` (path, enum, required): Is the filter available for this query Allowed values: `id`, `organization-id`, `all`.
- `search` (query, string): Keyword to search for entities.
- `include_status` (query, string): Optional status parameter to include cognitive tools of a specific status.
- `exclude_status` (query, string): Optional status parameter to exclude cognitive tools of a specific status.
- `page` (query, integer): Page number, starting at 1 (default 1).
- `pageSize` (query, integer): Records per page (default 25).

### Responses

- `200`: OK.
- `500`: Something was wrong while you make this action.

### Example request

```bash
curl -X GET "https://api.sommatic.ai/cognitive-infrastructure/cognitive-assets/cognitive-tool/<queryselector>" \
  -H "Authorization: Bearer $SOMMATIC_TOKEN"
```

## Create a new knowledge resource binding.

`POST /cognitive-infrastructure/cognitive-assets/knowledge-resource-binding/`

Creates and returns the new cognitive knowledge resource binding.

Authentication: Bearer token

### Request body

Knowledge Resource Binding object to be created.

- `id` (string): Unique identifier of the binding.
- `organization_id` (string, required): Tenant that owns the binding.
- `resource_id` (string, required): Referenced cognitive knowledge resource identifier.
- `target_type` (string, required): Entity type this resource is bound to. Allowed values: `project`, `workflow`, `workflow-node`, `agent-profile`, `app`, `conversation`, `report`, `anomaly`.
- `target_id` (string, required): Identifier of the target entity.
- `role` (string, required): Semantic purpose of the resource within the target context. Allowed values: `knowledge`, `policy`, `instructions`, `dataset`, `template`, `reference`.
- `mode` (string, required): How Sommatic AI should use the resource at runtime. Allowed values: `retrieval`, `context`, `both`, `instruction`, `routing`, `validation`.
- `tags` (array<string>): Optional contextual tags applied at the binding level.
- `metadata` (object): Additional context for the binding.

### Responses

- `200`: OK.
- `500`: Something was wrong while you make this action.

### Example request

```bash
curl -X POST "https://api.sommatic.ai/cognitive-infrastructure/cognitive-assets/knowledge-resource-binding/" \
  -H "Authorization: Bearer $SOMMATIC_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
       "organization_id": "<organization_id>",
       "resource_id": "<resource_id>",
       "target_type": "project",
       "target_id": "<target_id>",
       "role": "knowledge",
       "mode": "retrieval"
     }'
```

## Update an existing knowledge resource binding.

`PATCH /cognitive-infrastructure/cognitive-assets/knowledge-resource-binding/`

Updates the data of an existing cognitive knowledge resource binding.

Authentication: Bearer token

### Request body

Knowledge Resource Binding properties to update.

- `id` (string): Unique identifier of the binding.
- `organization_id` (string, required): Tenant that owns the binding.
- `resource_id` (string, required): Referenced cognitive knowledge resource identifier.
- `target_type` (string, required): Entity type this resource is bound to. Allowed values: `project`, `workflow`, `workflow-node`, `agent-profile`, `app`, `conversation`, `report`, `anomaly`.
- `target_id` (string, required): Identifier of the target entity.
- `role` (string, required): Semantic purpose of the resource within the target context. Allowed values: `knowledge`, `policy`, `instructions`, `dataset`, `template`, `reference`.
- `mode` (string, required): How Sommatic AI should use the resource at runtime. Allowed values: `retrieval`, `context`, `both`, `instruction`, `routing`, `validation`.
- `tags` (array<string>): Optional contextual tags applied at the binding level.
- `metadata` (object): Additional context for the binding.

### Responses

- `200`: OK.
- `500`: Something was wrong while you make this action.

### Example request

```bash
curl -X PATCH "https://api.sommatic.ai/cognitive-infrastructure/cognitive-assets/knowledge-resource-binding/" \
  -H "Authorization: Bearer $SOMMATIC_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
       "organization_id": "<organization_id>",
       "resource_id": "<resource_id>",
       "target_type": "project",
       "target_id": "<target_id>",
       "role": "knowledge",
       "mode": "retrieval"
     }'
```

## Delete a knowledge resource binding by its id.

`DELETE /cognitive-infrastructure/cognitive-assets/knowledge-resource-binding/`

Deletes a knowledge resource binding based on the provided ID.

Authentication: Bearer token

### Request body

ID of the binding to delete

- `id` (string)

### Responses

- `200`: OK.
- `500`: Something went wrong while performing this action.

### Example request

```bash
curl -X DELETE "https://api.sommatic.ai/cognitive-infrastructure/cognitive-assets/knowledge-resource-binding/" \
  -H "Authorization: Bearer $SOMMATIC_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
       "id": "<id>"
     }'
```

## Get a knowledge resource binding by query selector.

`GET /cognitive-infrastructure/cognitive-assets/knowledge-resource-binding/{queryselector}`

Returns the knowledge resource binding information that matches the query selector and search specified in the route.

Authentication: Bearer token

### Parameters

- `queryselector` (path, string, required): The field to filter by Allowed values: `id`, `organization-id`, `resource-id`, `target-id`, `all`.
- `search` (query, string): Keyword to search for entities.
- `target_type` (query, string): Optional target type parameter to filter bindings.
- `include_status` (query, string): Optional status parameter to include items of a specific status.
- `exclude_status` (query, string): Optional status parameter to exclude items of a specific status.
- `page` (query, integer): Page number, starting at 1 (default 1).
- `pageSize` (query, integer): Records per page (default 25).

### Responses

- `200`: OK.
- `500`: Something was wrong while you make this action.

### Example request

```bash
curl -X GET "https://api.sommatic.ai/cognitive-infrastructure/cognitive-assets/knowledge-resource-binding/<queryselector>" \
  -H "Authorization: Bearer $SOMMATIC_TOKEN"
```

## Create a new knowledge resource.

`POST /cognitive-infrastructure/cognitive-assets/knowledge-resource/`

Creates and returns the new cognitive knowledge resource.

Authentication: Bearer token

### Request body

Knowledge Resource object to be created.

- `id` (string): Unique identifier of the cognitive knowledge resource.
- `organization_id` (string, required): Organization ID (tenant) that owns the resource.
- `project_id` (string): Optional project ID (tenant scope) that owns the resource.
- `name` (string, required): Human-readable name of the resource.
- `slug` (string, required): Stable semantic key used to reference the resource across the platform.
- `description` (string): Optional explanation of the resource purpose and intended usage.
- `resource_type` (string, required): Semantic type of the cognitive resource. Allowed values: `text`, `document`, `list`, `taxonomy`, `prompt`, `policy`, `manual`, `dataset`, `reference`.
- `status` (string): Lifecycle status of the resource. Allowed values: `draft`, `active`, `archived`, `deleted`.
- `version` (string): Semantic or internal version of the resource.
- `language` (string): Primary language of the resource content.
- `tags` (array<string>): Optional tags for filtering, navigation and governance.
- `content` (CognitiveKnowledgeResourceContent, required): Canonical content payload of a cognitive knowledge resource. Supports free text, structured JSON data, file references and prompt blocks.
  - `format` (string): Primary representation format of the content. Allowed values: `plain-text`, `markdown`, `json`, `file-reference`, `prompt-blocks`, `url`.
  - `text` (string): Raw or markdown text content used for text-like resources.
  - `structured_data` (object): Structured JSON payload for lists, taxonomies, rules or lightweight datasets.
  - `file_ref` (CognitiveKnowledgeResourceFileReference): File reference metadata for a cognitive knowledge resource.
    - `file_name` (string): Original or display file name.
    - `mime_type` (string): MIME type of the linked file.
    - `storage_key` (string): Internal storage key or blob identifier.
    - `document_uri` (string): URI or canonical pointer to the stored file.
    - `checksum` (string): Optional checksum used for file integrity validation.
    - `size_bytes` (number): File size in bytes.
  - `prompt_blocks` (object): Structured prompt sections when the resource_type is prompt.
    - `system` (string)
    - `instructions` (string)
    - `examples` (array<object>)
  - `url` (string): External or internal URL pointer when the content is represented as a link.
- `source` (CognitiveKnowledgeResourceSource): Optional infrastructure reference indicating where the resource is physically stored or synchronized from. This does not replace the semantic resource model.
  - `datasource_id` (string): Optional datasource identifier when the content is backed by an external datasource.
  - `external_id` (string): Identifier of the resource in the external source system.
  - `sync_mode` (string): How the resource is maintained against its physical source. Allowed values: `manual`, `synced`, `imported`.
- `governance` (CognitiveKnowledgeResourceGovernance): Governance and lifecycle metadata for a cognitive knowledge resource.
  - `owner_user_id` (string): User responsible for the resource.
  - `owner_team_id` (string): Team responsible for the resource.
  - `visibility_scope` (string): Visibility scope of the resource. Allowed values: `private`, `team`, `organization`.
  - `review_status` (string): Review state of the resource. Allowed values: `draft`, `reviewed`, `approved`, `rejected`.
  - `is_authoritative` (boolean): Indicates whether this resource should be treated as an authoritative source.
  - `effective_from` (string): Optional validity start timestamp.
  - `effective_to` (string): Optional validity end timestamp.
  - `expires_at` (string): Optional expiration timestamp.
- `capabilities` (CognitiveKnowledgeResourceCapabilities): Declares how the resource can be used within the runtime.
  - `allowed_usage_modes` (array<string>): Modes in which the resource is permitted to be utilized.
  - `is_searchable` (boolean): Indicates if the resource is indexed for search.
  - `is_bindable` (boolean): Indicates if the resource can be bound to target entities.
  - `is_executable_reference` (boolean): Indicates if the resource reference is executable.
  - `is_version_locked` (boolean): Indicates if the resource is locked to a specific version.
- `git_binding` (object): Link with the Git repository this resource is synchronized from (see docs/concepts/git_sync.md): { repository_id, repository, branch, environment, package_path, resource_key, file_path,
  last_synced_commit, last_synced_at, deployed_commit, deployed_at, deployed_version, unlinked,
  unlinked_at }. unlinked = true means this installation stops syncing the resource from Git.
- `metadata` (object): Additional arbitrary metadata for UI, indexing or operational hints.

### Responses

- `200`: OK.
- `500`: Something was wrong while you make this action.

### Example request

```bash
curl -X POST "https://api.sommatic.ai/cognitive-infrastructure/cognitive-assets/knowledge-resource/" \
  -H "Authorization: Bearer $SOMMATIC_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
       "organization_id": "<organization_id>",
       "name": "<name>",
       "slug": "<slug>",
       "resource_type": "text",
       "content": {}
     }'
```

## Update an existing knowledge resource.

`PATCH /cognitive-infrastructure/cognitive-assets/knowledge-resource/`

Updates the data of an existing cognitive knowledge resource.

Authentication: Bearer token

### Request body

Knowledge Resource properties to update.

- `id` (string): Unique identifier of the cognitive knowledge resource.
- `organization_id` (string, required): Organization ID (tenant) that owns the resource.
- `project_id` (string): Optional project ID (tenant scope) that owns the resource.
- `name` (string, required): Human-readable name of the resource.
- `slug` (string, required): Stable semantic key used to reference the resource across the platform.
- `description` (string): Optional explanation of the resource purpose and intended usage.
- `resource_type` (string, required): Semantic type of the cognitive resource. Allowed values: `text`, `document`, `list`, `taxonomy`, `prompt`, `policy`, `manual`, `dataset`, `reference`.
- `status` (string): Lifecycle status of the resource. Allowed values: `draft`, `active`, `archived`, `deleted`.
- `version` (string): Semantic or internal version of the resource.
- `language` (string): Primary language of the resource content.
- `tags` (array<string>): Optional tags for filtering, navigation and governance.
- `content` (CognitiveKnowledgeResourceContent, required): Canonical content payload of a cognitive knowledge resource. Supports free text, structured JSON data, file references and prompt blocks.
  - `format` (string): Primary representation format of the content. Allowed values: `plain-text`, `markdown`, `json`, `file-reference`, `prompt-blocks`, `url`.
  - `text` (string): Raw or markdown text content used for text-like resources.
  - `structured_data` (object): Structured JSON payload for lists, taxonomies, rules or lightweight datasets.
  - `file_ref` (CognitiveKnowledgeResourceFileReference): File reference metadata for a cognitive knowledge resource.
    - `file_name` (string): Original or display file name.
    - `mime_type` (string): MIME type of the linked file.
    - `storage_key` (string): Internal storage key or blob identifier.
    - `document_uri` (string): URI or canonical pointer to the stored file.
    - `checksum` (string): Optional checksum used for file integrity validation.
    - `size_bytes` (number): File size in bytes.
  - `prompt_blocks` (object): Structured prompt sections when the resource_type is prompt.
    - `system` (string)
    - `instructions` (string)
    - `examples` (array<object>)
  - `url` (string): External or internal URL pointer when the content is represented as a link.
- `source` (CognitiveKnowledgeResourceSource): Optional infrastructure reference indicating where the resource is physically stored or synchronized from. This does not replace the semantic resource model.
  - `datasource_id` (string): Optional datasource identifier when the content is backed by an external datasource.
  - `external_id` (string): Identifier of the resource in the external source system.
  - `sync_mode` (string): How the resource is maintained against its physical source. Allowed values: `manual`, `synced`, `imported`.
- `governance` (CognitiveKnowledgeResourceGovernance): Governance and lifecycle metadata for a cognitive knowledge resource.
  - `owner_user_id` (string): User responsible for the resource.
  - `owner_team_id` (string): Team responsible for the resource.
  - `visibility_scope` (string): Visibility scope of the resource. Allowed values: `private`, `team`, `organization`.
  - `review_status` (string): Review state of the resource. Allowed values: `draft`, `reviewed`, `approved`, `rejected`.
  - `is_authoritative` (boolean): Indicates whether this resource should be treated as an authoritative source.
  - `effective_from` (string): Optional validity start timestamp.
  - `effective_to` (string): Optional validity end timestamp.
  - `expires_at` (string): Optional expiration timestamp.
- `capabilities` (CognitiveKnowledgeResourceCapabilities): Declares how the resource can be used within the runtime.
  - `allowed_usage_modes` (array<string>): Modes in which the resource is permitted to be utilized.
  - `is_searchable` (boolean): Indicates if the resource is indexed for search.
  - `is_bindable` (boolean): Indicates if the resource can be bound to target entities.
  - `is_executable_reference` (boolean): Indicates if the resource reference is executable.
  - `is_version_locked` (boolean): Indicates if the resource is locked to a specific version.
- `git_binding` (object): Link with the Git repository this resource is synchronized from (see docs/concepts/git_sync.md): { repository_id, repository, branch, environment, package_path, resource_key, file_path,
  last_synced_commit, last_synced_at, deployed_commit, deployed_at, deployed_version, unlinked,
  unlinked_at }. unlinked = true means this installation stops syncing the resource from Git.
- `metadata` (object): Additional arbitrary metadata for UI, indexing or operational hints.

### Responses

- `200`: OK.
- `500`: Something was wrong while you make this action.

### Example request

```bash
curl -X PATCH "https://api.sommatic.ai/cognitive-infrastructure/cognitive-assets/knowledge-resource/" \
  -H "Authorization: Bearer $SOMMATIC_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
       "organization_id": "<organization_id>",
       "name": "<name>",
       "slug": "<slug>",
       "resource_type": "text",
       "content": {}
     }'
```

## Delete a knowledge resource by its id.

`DELETE /cognitive-infrastructure/cognitive-assets/knowledge-resource/`

Deletes a knowledge resource based on the provided ID.

Authentication: Bearer token

### Request body

ID of the resource to delete

- `id` (string)

### Responses

- `200`: OK.
- `500`: Something went wrong while performing this action.

### Example request

```bash
curl -X DELETE "https://api.sommatic.ai/cognitive-infrastructure/cognitive-assets/knowledge-resource/" \
  -H "Authorization: Bearer $SOMMATIC_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
       "id": "<id>"
     }'
```

## Publish the knowledge resource as a new immutable version.

`POST /cognitive-infrastructure/cognitive-assets/knowledge-resource/{id}/publish`

Stores a snapshot of the current content as the next version (queryselector `versions` lists them) and marks the resource active. Used by the editor Publish action and by git sync.

Authentication: Bearer token

### Parameters

- `id` (path, string, required)

### Request body

- `description` (string)
- `git` (object): Origin when published from git: { repository, branch, commit, path, key }

### Responses

- `200`: The created version snapshot.

### Example request

```bash
curl -X POST "https://api.sommatic.ai/cognitive-infrastructure/cognitive-assets/knowledge-resource/<id>/publish" \
  -H "Authorization: Bearer $SOMMATIC_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
       "description": "<description>",
       "git": {}
     }'
```

## Get a knowledge resource by query selector.

`GET /cognitive-infrastructure/cognitive-assets/knowledge-resource/{queryselector}`

Returns the knowledge resource information that matches the query selector and search specified in the route.

Authentication: Bearer token

### Parameters

- `queryselector` (path, string, required): The field to filter by Allowed values: `id`, `organization-id`, `slug`, `all`.
- `search` (query, string): Keyword to search for entities.
- `include_status` (query, string): Optional status parameter to include items of a specific status.
- `exclude_status` (query, string): Optional status parameter to exclude items of a specific status.
- `page` (query, integer): Page number, starting at 1 (default 1).
- `pageSize` (query, integer): Records per page (default 25).

### Responses

- `200`: OK.
- `500`: Something was wrong while you make this action.

### Example request

```bash
curl -X GET "https://api.sommatic.ai/cognitive-infrastructure/cognitive-assets/knowledge-resource/<queryselector>" \
  -H "Authorization: Bearer $SOMMATIC_TOKEN"
```

## Create a new LLM Provider.

`POST /cognitive-infrastructure/cognitive-assets/llm-provider/`

Returns the created LLM Provider with data provided.

Authentication: Bearer token

### Request body

LLM Provider object to be created.

- `organization_id` (string): Identifier of the organization (tenant) that owns this flow definition.
- `project_id` (string): Optional project ID (tenant scope) that owns the LLM provider configuration.
- `slug` (string, required): Stable semantic key uniquely identifying this provider configuration (e.g. llm.openai.gpt4_1, llm.azure.gpt4o, llm.claude3_sonnet).
- `name` (string, required): Human-readable name of the provider configuration used in editors and documentation.
- `description` (string): Optional description explaining the provider’s purpose, model characteristics or usage scenarios.
- `transport_kind` (string): Transport method used to invoke the LLM - http-api, grpc, internal-router, local-process.
- `provider_type` (object): Provider type identifier used to resolve the invocation adapter (e.g. openai-chat, azure-openai-chat, anthropic-messages, mistral-chat).
  - `name` (string)
  - `title` (string)
- `endpoint` (string): Optional connection string or identifier for the ConnectorModel used for HTTP/GRPC LLM invocation.
- `api_key` (string): Optional EndpointTemplateModel key used when this provider maps to a connector endpoint.
- `deployment_name` (string): A deployment name is a unique identifier for a specific model version and configuration deployed on your cloud service provider.
- `api_version` (string): API version required by the provider (e.g. 2024-06-01 for Azure OpenAI).
- `default_parameters` (object): Optional static default parameters such as max_tokens, temperature or top_p applied when the LLM is invoked without explicit overrides.
- `input_token_limit` (integer): Maximum number of tokens allowed in the prompt for this provider.
- `output_token_limit` (integer): Maximum number of tokens that can be returned by this provider.
- `pricing` (object): Optional structured pricing information used for cost monitoring and optimization.
  - `input_cost_per_million` (number): Cost per 1M input tokens.
  - `output_cost_per_million` (number): Cost per 1M output tokens.
  - `currency` (string): Currency code (e.g. USD).
- `rate_limits` (object): Optional request-per-minute or token-per-minute limits used to throttle requests.
  - `rpm` (integer)
  - `tpm` (integer)
- `safety_settings` (object): Optional provider-level safety configuration - content filters, policies, blocklists or moderation modes.
  - `mode` (string): Safety mode (e.g. strict, balanced, minimal).
  - `categories_blocked` (array<string>): List of blocked content categories.
- `routing_rules` (array<object>): Optional set of rules defining when this provider should be automatically selected by the cognitive engine.
- `is_system` (boolean): True if this provider configuration is managed by the platform.
- `is_default` (boolean): True if this provider determines the default LLM for the system.
- `is_enabled` (boolean): True if this provider can currently be selected or invoked.
- `is_deprecated` (boolean): True if this provider should no longer be used for new flows or agents.

### Responses

- `200`: OK.
- `500`: Something was wrong while you make this action.

### Example request

```bash
curl -X POST "https://api.sommatic.ai/cognitive-infrastructure/cognitive-assets/llm-provider/" \
  -H "Authorization: Bearer $SOMMATIC_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
       "slug": "<slug>",
       "name": "<name>"
     }'
```

## Update an existing LLM Provider.

`PATCH /cognitive-infrastructure/cognitive-assets/llm-provider/`

Updates the data of an existing LLM Provider with the data provided.

Authentication: Bearer token

### Request body

LLM Provider object to be updated.

- `organization_id` (string): Identifier of the organization (tenant) that owns this flow definition.
- `project_id` (string): Optional project ID (tenant scope) that owns the LLM provider configuration.
- `slug` (string, required): Stable semantic key uniquely identifying this provider configuration (e.g. llm.openai.gpt4_1, llm.azure.gpt4o, llm.claude3_sonnet).
- `name` (string, required): Human-readable name of the provider configuration used in editors and documentation.
- `description` (string): Optional description explaining the provider’s purpose, model characteristics or usage scenarios.
- `transport_kind` (string): Transport method used to invoke the LLM - http-api, grpc, internal-router, local-process.
- `provider_type` (object): Provider type identifier used to resolve the invocation adapter (e.g. openai-chat, azure-openai-chat, anthropic-messages, mistral-chat).
  - `name` (string)
  - `title` (string)
- `endpoint` (string): Optional connection string or identifier for the ConnectorModel used for HTTP/GRPC LLM invocation.
- `api_key` (string): Optional EndpointTemplateModel key used when this provider maps to a connector endpoint.
- `deployment_name` (string): A deployment name is a unique identifier for a specific model version and configuration deployed on your cloud service provider.
- `api_version` (string): API version required by the provider (e.g. 2024-06-01 for Azure OpenAI).
- `default_parameters` (object): Optional static default parameters such as max_tokens, temperature or top_p applied when the LLM is invoked without explicit overrides.
- `input_token_limit` (integer): Maximum number of tokens allowed in the prompt for this provider.
- `output_token_limit` (integer): Maximum number of tokens that can be returned by this provider.
- `pricing` (object): Optional structured pricing information used for cost monitoring and optimization.
  - `input_cost_per_million` (number): Cost per 1M input tokens.
  - `output_cost_per_million` (number): Cost per 1M output tokens.
  - `currency` (string): Currency code (e.g. USD).
- `rate_limits` (object): Optional request-per-minute or token-per-minute limits used to throttle requests.
  - `rpm` (integer)
  - `tpm` (integer)
- `safety_settings` (object): Optional provider-level safety configuration - content filters, policies, blocklists or moderation modes.
  - `mode` (string): Safety mode (e.g. strict, balanced, minimal).
  - `categories_blocked` (array<string>): List of blocked content categories.
- `routing_rules` (array<object>): Optional set of rules defining when this provider should be automatically selected by the cognitive engine.
- `is_system` (boolean): True if this provider configuration is managed by the platform.
- `is_default` (boolean): True if this provider determines the default LLM for the system.
- `is_enabled` (boolean): True if this provider can currently be selected or invoked.
- `is_deprecated` (boolean): True if this provider should no longer be used for new flows or agents.

### Responses

- `200`: OK.
- `500`: Something was wrong while you make this action.

### Example request

```bash
curl -X PATCH "https://api.sommatic.ai/cognitive-infrastructure/cognitive-assets/llm-provider/" \
  -H "Authorization: Bearer $SOMMATIC_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
       "slug": "<slug>",
       "name": "<name>"
     }'
```

## Delete an LLM Provider by its id.

`DELETE /cognitive-infrastructure/cognitive-assets/llm-provider/`

Deletes an LLM Provider based on the provided ID.

Authentication: Bearer token

### Request body

ID of the LLM Provider to delete

- `id` (string)

### Responses

- `200`: OK.
- `500`: Something went wrong while performing this action.

### Example request

```bash
curl -X DELETE "https://api.sommatic.ai/cognitive-infrastructure/cognitive-assets/llm-provider/" \
  -H "Authorization: Bearer $SOMMATIC_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
       "id": "<id>"
     }'
```

## Get an LLM Provider by query selector.

`GET /cognitive-infrastructure/cognitive-assets/llm-provider/{queryselector}`

Returns the LLM Provider information that matches the query selector and search specified in the route.

Authentication: Bearer token

### Parameters

- `queryselector` (path, enum, required): Is the filter available for this query Allowed values: `id`, `organization-id`, `all`.
- `search` (query, string): Keyword to search for entities.
- `include_status` (query, string): Optional status parameter to include LLM Providers of a specific status.
- `exclude_status` (query, string): Optional status parameter to exclude LLM Providers of a specific status.
- `page` (query, integer): Page number, starting at 1 (default 1).
- `pageSize` (query, integer): Records per page (default 25).

### Responses

- `200`: OK.
- `500`: Something was wrong while you make this action.

### Example request

```bash
curl -X GET "https://api.sommatic.ai/cognitive-infrastructure/cognitive-assets/llm-provider/<queryselector>" \
  -H "Authorization: Bearer $SOMMATIC_TOKEN"
```

## Invoke an LLM Provider configuration.

`POST /cognitive-infrastructure/cognitive-assets/llm-provider/invoke`

Uses a configured LLM Provider (by ID) to execute a chat completion or comparable operation.

Authentication: Bearer token

### Request body

Invocation parameters including model_id and input.

- `model_id` (string, required): The ID of the LLM Provider configuration.
- `operation` (string): Operation type (chat, embedding). Default is chat.
- `input` (object, required): The input payload (messages, etc.).

### Responses

- `200`: Success.

### Example request

```bash
curl -X POST "https://api.sommatic.ai/cognitive-infrastructure/cognitive-assets/llm-provider/invoke" \
  -H "Authorization: Bearer $SOMMATIC_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
       "model_id": "<model_id>",
       "input": {}
     }'
```

## Create a new prompt template.

`POST /cognitive-infrastructure/cognitive-assets/prompt-template/`

Returns the created prompt template with data provided.

Authentication: Bearer token

### Request body

Prompt template object to be created.

- `organization_id` (string): Identifier of the organization (tenant) that owns this prompt template.
- `slug` (string, required): Stable semantic key uniquely identifying this prompt template (e.g. prompt.email_classification.v1).
- `name` (string, required): Human-readable name for this template used in editors and documentation.
- `description` (string): Optional description explaining the purpose, scope and intended usage of this prompt template.
- `llm_provider_id` (string): Optional reference to an LlmProviderModel.id indicating the primary provider this template was designed for.
- `language` (string): Optional primary language of the template content (e.g. "en", "es", "pt-BR").
- `format` (string): Format of the rendered prompt such as "plain-text", "markdown" or "json-instructions".
- `system_instructions` (string): System-level instructions that define the assistant persona, constraints and global behavior.
- `template_body` (string): Main prompt template body containing variable placeholders using a chosen syntax (e.g. {{variable_name}}).
- `variables` (array<CognitivePromptTemplateVariable>): List of typed input variables that can be injected into this template at render time.
  - `name` (string, required): Variable name as referenced in the template body (e.g. "customer_name", "email_body").
  - `type` (string, required): Expected runtime type for the value injected into the template. Allowed values: `string`, `number`, `boolean`, `array`, `object`.
  - `description` (string): Human-readable explanation of what this variable represents.
  - `required` (boolean): Whether this variable must be provided when rendering the template.
  - `default_value` (any): Optional default used when the variable is not explicitly provided.
  - `allowed_values` (array<string>): Optional enumeration of allowed values when the variable is constrained.
- `output_fields` (array<CognitivePromptTemplateOutputField>): List of typed output fields the prompt is expected to produce when structured output is required.
  - `name` (string, required): Field name in the structured output (e.g. "category", "summary", "sentiment").
  - `type` (string, required): Expected type of the field value in the rendered output. Allowed values: `string`, `number`, `boolean`, `array`, `object`.
  - `description` (string): Human-readable explanation of what this field represents.
  - `required` (boolean): Whether the model is expected to always emit this field.
- `style_guidelines` (array<string>): Optional list of style or tone guidelines to be respected when rendering and using this template.
- `examples` (array<CognitivePromptTemplateExample>): Worked examples pairing a set of variable inputs with the expected model output.
  - `inputs` (object): Map of variable name to value used to render this example.
  - `expected_output` (string): Desired model response for the given inputs.
  - `notes` (string): Optional commentary about edge cases, gotchas, or rationale for the example.
- `tags` (array<string>): Optional list of free-form tags for catalog search, discovery and governance.
- `is_system` (boolean): Indicates whether this template is a system-level asset managed by the platform rather than user-created.
- `is_deprecated` (boolean): Indicates whether this template is deprecated and should not be used in new flows.

### Responses

- `200`: OK.
- `500`: Something was wrong while you make this action.

### Example request

```bash
curl -X POST "https://api.sommatic.ai/cognitive-infrastructure/cognitive-assets/prompt-template/" \
  -H "Authorization: Bearer $SOMMATIC_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
       "slug": "<slug>",
       "name": "<name>"
     }'
```

## Update an existing prompt template.

`PATCH /cognitive-infrastructure/cognitive-assets/prompt-template/`

Updates the data of an existing prompt template with the data provided.

Authentication: Bearer token

### Request body

Prompt template object to be created.

- `organization_id` (string): Identifier of the organization (tenant) that owns this prompt template.
- `slug` (string, required): Stable semantic key uniquely identifying this prompt template (e.g. prompt.email_classification.v1).
- `name` (string, required): Human-readable name for this template used in editors and documentation.
- `description` (string): Optional description explaining the purpose, scope and intended usage of this prompt template.
- `llm_provider_id` (string): Optional reference to an LlmProviderModel.id indicating the primary provider this template was designed for.
- `language` (string): Optional primary language of the template content (e.g. "en", "es", "pt-BR").
- `format` (string): Format of the rendered prompt such as "plain-text", "markdown" or "json-instructions".
- `system_instructions` (string): System-level instructions that define the assistant persona, constraints and global behavior.
- `template_body` (string): Main prompt template body containing variable placeholders using a chosen syntax (e.g. {{variable_name}}).
- `variables` (array<CognitivePromptTemplateVariable>): List of typed input variables that can be injected into this template at render time.
  - `name` (string, required): Variable name as referenced in the template body (e.g. "customer_name", "email_body").
  - `type` (string, required): Expected runtime type for the value injected into the template. Allowed values: `string`, `number`, `boolean`, `array`, `object`.
  - `description` (string): Human-readable explanation of what this variable represents.
  - `required` (boolean): Whether this variable must be provided when rendering the template.
  - `default_value` (any): Optional default used when the variable is not explicitly provided.
  - `allowed_values` (array<string>): Optional enumeration of allowed values when the variable is constrained.
- `output_fields` (array<CognitivePromptTemplateOutputField>): List of typed output fields the prompt is expected to produce when structured output is required.
  - `name` (string, required): Field name in the structured output (e.g. "category", "summary", "sentiment").
  - `type` (string, required): Expected type of the field value in the rendered output. Allowed values: `string`, `number`, `boolean`, `array`, `object`.
  - `description` (string): Human-readable explanation of what this field represents.
  - `required` (boolean): Whether the model is expected to always emit this field.
- `style_guidelines` (array<string>): Optional list of style or tone guidelines to be respected when rendering and using this template.
- `examples` (array<CognitivePromptTemplateExample>): Worked examples pairing a set of variable inputs with the expected model output.
  - `inputs` (object): Map of variable name to value used to render this example.
  - `expected_output` (string): Desired model response for the given inputs.
  - `notes` (string): Optional commentary about edge cases, gotchas, or rationale for the example.
- `tags` (array<string>): Optional list of free-form tags for catalog search, discovery and governance.
- `is_system` (boolean): Indicates whether this template is a system-level asset managed by the platform rather than user-created.
- `is_deprecated` (boolean): Indicates whether this template is deprecated and should not be used in new flows.

### Responses

- `200`: OK.
- `500`: Something was wrong while you make this action.

### Example request

```bash
curl -X PATCH "https://api.sommatic.ai/cognitive-infrastructure/cognitive-assets/prompt-template/" \
  -H "Authorization: Bearer $SOMMATIC_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
       "slug": "<slug>",
       "name": "<name>"
     }'
```

## Delete a prompt template by its id.

`DELETE /cognitive-infrastructure/cognitive-assets/prompt-template/`

Deletes a prompt template based on the provided ID.

Authentication: Bearer token

### Request body

ID of the prompt template to delete

- `id` (string)

### Responses

- `200`: OK.
- `500`: Something went wrong while performing this action.

### Example request

```bash
curl -X DELETE "https://api.sommatic.ai/cognitive-infrastructure/cognitive-assets/prompt-template/" \
  -H "Authorization: Bearer $SOMMATIC_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
       "id": "<id>"
     }'
```

## Get an prompt template by query selector.

`GET /cognitive-infrastructure/cognitive-assets/prompt-template/{queryselector}`

Returns the prompt template information that matches the query selector an search specified in the route.

Authentication: Bearer token

### Parameters

- `queryselector` (path, enum, required): Is the filter available for this query Allowed values: `id`, `organization-id`, `all`.
- `search` (query, string): Keyword to search for entities.
- `include_status` (query, string): Optional status parameter to include templates of a specific status.
- `exclude_status` (query, string): Optional status parameter to exclude templates of a specific status.
- `page` (query, integer): Page number, starting at 1 (default 1).
- `pageSize` (query, integer): Records per page (default 25).

### Responses

- `200`: OK.
- `500`: Something was wrong while you make this action.

### Example request

```bash
curl -X GET "https://api.sommatic.ai/cognitive-infrastructure/cognitive-assets/prompt-template/<queryselector>" \
  -H "Authorization: Bearer $SOMMATIC_TOKEN"
```

## Create a new datasource.

`POST /cognitive-infrastructure/connectors/external-datasource/`

Returns the created Datasource with data provided.

Authentication: Bearer token

### Request body

Datasource object to be created.

- `organization_id` (string, required): Identifier of the OrganizationModel this trigger is associated with.
- `project_id` (string): Optional project ID (tenant scope) that owns the datasource.
- `slug` (string, required): Stable semantic key uniquely identifying this datasource (e.g. ds.crm, ds.postgres.orders, ds.vector.support).
- `name` (string, required): Human-readable datasource name used in editors and documentation.
- `description` (string): Optional description explaining the dataset or system represented by this datasource.
- `datasource_kind` (string, required): Type of datasource: "postgres", "mysql", "sqlserver", "mongodb", "s3", "gcs", "snowflake", "bigquery", "elasticsearch", "vector-db", "custom".
- `connector_slug` (string): Optional reference to the ConnectorModel that handles low-level communication (HTTP, driver API, RPC proxy, cloud SDK).
- `default_collection` (string): Default dataset, table, collection or bucket that this datasource interacts with.
- `collections` (array<object>): Optional list of logical datasets or collections exposed by this datasource, each with optional schema hints.
  - `collection_key` (string)
  - `description` (string)
  - `schema` (object)
- `indexing` (object): Indexing configuration for this datasource, including primary key, vector index, or search index configuration depending on datasource_kind.
  - `primary_key` (string)
  - `vector_index` (object)
  - `search_index` (object)
- `query_capabilities` (object): Capabilities supported by this datasource, such as select, insert, update, delete, vector-search, hybrid-search, aggregation, blob-read, blob-write.
  - `select` (boolean)
  - `insert` (boolean)
  - `update` (boolean)
  - `delete` (boolean)
  - `vector_search` (boolean)
  - `hybrid_search` (boolean)
  - `blob_read` (boolean)
  - `blob_write` (boolean)
- `auth_context_required` (boolean): True if this datasource requires an identity context (tenant/user) to be resolved before queries can run.
- `allowed_agent_profile_ids` (array<string>): Optional list of AgentProfileModel identifiers allowed to perform queries against this datasource.
- `allowed_operator_slugs` (array<string>): Optional list of operator types allowed to reference this datasource (e.g. datasource.query, ai.rag.retrieve).
- `is_system` (boolean): True if this datasource is managed internally by the platform.
- `is_enabled` (boolean): True if this datasource is currently available for use.
- `is_deprecated` (boolean): True if this datasource should not be used for new flows or designs.

### Responses

- `200`: OK.
- `500`: Something was wrong while you make this action.

### Example request

```bash
curl -X POST "https://api.sommatic.ai/cognitive-infrastructure/connectors/external-datasource/" \
  -H "Authorization: Bearer $SOMMATIC_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
       "organization_id": "<organization_id>",
       "slug": "<slug>",
       "name": "<name>",
       "datasource_kind": "<datasource_kind>"
     }'
```

## Update an existing datasource.

`PATCH /cognitive-infrastructure/connectors/external-datasource/`

Updates the data of an existing Datasource with the data provided.

Authentication: Bearer token

### Request body

Datasource object to be created.

- `organization_id` (string, required): Identifier of the OrganizationModel this trigger is associated with.
- `project_id` (string): Optional project ID (tenant scope) that owns the datasource.
- `slug` (string, required): Stable semantic key uniquely identifying this datasource (e.g. ds.crm, ds.postgres.orders, ds.vector.support).
- `name` (string, required): Human-readable datasource name used in editors and documentation.
- `description` (string): Optional description explaining the dataset or system represented by this datasource.
- `datasource_kind` (string, required): Type of datasource: "postgres", "mysql", "sqlserver", "mongodb", "s3", "gcs", "snowflake", "bigquery", "elasticsearch", "vector-db", "custom".
- `connector_slug` (string): Optional reference to the ConnectorModel that handles low-level communication (HTTP, driver API, RPC proxy, cloud SDK).
- `default_collection` (string): Default dataset, table, collection or bucket that this datasource interacts with.
- `collections` (array<object>): Optional list of logical datasets or collections exposed by this datasource, each with optional schema hints.
  - `collection_key` (string)
  - `description` (string)
  - `schema` (object)
- `indexing` (object): Indexing configuration for this datasource, including primary key, vector index, or search index configuration depending on datasource_kind.
  - `primary_key` (string)
  - `vector_index` (object)
  - `search_index` (object)
- `query_capabilities` (object): Capabilities supported by this datasource, such as select, insert, update, delete, vector-search, hybrid-search, aggregation, blob-read, blob-write.
  - `select` (boolean)
  - `insert` (boolean)
  - `update` (boolean)
  - `delete` (boolean)
  - `vector_search` (boolean)
  - `hybrid_search` (boolean)
  - `blob_read` (boolean)
  - `blob_write` (boolean)
- `auth_context_required` (boolean): True if this datasource requires an identity context (tenant/user) to be resolved before queries can run.
- `allowed_agent_profile_ids` (array<string>): Optional list of AgentProfileModel identifiers allowed to perform queries against this datasource.
- `allowed_operator_slugs` (array<string>): Optional list of operator types allowed to reference this datasource (e.g. datasource.query, ai.rag.retrieve).
- `is_system` (boolean): True if this datasource is managed internally by the platform.
- `is_enabled` (boolean): True if this datasource is currently available for use.
- `is_deprecated` (boolean): True if this datasource should not be used for new flows or designs.

### Responses

- `200`: OK.
- `500`: Something was wrong while you make this action.

### Example request

```bash
curl -X PATCH "https://api.sommatic.ai/cognitive-infrastructure/connectors/external-datasource/" \
  -H "Authorization: Bearer $SOMMATIC_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
       "organization_id": "<organization_id>",
       "slug": "<slug>",
       "name": "<name>",
       "datasource_kind": "<datasource_kind>"
     }'
```

## Delete a Datasource by its id.

`DELETE /cognitive-infrastructure/connectors/external-datasource/`

Deletes a Datasource based on the provided ID.

Authentication: Bearer token

### Request body

ID of the Datasource to delete

- `id` (string)

### Responses

- `200`: OK.
- `500`: Something went wrong while performing this action.

### Example request

```bash
curl -X DELETE "https://api.sommatic.ai/cognitive-infrastructure/connectors/external-datasource/" \
  -H "Authorization: Bearer $SOMMATIC_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
       "id": "<id>"
     }'
```

## Get an Datasource by query selector.

`GET /cognitive-infrastructure/connectors/external-datasource/{queryselector}`

Returns the Datasource information that matches the query selector an search specified in the route.

Authentication: Bearer token

### Parameters

- `queryselector` (path, enum, required): Is the filter available for this query Allowed values: `id`, `organization-id`, `all`.
- `search` (query, string): Keyword to search for entities.
- `include_status` (query, string): Optional status parameter to include datasources of a specific status.
- `exclude_status` (query, string): Optional status parameter to exclude datasources of a specific status.
- `page` (query, integer): Page number, starting at 1 (default 1).
- `pageSize` (query, integer): Records per page (default 25).

### Responses

- `200`: OK.
- `500`: Something was wrong while you make this action.

### Example request

```bash
curl -X GET "https://api.sommatic.ai/cognitive-infrastructure/connectors/external-datasource/<queryselector>" \
  -H "Authorization: Bearer $SOMMATIC_TOKEN"
```

## Create a new memory store.

`POST /cognitive-infrastructure/connectors/memory-store/`

Returns the created memory store with data provided.

Authentication: Bearer token

### Request body

Memory store object to be created.

- `organization_id` (string): Identifier of the organization (tenant) that owns this memory store.
- `project_id` (string): Optional project ID (tenant scope) that owns the memory store.
- `slug` (string, required): Stable semantic key uniquely identifying this memory store (e.g. mem.support_conversation, mem.global_facts, mem.vector_personalization).
- `name` (string, required): Human-readable name of the memory store shown in editors and documentation.
- `description` (string): Optional description explaining what type of memory is stored and for which use cases.
- `memory_kind` (string, required): Type of memory backend: "kv-store", "vector-memory", "session-store", "document-memory", "hybrid".
- `connector_slug` (string): Optional reference to the ConnectorModel handling low-level access (Redis, DynamoDB, vector DB, session service, custom backend).
- `backing_datasource_key` (string): Optional DatasourceModel key when this memory store is implemented on top of a structured or vector datasource.
- `default_namespace` (string): Default namespace, bucket or logical collection used when no explicit namespace is provided.
- `partitioning` (object): Defines how memory entries are partitioned and isolated across tenants, users, flows or agents.
  - `strategy` (string): Partitioning strategy: "by-tenant", "by-subject", "by-tenant-and-subject", "by-flow", "global", "custom".
  - `keys` (array<string>): Optional list of logical partition keys derived from identity or context (e.g. ["tenant_id", "subject_id", "flow_key"]).
- `schema_hints` (object): Optional structural hints describing the typical shape of memory entries stored here, such as conversational messages, facts, embeddings or session snapshots.
  - `entry_kind` (string): High-level type of entries: "message", "fact", "embedding", "session", "mixed".
  - `fields` (object): Optional JSON-schema-like structure describing common fields of stored records.
- `retention_policy` (object): Retention and compaction strategy for memory entries, controlling how long information is preserved and how old or excess data is pruned.
  - `policy_type` (string): Retention mode: "ttl", "sliding-window", "max-entries-per-partition", "manual".
  - `ttl_ms` (integer): Default time-to-live in milliseconds for entries when policy_type is "ttl" or "sliding-window".
  - `max_entries_per_partition` (integer): Maximum number of memory entries allowed per partition before older entries are compacted or removed.
- `default_ttl_ms` (integer): Optional default TTL in milliseconds for entries when not overridden at write time. Can be used independently of retention_policy for simple expiry behavior.
- `query_capabilities` (object): Capabilities supported by this memory store: reading, writing, vector search, listing recent items, truncating sessions, etc.
  - `read_by_key` (boolean)
  - `upsert` (boolean)
  - `delete` (boolean)
  - `list_recent` (boolean)
  - `truncate_partition` (boolean)
  - `vector_search` (boolean)
- `auth_context_required` (boolean): True if this memory store requires an identity context (tenant/user) to be resolved before read/write operations.
- `allowed_agent_profile_ids` (array<string>): Optional list of AgentProfileModel identifiers allowed to use this memory store.
- `allowed_operator_slugs` (array<string>): Optional list of operator types allowed to reference this memory store (e.g. ai.chat, ai.agent, ai.rag.retrieve).
- `is_system` (boolean): True if this memory store is managed internally by the platform.
- `is_enabled` (boolean): True if this memory store is currently available for use.
- `is_deprecated` (boolean): True if this memory store should not be used for new flows or agents.

### Responses

- `200`: OK.
- `500`: Something was wrong while you make this action.

### Example request

```bash
curl -X POST "https://api.sommatic.ai/cognitive-infrastructure/connectors/memory-store/" \
  -H "Authorization: Bearer $SOMMATIC_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
       "slug": "<slug>",
       "name": "<name>",
       "memory_kind": "<memory_kind>"
     }'
```

## Update an existing memory store.

`PATCH /cognitive-infrastructure/connectors/memory-store/`

Updates the data of an existing memory store with the data provided.

Authentication: Bearer token

### Request body

Memory store object to be created.

- `organization_id` (string): Identifier of the organization (tenant) that owns this memory store.
- `project_id` (string): Optional project ID (tenant scope) that owns the memory store.
- `slug` (string, required): Stable semantic key uniquely identifying this memory store (e.g. mem.support_conversation, mem.global_facts, mem.vector_personalization).
- `name` (string, required): Human-readable name of the memory store shown in editors and documentation.
- `description` (string): Optional description explaining what type of memory is stored and for which use cases.
- `memory_kind` (string, required): Type of memory backend: "kv-store", "vector-memory", "session-store", "document-memory", "hybrid".
- `connector_slug` (string): Optional reference to the ConnectorModel handling low-level access (Redis, DynamoDB, vector DB, session service, custom backend).
- `backing_datasource_key` (string): Optional DatasourceModel key when this memory store is implemented on top of a structured or vector datasource.
- `default_namespace` (string): Default namespace, bucket or logical collection used when no explicit namespace is provided.
- `partitioning` (object): Defines how memory entries are partitioned and isolated across tenants, users, flows or agents.
  - `strategy` (string): Partitioning strategy: "by-tenant", "by-subject", "by-tenant-and-subject", "by-flow", "global", "custom".
  - `keys` (array<string>): Optional list of logical partition keys derived from identity or context (e.g. ["tenant_id", "subject_id", "flow_key"]).
- `schema_hints` (object): Optional structural hints describing the typical shape of memory entries stored here, such as conversational messages, facts, embeddings or session snapshots.
  - `entry_kind` (string): High-level type of entries: "message", "fact", "embedding", "session", "mixed".
  - `fields` (object): Optional JSON-schema-like structure describing common fields of stored records.
- `retention_policy` (object): Retention and compaction strategy for memory entries, controlling how long information is preserved and how old or excess data is pruned.
  - `policy_type` (string): Retention mode: "ttl", "sliding-window", "max-entries-per-partition", "manual".
  - `ttl_ms` (integer): Default time-to-live in milliseconds for entries when policy_type is "ttl" or "sliding-window".
  - `max_entries_per_partition` (integer): Maximum number of memory entries allowed per partition before older entries are compacted or removed.
- `default_ttl_ms` (integer): Optional default TTL in milliseconds for entries when not overridden at write time. Can be used independently of retention_policy for simple expiry behavior.
- `query_capabilities` (object): Capabilities supported by this memory store: reading, writing, vector search, listing recent items, truncating sessions, etc.
  - `read_by_key` (boolean)
  - `upsert` (boolean)
  - `delete` (boolean)
  - `list_recent` (boolean)
  - `truncate_partition` (boolean)
  - `vector_search` (boolean)
- `auth_context_required` (boolean): True if this memory store requires an identity context (tenant/user) to be resolved before read/write operations.
- `allowed_agent_profile_ids` (array<string>): Optional list of AgentProfileModel identifiers allowed to use this memory store.
- `allowed_operator_slugs` (array<string>): Optional list of operator types allowed to reference this memory store (e.g. ai.chat, ai.agent, ai.rag.retrieve).
- `is_system` (boolean): True if this memory store is managed internally by the platform.
- `is_enabled` (boolean): True if this memory store is currently available for use.
- `is_deprecated` (boolean): True if this memory store should not be used for new flows or agents.

### Responses

- `200`: OK.
- `500`: Something was wrong while you make this action.

### Example request

```bash
curl -X PATCH "https://api.sommatic.ai/cognitive-infrastructure/connectors/memory-store/" \
  -H "Authorization: Bearer $SOMMATIC_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
       "slug": "<slug>",
       "name": "<name>",
       "memory_kind": "<memory_kind>"
     }'
```

## Delete a memory store by its id.

`DELETE /cognitive-infrastructure/connectors/memory-store/`

Deletes a memory store based on the provided ID.

Authentication: Bearer token

### Request body

ID of the memory store to delete

- `id` (string)

### Responses

- `200`: OK.
- `500`: Something went wrong while performing this action.

### Example request

```bash
curl -X DELETE "https://api.sommatic.ai/cognitive-infrastructure/connectors/memory-store/" \
  -H "Authorization: Bearer $SOMMATIC_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
       "id": "<id>"
     }'
```

## Get an memory store by query selector.

`GET /cognitive-infrastructure/connectors/memory-store/{queryselector}`

Returns the memory store information that matches the query selector an search specified in the route.

Authentication: Bearer token

### Parameters

- `queryselector` (path, enum, required): Is the filter available for this query Allowed values: `id`, `organization-id`, `all`.
- `search` (query, string): Keyword to search for entities.
- `include_status` (query, string): Optional status parameter to include templates of a specific status.
- `exclude_status` (query, string): Optional status parameter to exclude templates of a specific status.
- `page` (query, integer): Page number, starting at 1 (default 1).
- `pageSize` (query, integer): Records per page (default 25).

### Responses

- `200`: OK.
- `500`: Something was wrong while you make this action.

### Example request

```bash
curl -X GET "https://api.sommatic.ai/cognitive-infrastructure/connectors/memory-store/<queryselector>" \
  -H "Authorization: Bearer $SOMMATIC_TOKEN"
```
