> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.airweave.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.airweave.ai/_mcp/server.

# Update Source Connection

PATCH https://api.airweave.ai/source-connections/{source_connection_id}
Content-Type: application/json

Update an existing source connection's configuration.

You can modify:
- **Name and description**: Display information
- **Configuration**: Source-specific settings (e.g., repository name, filters)
- **Schedule**: Cron expression for automatic syncs
- **Authentication**: Update credentials (direct auth only)

Only include the fields you want to change; omitted fields retain their current values.

Reference: https://docs.airweave.ai/api-reference/source-connections/update-source-connections-source-connection-id-patch

## Authentication

- `x-api-key` header (required) — API Key authentication via header

## Servers

- `https://api.airweave.ai` (Production, default)
- `http://localhost:8001` (Local)

## Request

### Path parameters

- `source_connection_id` (string, required) — Unique identifier of the source connection to update (UUID)

### Body (application/json)

This endpoint expects a SourceConnectionUpdate.

- `name` (string, optional, nullable) — Updated display name for the connection
- `description` (string, optional, nullable) — Updated description
- `config` (map from string to any, optional, nullable) — Updated source-specific configuration
- `schedule` (ScheduleConfig, optional, nullable) — Updated sync schedule configuration
- `authentication` (SourceConnectionUpdateAuthentication, optional, nullable) — Updated authentication credentials (direct auth only)

## Response

### 200

Updated source connection

- `id` (string, required) — Unique identifier of the source connection
- `organization_id` (string, required) — Organization this connection belongs to
- `name` (string, required) — Display name of the connection
- `short_name` (string, required) — Source type identifier
- `readable_collection_id` (string, required) — Collection this connection belongs to
- `status` (enum, required) — Current operational status of the connection
  - Allowed values: `active`, `pending_auth`, `syncing`, `error`, `needs_reauth`, `inactive`, `pending_sync`
- `created_at` (string, required) — When the connection was created (ISO 8601)
- `modified_at` (string, required) — When the connection was last modified (ISO 8601)
- `auth` (AuthenticationDetails, required) — Authentication status and details
- `description` (string, optional, nullable) — Optional description of the connection's purpose
- `config` (map from string to any, optional, nullable) — Source-specific configuration values
- `schedule` (ScheduleDetails, optional, nullable) — Sync schedule configuration
- `sync` (SyncDetails, optional, nullable) — Sync execution history and statistics
- `sync_id` (string, optional, nullable) — ID of the associated sync (internal use)
- `entities` (EntitySummary, optional, nullable) — Summary of synced entities by type
- `error_category` (enum, optional, nullable) — Error category when status is needs_reauth (e.g. oauth_credentials_expired)
  - Allowed values: `oauth_credentials_expired`, `api_key_invalid`, `auth_provider_account_gone`, `auth_provider_credentials_invalid`, `usage_limit_exceeded`, `rate_limited`
- `error_message` (string, optional, nullable) — Human-readable error message when status is needs_reauth
- `provider_settings_url` (string, optional, nullable) — URL to the auth provider's settings dashboard (for auth_provider errors)
- `provider_short_name` (string, optional, nullable) — Auth provider short_name (e.g. 'composio', 'pipedream') for display
- `federated_search` (boolean, optional, default: false) — Whether this source uses federated (real-time) search instead of syncing

## Errors

### 404 Not Found Error

Source Connection Not Found

- `detail` (string, required) — Error message describing what was not found

### 422 Unprocessable Entity Error

Validation Error

- `detail` (list of ValidationErrorDetail, required) — List of validation errors

### 429 Too Many Requests Error

Rate Limit Exceeded

- `detail` (string, required) — Error message explaining the rate limit

## Types

### ScheduleConfig

Schedule configuration for syncs.

- `cron` (string, optional, nullable) — Cron expression for scheduled syncs
- `continuous` (boolean, optional, default: false) — Enable continuous sync mode
- `cursor_field` (string, optional, nullable) — Field for incremental sync

### SourceConnectionUpdateAuthentication

Updated authentication credentials (direct auth only)

### AuthenticationDetails

Authentication information.

- `method` (enum, required) — Authentication methods for source connections.
  - Allowed values: `direct`, `oauth_browser`, `oauth_token`, `oauth_byoc`, `auth_provider`
- `authenticated` (boolean, required)
- `authenticated_at` (string, optional, nullable)
- `expires_at` (string, optional, nullable)
- `auth_url` (string, optional, nullable) — For pending OAuth flows
- `auth_url_expires` (string, optional, nullable)
- `redirect_url` (string, optional, nullable)
- `claim_token` (string, optional, nullable) — One-time token to verify OAuth flow ownership. Only returned when creating an OAuth browser connection.
- `provider_readable_id` (string, optional, nullable)
- `provider_id` (string, optional, nullable)

### ScheduleDetails

Schedule information.

- `cron` (string, optional, nullable)
- `next_run` (string, optional, nullable)
- `continuous` (boolean, optional, default: false)
- `cursor_field` (string, optional, nullable)

### SyncDetails

Sync execution details.

- `total_runs` (integer, optional, default: 0)
- `successful_runs` (integer, optional, default: 0)
- `failed_runs` (integer, optional, default: 0)
- `last_job` (SyncJobDetails, optional, nullable) — Sync job details.

### EntitySummary

Entity state summary.

