Skip to main content
Credal | Documentation

Search documentation

Type to search this documentation.

On this pageOverview

Create Collection

POST https://api.credal.ai/api/v0/documentCollections/createCollection Content-Type: application/json

Create a new collection. The API key used will be added to the collection for future Requests

Reference: https://docs.credal.ai/api-reference/api-reference/document-collections/create-collection

  • Authorization header (bearer token, required) — Bearer authentication of the form Bearer <token>, where token is your auth token.

This endpoint expects an object.

  • name (string, required) — A descriptive name for the collection.
  • description (string, required) — An in depth name for the agent's function. Useful for routing requests to the right agent.
  • collaborators (list of Collaborator, required) — A list of collaborator emails and roles that will have access to the agent.
  • collectionId (UUID, required)
  • email (string, required)
  • role (enum, required)
    • Allowed values: viewer, editor

Request

JSON
{
  "name": "Customer Collection",
  "description": "This collection is used to answer customer requests based on internal documentation.",
  "collaborators": [
    {
      "email": "test@gmail.com",
      "role": "editor"
    }
  ]
}

Response

JSON
{
  "collectionId": "ac20e6ba-0bae-11ef-b25a-efca73df4c3a"
}

SDK Code

Example0
import { CredalClient } from "@credal/sdk";

async function main() {
    const client = new CredalClient({
        apiKey: "YOUR_TOKEN_HERE",
    });
    await client.documentCollections.createCollection({
        name: "Customer Collection",
        description: "This collection is used to answer customer requests based on internal documentation.",
        collaborators: [
            {
                email: "test@gmail.com",
                role: "editor",
            },
        ],
    });
}
main();
Example0
from credal import CredalV0
from credal.common import Collaborator

client = CredalV0(
    api_key="YOUR_TOKEN_HERE",
)

client.document_collections.create_collection(
    name="Customer Collection",
    description="This collection is used to answer customer requests based on internal documentation.",
    collaborators=[
        Collaborator(
            email="test@gmail.com",
            role="editor",
        )
    ],
)
Suggest an edit

Propose a replacement for this page. The site team reviews it before applying any changes.

Export
Documentation menu