> This page is for Postman API Docs.

> For clean Markdown content of this page, append .md to this URL. For the complete documentation index, see https://learning.postman.com/llms.txt.

# Update an SDK Git connection

PUT https://api.postman.com/sdk-git-connections/{sdkGitConnectionId}
Content-Type: application/json

Updates the Git connection's lifecycle status:

- `active` — Connects or reconnects the repository. All auto-update pull requests resume.
- `disconnected` — Disconnects the repository, and no further auto-update pull requests are opened. The historical pull request record is preserved and remains queryable.

**Note:**

- The `autoUpdatePullRequestsEnabled` property is only available to **Enterprise** plan users and defaults to `true`. If the user is on a **Team** plan, this value is always `false`.
- This action is idempotent. Setting the fields to their current values is a no-op and still returns the connection.
- The `inaccessible` status is system-determined and can't be set with this endpoint.


Reference: https://learning.postman.com/api-docs/api-reference/sd-ks/update-sdk-git-connection

## Authentication

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

## Servers

- `https://api.postman.com` (https://api.postman.com, default)
- `https://api.eu.postman.com` (https://api.eu.postman.com)

## Request

### Path parameters

- `sdkGitConnectionId` (string, required) — The Git connection's ID.

### Body (application/json)

This endpoint expects an updateSdkGitConnection.

- `status` (enum, required) — The updated SDK Git connection lifecycle state.
  - Allowed values: `active`, `disconnected`
- `autoUpdatePullRequestsEnabled` (boolean, optional) — If true, pull requests are opened automatically whenever the source changes or a new version of the SDK generator is released. If false, pull requests are opened automatically, but only for manually-triggered SDK regeneration. If `autoUpdatePullRequestsEnabled` isn't set, the default behavior depends on the user's Postman plan: - **Enterprise** plan users — Defaults to the `true` value. - **Team** plan users and read only — Defaults to the `false` value.

## Response

### 200

Successful Response

- `sdkGitConnectionId` (string, required) — The Git connection's ID.
- `source` (sdkSource, required) — The collection or specification that the SDK is generated from.
- `language` (enum, required) — The target output language for the generated SDK.
  - Allowed values: `typescript`, `python`, `go`, `java`, `csharp`, `ruby`, `php`, `kotlin`, `rust`, `cli`
- `status` (enum, required) — The lifecycle status of the Git connection: - `active` — The connection is live and all opened pull requests ship SDK updates into the repository. - `disconnected` — The connection was explicitly disconnected by the owner, and no pull requests can be opened. The historical record is preserved. - `inaccessible` — Access to the repository was revoked or its no longer reachable.
  - Allowed values: `active`, `disconnected`, `inaccessible`
- `repositoryUrl` (string, required) — The canonical URL of the target Git repository.
- `targetBranch` (string, required, default: main) — The branch the SDK is published to. This defaults to the `main` value.
- `autoUpdatePullRequestsEnabled` (boolean, required) — If true, pull requests are opened automatically whenever the source changes or a new version of the SDK generator is released. If false, pull requests are opened automatically, but only for manually-triggered SDK regeneration. If `autoUpdatePullRequestsEnabled` isn't set, the default behavior depends on the user's Postman plan: - **Enterprise** plan users — Defaults to the `true` value. - **Team** plan users and read only — Defaults to the `false` value.
- `pullRequests` (list of simpleSdkGitConnectionPullRequest, required) — A list of SDK update pull requests on the Git connection, in order of newest first by its `updatedAt` property. This returns an empty value if no pull requests have been opened yet. For full pull request details, use the GET `/sdk-git-connections/{sdkGitConnectionId}/pull-requests` endpoint.
- `createdAt` (datetime, required) — The date and time at which the Git connection was created.
- `updatedAt` (datetime, required) — The date and time at which the Git connection was last updated.
- `sdk` (sdk, optional) — Information about the generated SDK.

## Errors

### 400 Bad Request Error

Bad Request

- `type` (string, required) — The [URI reference](https://www.rfc-editor.org/rfc/rfc3986) that identifies the type of problem.
- `title` (string, required) — A short summary of the problem.
- `status` (integer, required) — The error's HTTP status code.
- `detail` (string, optional) — Information about the error.
- `instance` (string, optional) — A URI reference that identifies the specific occurrence of the problem.
- `requestId` (string, optional) — The request's ID.

### 401 Unauthorized Error

Unauthorized

- `UpdateSdkGitConnectionRequestUnauthorizedError`
  - Error (Type, Title, Detail, Status): commonErrorTypeTitleDetailStatus
  - Error (Name, Message): commonErrorNameMessage

### 403 Forbidden Error

Forbidden

- `UpdateSdkGitConnectionRequestForbiddenError`
  - Error (Type, Title, Detail, Status): commonErrorTypeTitleDetailStatus
  - Error (Name, Message): commonErrorNameMessage

### 404 Not Found Error

Not Found

- `type` (CommonErrorTypeTitleDetailStatusType, optional) — The type of error.
- `title` (string, optional) — A short summary of the problem.
- `detail` (string, optional) — Information about the error.
- `status` (integer, optional) — The error's HTTP status code.

### 422 Unprocessable Entity Error

Unprocessable Entity

- `type` (CommonErrorTypeTitleDetailStatusType, optional) — The type of error.
- `title` (string, optional) — A short summary of the problem.
- `detail` (string, optional) — Information about the error.
- `status` (integer, optional) — The error's HTTP status code.

### 429 Too Many Requests Error

Too Many Requests

- `type` (CommonErrorTypeTitleDetailStatusType, optional) — The type of error.
- `title` (string, optional) — A short summary of the problem.
- `detail` (string, optional) — Information about the error.
- `status` (integer, optional) — The error's HTTP status code.

### 500 Internal Server Error

Internal Server Error

- `UpdateSdkGitConnectionRequestInternalServerError`
  - Error (Type, Title, Detail): commonErrorTypeTitleDetail
  - Error (Type, Title, Detail, Status): commonErrorTypeTitleDetailStatus
  - Error (Name, Message): commonErrorNameMessage

## Types

### sdkSource

The collection or specification that the SDK is generated from.

- `type` (enum, required) — The type of Postman element.
  - Allowed values: `collection`, `spec`
- `id` (string, required) — The ID of the Postman Collection or specification in Postman.

### simpleSdkGitConnectionPullRequest

- `url` (string, required) — The pull request's URL.
- `status` (enum, required) — The lifecycle status of a pull request.
  - Allowed values: `open`, `merged`, `closed`
- `sdkId` (string, required) — The SDK's ID.

### sdk

Information about the generated SDK.

- `id` (string, required) — The SDK's ID.
- `language` (enum, required) — The target output language for the generated SDK.
  - Allowed values: `typescript`, `python`, `go`, `java`, `csharp`, `ruby`, `php`, `kotlin`, `rust`, `cli`
- `source` (sdkSource, required) — The collection or specification that the SDK is generated from.
- `workspaceId` (string, required) — The ID of the workspace that owns the SDK, derived from the source entity.
- `buildStatus` (enum, required) — The SDK's build lifecycle: - `queued` — Accepted but not yet started. - `in_progress` — The SDK generation is running and in progress. - `succeeded` — The archive is built and available for download. - `failed` — The SDK generation failed. For information, check the `error` response.
  - Allowed values: `queued`, `in_progress`, `succeeded`, `failed`
- `createdAt` (datetime, required) — The date and time at which the SDK was created.
- `updatedAt` (datetime, required) — The date and time at which the SDK was last updated.
- `version` (string, optional) — The generated SDK's semantic version ID. This value is automatically assigned by the release/changelog pipeline.
- `error` (sdkErrorBuildStatusFailure, optional) — Information about the SDK build's status when `buildStatus` is `failed`.
- `pullRequest` (sdkPullRequest, optional) — If the SDK was shipped (or proposed for shipping) through a Git connection, this is a compact representation of the pull request that shipped it. Otherwise, this returns a `null` value.

### commonErrorTypeTitleDetailStatus

- `type` (CommonErrorTypeTitleDetailStatusType, optional) — The type of error.
- `title` (string, optional) — A short summary of the problem.
- `detail` (string, optional) — Information about the error.
- `status` (integer, optional) — The error's HTTP status code.

### commonErrorNameMessage

- `error` (CommonErrorNameMessageError, optional) — Information about the error.

### CommonErrorTypeTitleDetailStatusType

The type of error.

- string
- string

### commonErrorTypeTitleDetail

- `type` (string, optional) — The type of error.
- `title` (string, optional) — A short summary of the problem.
- `detail` (CommonErrorTypeTitleDetailDetail, optional) — Information about the error.

### sdkErrorBuildStatusFailure

Information about the SDK build's status when `buildStatus` is `failed`.

- `code` (string, required) — The build failure's error code.
- `message` (string, required) — Information about the build failure.

### sdkPullRequest

If the SDK was shipped (or proposed for shipping) through a Git connection, this is a compact representation of the pull request that shipped it. Otherwise, this returns a `null` value.

- `sdkId` (string, required) — The SDK's ID.
- `status` (enum, required) — The lifecycle status of a pull request.
  - Allowed values: `open`, `merged`, `closed`
- `url` (string, required) — The pull request's URL.

### CommonErrorNameMessageError

Information about the error.

- `name` (string, optional) — The error name.
- `message` (string, optional) — The error message.

### CommonErrorTypeTitleDetailDetail

Information about the error.

- string
- map from string to any

## Examples

### Enable Automatic Pull Requests

**Request**

```json
{
  "status": "active",
  "autoUpdatePullRequestsEnabled": true
}
```

**Response**

```json
{
  "sdkGitConnectionId": "8d4f7c1a-2b3e-4f5a-9c8d-1a2b3c4d5e6f",
  "source": {
    "type": "collection",
    "id": "12ece9e1-2abf-4edc-8e34-de66e74114d2"
  },
  "language": "typescript",
  "status": "active",
  "repositoryUrl": "https://git.example.com/engineering/engineering-sdk",
  "targetBranch": "main",
  "autoUpdatePullRequestsEnabled": true,
  "pullRequests": [
    {
      "url": "https://git.example.com/engineering/engineering-sdk/pull/87",
      "status": "open",
      "sdkId": "9c4e7d1a-2b3c-4f5e-8a9b-1c2d3e4f5a6b"
    }
  ],
  "createdAt": "2026-04-12T09:00:00Z",
  "updatedAt": "2026-05-30T10:21:14Z"
}
```

**SDK Code**

```python Enable Automatic Pull Requests
import requests

url = "https://api.postman.com/sdk-git-connections/8d4f7c1a-2b3e-4f5a-9c8d-1a2b3c4d5e6f"

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

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

print(response.json())
```

```javascript Enable Automatic Pull Requests
const url = 'https://api.postman.com/sdk-git-connections/8d4f7c1a-2b3e-4f5a-9c8d-1a2b3c4d5e6f';
const options = {
  method: 'PUT',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"status":"active","autoUpdatePullRequestsEnabled":true}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Enable Automatic Pull Requests
package main

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

func main() {

	url := "https://api.postman.com/sdk-git-connections/8d4f7c1a-2b3e-4f5a-9c8d-1a2b3c4d5e6f"

	payload := strings.NewReader("{\n  \"status\": \"active\",\n  \"autoUpdatePullRequestsEnabled\": true\n}")

	req, _ := http.NewRequest("PUT", 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 Enable Automatic Pull Requests
require 'uri'
require 'net/http'

url = URI("https://api.postman.com/sdk-git-connections/8d4f7c1a-2b3e-4f5a-9c8d-1a2b3c4d5e6f")

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

request = Net::HTTP::Put.new(url)
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"status\": \"active\",\n  \"autoUpdatePullRequestsEnabled\": true\n}"

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

```java Enable Automatic Pull Requests
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.put("https://api.postman.com/sdk-git-connections/8d4f7c1a-2b3e-4f5a-9c8d-1a2b3c4d5e6f")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"status\": \"active\",\n  \"autoUpdatePullRequestsEnabled\": true\n}")
  .asString();
```

```php Enable Automatic Pull Requests
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'https://api.postman.com/sdk-git-connections/8d4f7c1a-2b3e-4f5a-9c8d-1a2b3c4d5e6f', [
  'body' => '{
  "status": "active",
  "autoUpdatePullRequestsEnabled": true
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp Enable Automatic Pull Requests
using RestSharp;

var client = new RestClient("https://api.postman.com/sdk-git-connections/8d4f7c1a-2b3e-4f5a-9c8d-1a2b3c4d5e6f");
var request = new RestRequest(Method.PUT);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"status\": \"active\",\n  \"autoUpdatePullRequestsEnabled\": true\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Enable Automatic Pull Requests
import Foundation

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

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.postman.com/sdk-git-connections/8d4f7c1a-2b3e-4f5a-9c8d-1a2b3c4d5e6f")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PUT"
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()
```

### Disconnect an SDK Git Connection

**Request**

```json
{
  "status": "disconnected"
}
```

**Response**

```json
{
  "sdkGitConnectionId": "8d4f7c1a-2b3e-4f5a-9c8d-1a2b3c4d5e6f",
  "source": {
    "type": "collection",
    "id": "12ece9e1-2abf-4edc-8e34-de66e74114d2"
  },
  "language": "typescript",
  "status": "disconnected",
  "repositoryUrl": "https://git.example.com/engineering/engineering-sdk",
  "targetBranch": "main",
  "autoUpdatePullRequestsEnabled": true,
  "pullRequests": [],
  "createdAt": "2026-04-12T09:00:00Z",
  "updatedAt": "2026-05-30T10:21:14Z"
}
```

**SDK Code**

```python Disconnect an SDK Git Connection
import requests

url = "https://api.postman.com/sdk-git-connections/8d4f7c1a-2b3e-4f5a-9c8d-1a2b3c4d5e6f"

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

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

print(response.json())
```

```javascript Disconnect an SDK Git Connection
const url = 'https://api.postman.com/sdk-git-connections/8d4f7c1a-2b3e-4f5a-9c8d-1a2b3c4d5e6f';
const options = {
  method: 'PUT',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"status":"disconnected"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Disconnect an SDK Git Connection
package main

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

func main() {

	url := "https://api.postman.com/sdk-git-connections/8d4f7c1a-2b3e-4f5a-9c8d-1a2b3c4d5e6f"

	payload := strings.NewReader("{\n  \"status\": \"disconnected\"\n}")

	req, _ := http.NewRequest("PUT", 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 Disconnect an SDK Git Connection
require 'uri'
require 'net/http'

url = URI("https://api.postman.com/sdk-git-connections/8d4f7c1a-2b3e-4f5a-9c8d-1a2b3c4d5e6f")

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

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

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

```java Disconnect an SDK Git Connection
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.put("https://api.postman.com/sdk-git-connections/8d4f7c1a-2b3e-4f5a-9c8d-1a2b3c4d5e6f")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"status\": \"disconnected\"\n}")
  .asString();
```

```php Disconnect an SDK Git Connection
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'https://api.postman.com/sdk-git-connections/8d4f7c1a-2b3e-4f5a-9c8d-1a2b3c4d5e6f', [
  'body' => '{
  "status": "disconnected"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp Disconnect an SDK Git Connection
using RestSharp;

var client = new RestClient("https://api.postman.com/sdk-git-connections/8d4f7c1a-2b3e-4f5a-9c8d-1a2b3c4d5e6f");
var request = new RestRequest(Method.PUT);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"status\": \"disconnected\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Disconnect an SDK Git Connection
import Foundation

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

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.postman.com/sdk-git-connections/8d4f7c1a-2b3e-4f5a-9c8d-1a2b3c4d5e6f")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PUT"
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()
```