- `total_entities` (integer, optional, default: 0)
- `by_type` (map from string to EntityTypeStats, optional)
- `entity_id` (string, optional)
- `name` (string, optional)
- `entity_type` (string, optional)
- `source_name` (string, optional)
- `relevance_score` (double, optional, nullable)

### ValidationErrorDetail

Details about a validation error for a specific field.

- `loc` (list of string, required) — Location of the error (e.g., ['body', 'url'])
- `msg` (string, required) — Human-readable error message
- `type` (string, required) — Error type identifier

### DirectAuthentication

Direct authentication with API keys or passwords.

- `credentials` (map from string to any, required) — Authentication credentials

### OAuthTokenAuthentication

OAuth authentication with pre-obtained token.

- `access_token` (string, required) — OAuth access token
- `refresh_token` (string, optional, nullable) — OAuth refresh token
- `expires_at` (string, optional, nullable) — Token expiry time

### OAuthBrowserAuthentication

OAuth authentication via browser flow. Supports both OAuth2 and OAuth1 BYOC (Bring Your Own Client): - OAuth2 BYOC: Provide client_id + client_secret - OAuth1 BYOC: Provide consumer_key + consumer_secret

- `redirect_uri` (string, optional, nullable) — OAuth redirect URI
- `client_id` (string, optional, nullable) — OAuth2 client ID (for custom apps)
- `client_secret` (string, optional, nullable) — OAuth2 client secret (for custom apps)
- `consumer_key` (string, optional, nullable) — OAuth1 consumer key (for custom apps)
- `consumer_secret` (string, optional, nullable) — OAuth1 consumer secret (for custom apps)

### AuthProviderAuthentication

Authentication via external provider.

- `provider_readable_id` (string, required) — Auth provider readable ID
- `provider_config` (map from string to any, optional, nullable) — Provider-specific configuration

### SyncJobDetails

Sync job details.

- `id` (string, required)
- `status` (enum, required) — Sync job status enum.
  - Allowed values: `created`, `pending`, `running`, `completed`, `failed`, `cancelling`, `cancelled`
- `started_at` (string, optional, nullable)
- `completed_at` (string, optional, nullable)
- `duration_seconds` (double, optional, nullable)
- `entities_inserted` (integer, optional, default: 0)
- `entities_updated` (integer, optional, default: 0)
- `entities_deleted` (integer, optional, default: 0)
- `entities_failed` (integer, optional, default: 0)
- `error` (string, optional, nullable)
- `error_category` (enum, optional, nullable) — Error categories for credential/auth failures on source connections.
  - Allowed values: `oauth_credentials_expired`, `api_key_invalid`, `auth_provider_account_gone`, `auth_provider_credentials_invalid`, `usage_limit_exceeded`, `rate_limited`

### EntityTypeStats

Statistics for a specific entity type.

- `count` (integer, required)
- `last_updated` (string, optional, nullable)

## Examples

**Request**

```json
{}
```

**Response**

```json
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "organization_id": "123e4567-e89b-12d3-a456-426614174000",
  "name": "GitHub Docs Repo",
  "short_name": "github",
  "readable_collection_id": "documentation-ab123",
  "status": "active",
  "created_at": "2024-03-15T09:30:00Z",
  "modified_at": "2024-03-15T14:22:15Z",
  "auth": {
    "method": "direct",
    "authenticated": true,
    "authenticated_at": "2024-03-15T09:30:00Z"
  },
  "description": "Main documentation repository",
  "config": {
    "branch": "main",
    "repo_name": "company/docs"
  },
  "schedule": {
    "cron": "0 */6 * * *",
    "next_run": "2024-03-15T18:00:00Z"
  },
  "sync": {
    "total_runs": 15,
    "successful_runs": 14,
    "failed_runs": 1,
    "last_job": {
      "id": "770e8400-e29b-41d4-a716-446655440002",
      "status": "created",
      "started_at": "2024-03-15T12:00:00Z",
      "completed_at": "2024-03-15T12:05:32Z",
      "duration_seconds": 332,
      "entities_inserted": 45,
      "entities_updated": 12
    }
  },
  "entities": {
    "total_entities": 1250,
    "by_type": {
      "file": {
        "count": 1250
      }
    }
  },
  "federated_search": false
}
```

**SDK Code**

```python
import requests

url = "https://api.airweave.ai/source-connections/550e8400-e29b-41d4-a716-446655440000"

payload = {}
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.patch(url, json=payload, headers=headers)

print(response.json())
```

```typescript
import { AirweaveSDKClient } from "@airweave/sdk";

const client = new AirweaveSDKClient({ apiKey: "YOUR_API_KEY" });
await client.sourceConnections.update("550e8400-e29b-41d4-a716-446655440000");

```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.airweave.ai/source-connections/550e8400-e29b-41d4-a716-446655440000"

	payload := strings.NewReader("{}")

	req, _ := http.NewRequest("PATCH", url, payload)

	req.Header.Add("x-api-key", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.airweave.ai/source-connections/550e8400-e29b-41d4-a716-446655440000")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.patch("https://api.airweave.ai/source-connections/550e8400-e29b-41d4-a716-446655440000")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://api.airweave.ai/source-connections/550e8400-e29b-41d4-a716-446655440000', [
  'body' => '{}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.airweave.ai/source-connections/550e8400-e29b-41d4-a716-446655440000");
var request = new RestRequest(Method.PATCH);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.airweave.ai/source-connections/550e8400-e29b-41d4-a716-446655440000")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```