For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Fork this repoGet a demo
  • Docs
    • Welcome
    • Quickstart
    • Concepts
    • Search
    • MCP Server
    • CLI
    • Agent Skills
    • Connect
    • Add New Connector
    • Rate Limits
  • API Reference
      • GETList Source Connections
      • GETGet Source Connection
      • GETList Sync Jobs
      • POSTCreate Source Connection
      • PATCHUpdate Source Connection
      • POSTRun Sync
      • POSTCancel Sync Job
      • DELDelete Source Connection
LogoLogo
Fork this repoGet a demo
API ReferenceSource Connections

Create Source Connection

POST
/source-connections
POST
/source-connections
1import requests
2
3url = "https://api.airweave.ai/source-connections"
4
5payload = {
6 "short_name": "github",
7 "readable_collection_id": "customer-support-tickets-x7k9m"
8}
9headers = {
10 "x-api-key": "<apiKey>",
11 "Content-Type": "application/json"
12}
13
14response = requests.post(url, json=payload, headers=headers)
15
16print(response.json())
1{
2 "id": "550e8400-e29b-41d4-a716-446655440000",
3 "organization_id": "123e4567-e89b-12d3-a456-426614174000",
4 "name": "GitHub Docs Repo",
5 "short_name": "github",
6 "readable_collection_id": "documentation-ab123",
7 "status": "active",
8 "created_at": "2024-03-15T09:30:00Z",
9 "modified_at": "2024-03-15T14:22:15Z",
10 "auth": {
11 "method": "direct",
12 "authenticated": true,
13 "authenticated_at": "2024-03-15T09:30:00Z"
14 },
15 "description": "Main documentation repository",
16 "config": {
17 "branch": "main",
18 "repo_name": "company/docs"
19 },
20 "schedule": {
21 "cron": "0 */6 * * *",
22 "next_run": "2024-03-15T18:00:00Z"
23 },
24 "sync": {
25 "total_runs": 15,
26 "successful_runs": 14,
27 "failed_runs": 1,
28 "last_job": {
29 "id": "770e8400-e29b-41d4-a716-446655440002",
30 "status": "created",
31 "started_at": "2024-03-15T12:00:00Z",
32 "completed_at": "2024-03-15T12:05:32Z",
33 "duration_seconds": 332,
34 "entities_inserted": 45,
35 "entities_updated": 12
36 }
37 },
38 "entities": {
39 "total_entities": 1250,
40 "by_type": {
41 "file": {
42 "count": 1250
43 }
44 }
45 },
46 "federated_search": false
47}
Create a new source connection to sync data from an external source. The authentication method determines the creation flow: - **Direct**: Provide credentials (API key, token) directly. Connection is created immediately. - **OAuth Browser**: Returns a connection with an `auth_url` to redirect users for authentication. - **OAuth Token**: Provide an existing OAuth token. Connection is created immediately. - **Auth Provider**: Use a pre-configured auth provider (e.g., Composio, Pipedream). After successful authentication, data sync can begin automatically or on-demand.
Was this page helpful?
Previous

Update Source Connection

Next
Built with

Create a new source connection to sync data from an external source.

The authentication method determines the creation flow:

  • Direct: Provide credentials (API key, token) directly. Connection is created immediately.
  • OAuth Browser: Returns a connection with an auth_url to redirect users for authentication.
  • OAuth Token: Provide an existing OAuth token. Connection is created immediately.
  • Auth Provider: Use a pre-configured auth provider (e.g., Composio, Pipedream).

After successful authentication, data sync can begin automatically or on-demand.

Authentication

x-api-keystring
API Key authentication via header

Request

This endpoint expects an object.
short_namestringRequired

Source type identifier (e.g., ‘slack’, ‘github’, ‘notion’)

readable_collection_idstringRequired
The readable ID of the collection to add this connection to
namestring or nullOptional4-42 characters

Display name for the connection. If not provided, defaults to ‘{Source Name} Connection’.

descriptionstring or nullOptional<=255 characters
Optional description of what this connection is used for
configmap from strings to any or nullOptional

Source-specific configuration (e.g., repository name, filters)

scheduleobject or nullOptional
Optional sync schedule configuration
sync_immediatelyboolean or nullOptional

Run initial sync after creation. Defaults to True for direct/token/auth_provider, False for OAuth browser/BYOC flows (which sync after authentication)

authenticationobject or nullOptional

Authentication configuration. Type is auto-detected from provided fields.

redirect_urlstring or nullOptional

URL to redirect to after OAuth flow completes (only used for OAuth flows)

Response

Created source connection
idstringformat: "uuid"
Unique identifier of the source connection
organization_idstringformat: "uuid"
Organization this connection belongs to
namestring
Display name of the connection
short_namestring
Source type identifier
readable_collection_idstring
Collection this connection belongs to
statusenum
Current operational status of the connection
created_atstringformat: "date-time"

When the connection was created (ISO 8601)

modified_atstringformat: "date-time"

When the connection was last modified (ISO 8601)

authobject
Authentication status and details
descriptionstring or null
Optional description of the connection's purpose
configmap from strings to any or null

Source-specific configuration values

scheduleobject or null
Sync schedule configuration
syncobject or null
Sync execution history and statistics
sync_idstring or nullformat: "uuid"

ID of the associated sync (internal use)

entitiesobject or null
Summary of synced entities by type
error_categoryenum or null

Error category when status is needs_reauth (e.g. oauth_credentials_expired)

error_messagestring or null

Human-readable error message when status is needs_reauth

provider_settings_urlstring or null

URL to the auth provider’s settings dashboard (for auth_provider errors)

provider_short_namestring or null

Auth provider short_name (e.g. ‘composio’, ‘pipedream’) for display

federated_searchbooleanDefaults to false

Whether this source uses federated (real-time) search instead of syncing

Errors

422
Unprocessable Entity Error
429
Too Many Requests Error