# Create composite slice Create a new composite slice that aggregates multiple knowledge slices. Creates a composite slice that references one or more existing knowledge slices as members. This allows querying across multiple slices as a single unit. Requires the `MANAGE_KNOWLEDGE_SLICES` capability. #### Path Parameters **`organization_id`** string required The unique identifier of the organization (format: `org_*`). #### Request Body **`name`** string required The name of the composite slice (1-255 characters). **`description`** string optional A description of the composite slice. **`member_slice_ids`** array of strings required List of knowledge slice IDs to include in this composite (minimum 1). ## Returns The newly created composite slice object (HTTP 201) with `is_composite` set to `true`. Request ```bash cURL curl -X POST https://api.aitronos.com/v1/organizations/org_xyz789/knowledge/composites \ -H "Authorization: Bearer $ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "name": "All Engineering Knowledge", "description": "Combines backend and frontend docs", "member_slice_ids": ["kslice_abc123", "kslice_def456"] }' ``` ```python Python SDK from aitronos import Aitronos client = Aitronos(api_key="your-api-key") result = client.knowledge.create_composite( organization_id="org_xyz789", name="All Engineering Knowledge", description="Combines backend and frontend docs", member_slice_ids=["kslice_abc123", "kslice_def456"], ) print(result) ``` ```python Python import requests org_id = "org_xyz789" url = f"https://api.aitronos.com/v1/organizations/{org_id}/knowledge/composites" headers = { "Authorization": "Bearer YOUR_ACCESS_TOKEN", "Content-Type": "application/json", } data = { "name": "All Engineering Knowledge", "description": "Combines backend and frontend docs", "member_slice_ids": ["kslice_abc123", "kslice_def456"], } response = requests.post(url, headers=headers, json=data) print(response.json()) ``` ```javascript JavaScript const orgId = "org_xyz789"; const response = await fetch( `https://api.aitronos.com/v1/organizations/${orgId}/knowledge/composites`, { method: "POST", headers: { "Authorization": `Bearer ${accessToken}`, "Content-Type": "application/json", }, body: JSON.stringify({ name: "All Engineering Knowledge", description: "Combines backend and frontend docs", member_slice_ids: ["kslice_abc123", "kslice_def456"], }), } ); const data = await response.json(); console.log(data); ``` Response ```json 201 Created { "id": "kslice_comp789", "name": "All Engineering Knowledge", "description": "Combines backend and frontend docs", "type": "standard", "is_composite": true, "owner_type": "organization", "owner_id": "org_xyz789", "status": "active", "member_slice_ids": ["kslice_abc123", "kslice_def456"], "store_count": 0, "organization_id": "org_xyz789", "created_by": "usr_owner1", "created_at": "2025-06-15T10:00:00Z", "updated_at": "2025-06-15T10:00:00Z", "archived_at": null, "archived_by": null } ``` ```json 422 Error { "success": false, "error": { "code": "VALIDATION_ERROR", "message": "The request contains invalid data.", "system_message": "Validation error", "type": "client_error", "status": 422, "details": { "field": "member_slice_ids", "message": "At least one member slice ID is required" }, "trace_id": "abc-123-def", "timestamp": "2025-11-02T08:21:45Z" } } ``` ## Related Resources - [List Composites](/docs/api-reference/knowledge/list-composites) - [Update Composite](/docs/api-reference/knowledge/update-composite) - [List Slices](/docs/api-reference/knowledge/list-slices)