Skip to main content
Credal | Documentation

Search documentation

Type to search this documentation.

On this pageOverview

Export

POST https://api.credal.ai/api/v0/copilots/export Content-Type: application/json

Export copilot configurations for backup or migration purposes.

IMPORTANT: This endpoint requires:

  • Admin privileges
  • The 'ai-usage-analytics-log.export' scope on the API key

Returns all deployed copilots with their full configuration including model settings, tools, and deployment details. Optional date filters can be applied to narrow down results.

Reference: https://docs.credal.ai/api-reference/api-reference/copilots/export

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

This endpoint expects an object.

  • agentCreatedFrom (datetime, optional) — Filter copilots created on or after this datetime (ISO 8601 format).
  • agentCreatedTo (datetime, optional) — Filter copilots created before or on this datetime (ISO 8601 format).
  • versionCreatedFrom (datetime, optional) — Filter copilot versions created on or after this datetime (ISO 8601 format).
  • versionCreatedTo (datetime, optional) — Filter copilot versions created before or on this datetime (ISO 8601 format).
  • limit (integer, optional) — Maximum number of copilots to return. Must be a positive integer with a maximum value of 1000. Defaults to 100.
  • cursor (string, optional) — Cursor for pagination. Use the cursor returned in the previous response to fetch the next page of results. If not provided, returns the first page.
  • data (list of ExportedCopilot, required) — List of exported copilots matching the query filters.
  • hasMore (boolean, required) — Indicates whether there are more results available for pagination.
  • nextCursor (string, optional) — Cursor to use for fetching the next page of results. This is a UUID string. If null or not present, there are no more results.
  • id (UUID, required) — The unique identifier of the copilot.
  • name (string, required) — The name of the deployed copilot version.
  • description (string, required) — The description of the deployed copilot version.
  • modelConfiguration (any, required) — Model configuration including provider, model name, temperature, and other settings.
  • aiEndpointConfiguration (any, required) — AI endpoint configuration including base URL and authentication details.
  • toolConfigurations (any, required) — List of tool configurations available to the copilot.
  • inputs (any, required) — Input variable configurations for the copilot.
  • deploymentConfiguration (any, required) — Deployment settings and configuration.
  • agentCreatedDatetime (datetime, required) — ISO 8601 timestamp when the copilot was originally created.
  • versionCreatedDatetime (datetime, required) — ISO 8601 timestamp when the deployed version was created.
  • isDeployed (boolean, required) — Indicates if the copilot is currently deployed (always true for export results).

Request

JSON
{
  "agentCreatedFrom": "2024-01-01T00:00:00Z",
  "agentCreatedTo": "2024-12-31T23:59:59Z"
}

Response

JSON
{
  "data": [
    {
      "id": "ac20e6ba-0bae-11ef-b25a-efca73df4c3a",
      "name": "Customer Support Agent",
      "description": "Handles customer inquiries based on internal documentation",
      "modelConfiguration": {
        "modelProvider": "openai",
        "modelName": "gpt-4",
        "temperature": 0.7
      },
      "aiEndpointConfiguration": {
        "baseUrl": "https://api.openai.com/v1/"
      },
      "toolConfigurations": [],
      "inputs": [],
      "deploymentConfiguration": {
        "isDeployed": true
      },
      "agentCreatedDatetime": "2024-06-15T10:30:00Z",
      "versionCreatedDatetime": "2024-06-20T14:45:00Z",
      "isDeployed": true
    }
  ],
  "hasMore": true,
  "nextCursor": "bc30e7ca-1caf-42fa-c36b-fadb84ef5d4b"
}

SDK Code

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

async function main() {
    const client = new CredalClient({
        apiKey: "YOUR_TOKEN_HERE",
    });
    await client.copilots.export({
        agentCreatedFrom: new Date("2024-01-01T00:00:00Z"),
        agentCreatedTo: new Date("2024-12-31T23:59:59Z"),
    });
}
main();
Example0
from credal import CredalV0
import datetime

client = CredalV0(
    api_key="YOUR_TOKEN_HERE",
)

client.copilots.export(
    agent_created_from=datetime.datetime.fromisoformat("2024-01-01T00:00:00+00:00"),
    agent_created_to=datetime.datetime.fromisoformat("2024-12-31T23:59:59+00:00"),
)
Suggest an edit

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

Export
Documentation menu