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
Authentication
Section titled “Authentication”Authorizationheader (bearer token, required) — Bearer authentication of the formBearer <token>, where token is your auth token.
Request
Section titled “Request”Body (application/json)
Section titled “Body (application/json)”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.
Response
Section titled “Response”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.
ExportedCopilot
Section titled “ExportedCopilot”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).
Examples
Section titled “Examples”Request
{
"agentCreatedFrom": "2024-01-01T00:00:00Z",
"agentCreatedTo": "2024-12-31T23:59:59Z"
}Response
{
"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
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();
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"),
)