# Test source connectivity Verify that a source's credentials and configuration are valid. Tests the connectivity of a source configuration. Can test an existing source by ID or a new configuration inline. #### Path Parameters **`organization_id`** string required The unique identifier of the organization (format: `org_*`). #### Request Body **`source_id`** string optional Test an existing source by its ID. **`source_definition_id`** string optional Source definition to use for inline testing. **`workspace_id`** string optional Workspace context for inline testing. **`configuration`** object optional Configuration to test (for inline testing). **`name`** string optional Source name (for inline testing). ## Returns A test result object with `status` (e.g., `succeeded`, `failed`) and optional `job_info`. Request ```bash cURL curl -X POST "https://api.aitronos.com/v1/organizations/org_xyz789/knowledge/connectors/sources/test" \ -H "Authorization: Bearer $ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{"source_id": "src_abc123"}' ``` ```python Python SDK from aitronos import Aitronos client = Aitronos(api_key="your-api-key") result = client.knowledge_connectors.test_source( organization_id="org_xyz789", source_id="src_abc123", ) print(result) ``` ```python Python import requests org_id = "org_xyz789" url = f"https://api.aitronos.com/v1/organizations/{org_id}/knowledge/connectors/sources/test" headers = { "Authorization": "Bearer YOUR_ACCESS_TOKEN", "Content-Type": "application/json", } data = {"source_id": "src_abc123"} response = requests.post(url, headers=headers, json=data) print(response.json()) ``` ```javascript JavaScript const response = await fetch( "https://api.aitronos.com/v1/organizations/org_xyz789/knowledge/connectors/sources/test", { method: "POST", headers: { Authorization: "Bearer YOUR_ACCESS_TOKEN", "Content-Type": "application/json", }, body: JSON.stringify({ source_id: "src_abc123" }), } ); const data = await response.json(); console.log(data); ``` Response ```json 200 OK { "status": "succeeded", "job_info": null } ``` ```json Test failed { "status": "failed", "job_info": { "message": "Connection refused" } } ``` ## Related Resources - [Sources](/docs/api-reference/knowledge-connectors/sources) - [Source Definitions](/docs/api-reference/knowledge-connectors/source-definitions) - [Source OAuth](/docs/api-reference/knowledge-connectors/source-oauth)