# Sources ## List `client.promptly.sources.list(SourceListParamsquery, RequestOptionsoptions?): SourceListResponse` **get** `/api/promptly/sources` Retrieve all data sources for the organization ### Parameters - `query: SourceListParams` - `organizationId: string` ### Returns - `SourceListResponse = Array` - `id: string` - `config: Config` Source-specific configuration - `args?: Array` Command arguments - `baseUrl?: string` Base URL for API sources - `command?: string` Command to run for stdio transport - `env?: Record` Environment variables - `transport?: "stdio" | "http" | "websocket"` MCP transport type - `"stdio"` - `"http"` - `"websocket"` - `url?: string` URL for http/websocket transport - `name: string` - `type: "mcp" | "api" | "local"` Source connection type - `"mcp"` - `"api"` - `"local"` - `authConfig?: AuthConfig` Authentication configuration - `headerName?: string` - `prefix?: string` - `provider?: string` - `authType?: "none" | "oauth" | "bearer" | 5 more` - `"none"` - `"oauth"` - `"bearer"` - `"basic"` - `"header"` - `"query"` - `"api_key"` - `"composio"` - `composioConnected?: boolean` Whether Composio OAuth is completed - `composioToolkit?: string` Composio toolkit name (e.g., 'todoist', 'github') - `createdAt?: string` - `description?: string` - `iconUrl?: string` - `isActive?: boolean` Whether the source is connected and ready - `lastConnectedAt?: string` - `organizationId?: string` - `slug?: string` URL-friendly identifier - `tools?: Array` Available tools from this source - `description?: string` - `inputSchema?: unknown` JSON Schema for tool parameters - `name?: string` - `updatedAt?: string` ### Example ```typescript import _0ct from '0ct'; const client = new _0ct({ apiKey: process.env['0CT_API_KEY'], // This is the default and can be omitted }); const sources = await client.promptly.sources.list({ organizationId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', }); console.log(sources); ``` ## Create `client.promptly.sources.create(SourceCreateParamsbody, RequestOptionsoptions?): Source` **post** `/api/promptly/sources` Create a new data source connection ### Parameters - `body: SourceCreateParams` - `config: unknown` - `name: string` - `organizationId: string` - `type: "mcp" | "api" | "local"` - `"mcp"` - `"api"` - `"local"` - `authConfig?: unknown` - `authType?: string` - `description?: string` - `iconUrl?: string` - `slug?: string` ### Returns - `Source` - `id: string` - `config: Config` Source-specific configuration - `args?: Array` Command arguments - `baseUrl?: string` Base URL for API sources - `command?: string` Command to run for stdio transport - `env?: Record` Environment variables - `transport?: "stdio" | "http" | "websocket"` MCP transport type - `"stdio"` - `"http"` - `"websocket"` - `url?: string` URL for http/websocket transport - `name: string` - `type: "mcp" | "api" | "local"` Source connection type - `"mcp"` - `"api"` - `"local"` - `authConfig?: AuthConfig` Authentication configuration - `headerName?: string` - `prefix?: string` - `provider?: string` - `authType?: "none" | "oauth" | "bearer" | 5 more` - `"none"` - `"oauth"` - `"bearer"` - `"basic"` - `"header"` - `"query"` - `"api_key"` - `"composio"` - `composioConnected?: boolean` Whether Composio OAuth is completed - `composioToolkit?: string` Composio toolkit name (e.g., 'todoist', 'github') - `createdAt?: string` - `description?: string` - `iconUrl?: string` - `isActive?: boolean` Whether the source is connected and ready - `lastConnectedAt?: string` - `organizationId?: string` - `slug?: string` URL-friendly identifier - `tools?: Array` Available tools from this source - `description?: string` - `inputSchema?: unknown` JSON Schema for tool parameters - `name?: string` - `updatedAt?: string` ### Example ```typescript import _0ct from '0ct'; const client = new _0ct({ apiKey: process.env['0CT_API_KEY'], // This is the default and can be omitted }); const source = await client.promptly.sources.create({ config: {}, name: 'name', organizationId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', type: 'mcp', }); console.log(source.id); ``` ## Retrieve `client.promptly.sources.retrieve(stringsourceID, RequestOptionsoptions?): Source` **get** `/api/promptly/sources/{sourceId}` Retrieve a specific source by ID ### Parameters - `sourceID: string` ### Returns - `Source` - `id: string` - `config: Config` Source-specific configuration - `args?: Array` Command arguments - `baseUrl?: string` Base URL for API sources - `command?: string` Command to run for stdio transport - `env?: Record` Environment variables - `transport?: "stdio" | "http" | "websocket"` MCP transport type - `"stdio"` - `"http"` - `"websocket"` - `url?: string` URL for http/websocket transport - `name: string` - `type: "mcp" | "api" | "local"` Source connection type - `"mcp"` - `"api"` - `"local"` - `authConfig?: AuthConfig` Authentication configuration - `headerName?: string` - `prefix?: string` - `provider?: string` - `authType?: "none" | "oauth" | "bearer" | 5 more` - `"none"` - `"oauth"` - `"bearer"` - `"basic"` - `"header"` - `"query"` - `"api_key"` - `"composio"` - `composioConnected?: boolean` Whether Composio OAuth is completed - `composioToolkit?: string` Composio toolkit name (e.g., 'todoist', 'github') - `createdAt?: string` - `description?: string` - `iconUrl?: string` - `isActive?: boolean` Whether the source is connected and ready - `lastConnectedAt?: string` - `organizationId?: string` - `slug?: string` URL-friendly identifier - `tools?: Array` Available tools from this source - `description?: string` - `inputSchema?: unknown` JSON Schema for tool parameters - `name?: string` - `updatedAt?: string` ### Example ```typescript import _0ct from '0ct'; const client = new _0ct({ apiKey: process.env['0CT_API_KEY'], // This is the default and can be omitted }); const source = await client.promptly.sources.retrieve('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e'); console.log(source.id); ``` ## Update `client.promptly.sources.update(stringsourceID, SourceUpdateParamsbody, RequestOptionsoptions?): Source` **patch** `/api/promptly/sources/{sourceId}` Update a source ### Parameters - `sourceID: string` - `body: SourceUpdateParams` - `authConfig?: unknown` - `authType?: string` - `config?: unknown` - `description?: string` - `isActive?: boolean` - `name?: string` ### Returns - `Source` - `id: string` - `config: Config` Source-specific configuration - `args?: Array` Command arguments - `baseUrl?: string` Base URL for API sources - `command?: string` Command to run for stdio transport - `env?: Record` Environment variables - `transport?: "stdio" | "http" | "websocket"` MCP transport type - `"stdio"` - `"http"` - `"websocket"` - `url?: string` URL for http/websocket transport - `name: string` - `type: "mcp" | "api" | "local"` Source connection type - `"mcp"` - `"api"` - `"local"` - `authConfig?: AuthConfig` Authentication configuration - `headerName?: string` - `prefix?: string` - `provider?: string` - `authType?: "none" | "oauth" | "bearer" | 5 more` - `"none"` - `"oauth"` - `"bearer"` - `"basic"` - `"header"` - `"query"` - `"api_key"` - `"composio"` - `composioConnected?: boolean` Whether Composio OAuth is completed - `composioToolkit?: string` Composio toolkit name (e.g., 'todoist', 'github') - `createdAt?: string` - `description?: string` - `iconUrl?: string` - `isActive?: boolean` Whether the source is connected and ready - `lastConnectedAt?: string` - `organizationId?: string` - `slug?: string` URL-friendly identifier - `tools?: Array` Available tools from this source - `description?: string` - `inputSchema?: unknown` JSON Schema for tool parameters - `name?: string` - `updatedAt?: string` ### Example ```typescript import _0ct from '0ct'; const client = new _0ct({ apiKey: process.env['0CT_API_KEY'], // This is the default and can be omitted }); const source = await client.promptly.sources.update('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e'); console.log(source.id); ``` ## Delete `client.promptly.sources.delete(stringsourceID, RequestOptionsoptions?): void` **delete** `/api/promptly/sources/{sourceId}` Delete a source ### Parameters - `sourceID: string` ### Example ```typescript import _0ct from '0ct'; const client = new _0ct({ apiKey: process.env['0CT_API_KEY'], // This is the default and can be omitted }); await client.promptly.sources.delete('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e'); ``` ## Test `client.promptly.sources.test(stringsourceID, RequestOptionsoptions?): SourceTestResponse` **post** `/api/promptly/sources/{sourceId}/test` Verify the source connection is working properly ### Parameters - `sourceID: string` ### Returns - `SourceTestResponse` - `message?: string` - `success?: boolean` - `tools?: Array` - `description?: string` - `inputSchema?: unknown` JSON Schema for tool parameters - `name?: string` ### Example ```typescript import _0ct from '0ct'; const client = new _0ct({ apiKey: process.env['0CT_API_KEY'], // This is the default and can be omitted }); const response = await client.promptly.sources.test('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e'); console.log(response.message); ``` ## Domain Types ### Source - `Source` - `id: string` - `config: Config` Source-specific configuration - `args?: Array` Command arguments - `baseUrl?: string` Base URL for API sources - `command?: string` Command to run for stdio transport - `env?: Record` Environment variables - `transport?: "stdio" | "http" | "websocket"` MCP transport type - `"stdio"` - `"http"` - `"websocket"` - `url?: string` URL for http/websocket transport - `name: string` - `type: "mcp" | "api" | "local"` Source connection type - `"mcp"` - `"api"` - `"local"` - `authConfig?: AuthConfig` Authentication configuration - `headerName?: string` - `prefix?: string` - `provider?: string` - `authType?: "none" | "oauth" | "bearer" | 5 more` - `"none"` - `"oauth"` - `"bearer"` - `"basic"` - `"header"` - `"query"` - `"api_key"` - `"composio"` - `composioConnected?: boolean` Whether Composio OAuth is completed - `composioToolkit?: string` Composio toolkit name (e.g., 'todoist', 'github') - `createdAt?: string` - `description?: string` - `iconUrl?: string` - `isActive?: boolean` Whether the source is connected and ready - `lastConnectedAt?: string` - `organizationId?: string` - `slug?: string` URL-friendly identifier - `tools?: Array` Available tools from this source - `description?: string` - `inputSchema?: unknown` JSON Schema for tool parameters - `name?: string` - `updatedAt?: string` ### Tool - `Tool` - `description?: string` - `inputSchema?: unknown` JSON Schema for tool parameters - `name?: string`