# Create store in slice Create a new vector store within a knowledge slice. Creates a new vector store and associates it with the specified knowledge slice. Requires the `MANAGE_KNOWLEDGE_SLICES` capability. #### Path Parameters **`organization_id`** string required The unique identifier of the organization (format: `org_*`). **`slice_id`** string required The unique identifier of the knowledge slice (format: `kslice_*`). #### Request Body **`name`** string required The name of the vector store (1-255 characters). **`description`** string optional A description of the vector store. **`access_mode`** string optional ยท Defaults to `"organization"` The access level for the store. Allowed values: `public`, `organization`, `department`, `private`. ## Returns The newly created vector store object (HTTP 201). Request ```bash cURL curl -X POST https://api.aitronos.com/v1/organizations/org_xyz789/knowledge/slices/kslice_abc123/stores \ -H "Authorization: Bearer $ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "name": "API Documentation Store", "description": "Vector store for API docs", "access_mode": "organization" }' ``` ```python Python SDK from aitronos import Aitronos client = Aitronos(api_key="your-api-key") result = client.knowledge.create_store( organization_id="org_xyz789", slice_id="kslice_abc123", name="API Documentation Store", description="Vector store for API docs", access_mode="organization", ) print(result) ``` ```python Python import requests org_id = "org_xyz789" slice_id = "kslice_abc123" url = f"https://api.aitronos.com/v1/organizations/{org_id}/knowledge/slices/{slice_id}/stores" headers = { "Authorization": "Bearer YOUR_ACCESS_TOKEN", "Content-Type": "application/json", } data = { "name": "API Documentation Store", "description": "Vector store for API docs", "access_mode": "organization", } response = requests.post(url, headers=headers, json=data) print(response.json()) ``` ```javascript JavaScript const orgId = "org_xyz789"; const sliceId = "kslice_abc123"; const response = await fetch( `https://api.aitronos.com/v1/organizations/${orgId}/knowledge/slices/${sliceId}/stores`, { method: "POST", headers: { "Authorization": `Bearer ${accessToken}`, "Content-Type": "application/json", }, body: JSON.stringify({ name: "API Documentation Store", description: "Vector store for API docs", access_mode: "organization", }), } ); const data = await response.json(); console.log(data); ``` Response ```json 201 Created { "id": "vs_store123", "name": "API Documentation Store", "description": "Vector store for API docs", "slice_id": "kslice_abc123", "organization_id": "org_xyz789", "created_by": "usr_owner1", "is_active": true, "access_mode": "organization", "file_count": 0, "data_size": 0, "created_at": "2025-06-15T10:00:00Z", "updated_at": "2025-06-15T10:00:00Z" } ``` ```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": "access_mode", "message": "access_mode must be one of {'public', 'organization', 'department', 'private'}" }, "trace_id": "abc-123-def", "timestamp": "2025-11-02T08:21:45Z" } } ``` ## Related Resources - [List Stores by Slice](/docs/api-reference/knowledge/list-stores-by-slice) - [List All Stores](/docs/api-reference/knowledge/list-stores) - [Get Store](/docs/api-reference/knowledge/get-store) - [Update Store](/docs/api-reference/knowledge/update-store) - [Delete Store](/docs/api-reference/knowledge/delete-store)