> For clean Markdown content of this page, append .md to this URL. For the complete documentation index, see https://learning.postman.com/llms.txt. For full content including API reference and SDK examples, see https://learning.postman.com/llms-full.txt.

# Get an SDK Git connection

GET https://api.getpostman.com/sdk-git-connections/{sdkGitConnectionId}

Gets information about an SDK's Git connection. The response includes the SDK currently sent to the targetBranch and the most recent SDK-update pull request.

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

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: Postman API
  version: 1.0.0
paths:
  /sdk-git-connections/{sdkGitConnectionId}:
    get:
      operationId: getSdkGitConnection
      summary: Get an SDK Git connection
      description: >-
        Gets information about an SDK's Git connection. The response includes
        the SDK currently sent to the targetBranch and the most recent
        SDK-update pull request.
      tags:
        - sdKs
      parameters:
        - name: sdkGitConnectionId
          in: path
          description: The Git connection's ID.
          required: true
          schema:
            $ref: '#/components/schemas/sdkGitConnectionId'
        - name: x-api-key
          in: header
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/sdkGitConnection'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/GetSdkGitConnectionRequestUnauthorizedError
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetSdkGitConnectionRequestForbiddenError'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/commonErrorTypeTitleDetailStatus'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/commonErrorTypeTitleDetailStatus'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/GetSdkGitConnectionRequestInternalServerError
servers:
  - url: https://api.getpostman.com
    description: https://api.getpostman.com
  - url: https://api.eu.postman.com
    description: https://api.eu.postman.com
components:
  schemas:
    sdkGitConnectionId:
      type: string
      description: The Git connection's ID.
      title: sdkGitConnectionId
    elementType-2:
      type: string
      enum:
        - collection
        - spec
      description: The type of Postman element.
      title: elementType-2
    sdkSource:
      type: object
      properties:
        type:
          $ref: '#/components/schemas/elementType-2'
        id:
          type: string
          description: The ID of the Postman Collection or specification in Postman.
      required:
        - type
        - id
      description: The collection or specification that the SDK is generated from.
      title: sdkSource
    sdkLanguage:
      type: string
      enum:
        - typescript
        - python
        - go
        - java
        - csharp
        - ruby
        - php
        - kotlin
        - rust
        - cli
      description: The target output language for the generated SDK.
      title: sdkLanguage
    sdkGitConnectionStatus:
      type: string
      enum:
        - active
        - disconnected
        - inaccessible
      description: >
        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.
      title: sdkGitConnectionStatus
    autoUpdatePullRequestsEnabled:
      type: boolean
      description: >
        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.
      title: autoUpdatePullRequestsEnabled
    sdkId:
      type: string
      description: The SDK's ID.
      title: sdkId
    sdkBuildStatus:
      type: string
      enum:
        - queued
        - in_progress
        - succeeded
        - failed
      description: >
        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.
      title: sdkBuildStatus
    sdkErrorBuildStatusFailure:
      type: object
      properties:
        code:
          type: string
          description: The build failure's error code.
        message:
          type: string
          description: Information about the build failure.
      required:
        - code
        - message
      description: Information about the SDK build's status when `buildStatus` is `failed`.
      title: sdkErrorBuildStatusFailure
    sdkGitConnectionPRStatus:
      type: string
      enum:
        - open
        - merged
        - closed
      description: The lifecycle status of a pull request.
      title: sdkGitConnectionPRStatus
    sdkPullRequest:
      type: object
      properties:
        url:
          type: string
          format: uri
          description: The pull request's URL.
        status:
          $ref: '#/components/schemas/sdkGitConnectionPRStatus'
        sdkId:
          $ref: '#/components/schemas/sdkId'
      required:
        - url
        - status
        - sdkId
      description: >-
        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.
      title: sdkPullRequest
    sdk:
      type: object
      properties:
        id:
          $ref: '#/components/schemas/sdkId'
        language:
          $ref: '#/components/schemas/sdkLanguage'
        source:
          $ref: '#/components/schemas/sdkSource'
        workspaceId:
          type: string
          description: >-
            The ID of the workspace that owns the SDK, derived from the source
            entity.
        version:
          type: string
          description: >-
            The generated SDK's semantic version ID. This value is automatically
            assigned by the release/changelog pipeline.
        buildStatus:
          $ref: '#/components/schemas/sdkBuildStatus'
        error:
          $ref: '#/components/schemas/sdkErrorBuildStatusFailure'
        pullRequest:
          $ref: '#/components/schemas/sdkPullRequest'
        createdAt:
          type: string
          format: date-time
          description: The date and time at which the SDK was created.
        updatedAt:
          type: string
          format: date-time
          description: The date and time at which the SDK was last updated.
      required:
        - id
        - language
        - source
        - workspaceId
        - buildStatus
        - createdAt
        - updatedAt
      description: Information about the generated SDK.
      title: sdk
    simpleSdkGitConnectionPullRequest:
      type: object
      properties:
        url:
          type: string
          format: uri
          description: The pull request's URL.
        status:
          $ref: '#/components/schemas/sdkGitConnectionPRStatus'
        sdkId:
          $ref: '#/components/schemas/sdkId'
      required:
        - url
        - status
        - sdkId
      title: simpleSdkGitConnectionPullRequest
    sdkGitConnection:
      type: object
      properties:
        sdkGitConnectionId:
          $ref: '#/components/schemas/sdkGitConnectionId'
        source:
          $ref: '#/components/schemas/sdkSource'
        language:
          $ref: '#/components/schemas/sdkLanguage'
        status:
          $ref: '#/components/schemas/sdkGitConnectionStatus'
        repositoryUrl:
          type: string
          format: uri
          description: The canonical URL of the target Git repository.
        targetBranch:
          type: string
          default: main
          description: >-
            The branch the SDK is published to. This defaults to the `main`
            value.
        autoUpdatePullRequestsEnabled:
          $ref: '#/components/schemas/autoUpdatePullRequestsEnabled'
        sdk:
          $ref: '#/components/schemas/sdk'
        pullRequests:
          type: array
          items:
            $ref: '#/components/schemas/simpleSdkGitConnectionPullRequest'
          description: >-
            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:
          type: string
          format: date-time
          description: The date and time at which the Git connection was created.
        updatedAt:
          type: string
          format: date-time
          description: The date and time at which the Git connection was last updated.
      required:
        - sdkGitConnectionId
        - source
        - language
        - status
        - repositoryUrl
        - targetBranch
        - autoUpdatePullRequestsEnabled
        - pullRequests
        - createdAt
        - updatedAt
      description: Information about the SDK's Git connection to a Postman element.
      title: sdkGitConnection
    CommonErrorTypeTitleDetailStatusType:
      oneOf:
        - type: string
          format: uri-reference
        - type: string
      title: CommonErrorTypeTitleDetailStatusType
    commonErrorTypeTitleDetailStatus:
      type: object
      properties:
        type:
          $ref: '#/components/schemas/CommonErrorTypeTitleDetailStatusType'
        title:
          type: string
          description: A short summary of the problem.
        detail:
          type: string
          description: Information about the error.
        status:
          type: integer
          description: The error's HTTP status code.
      title: commonErrorTypeTitleDetailStatus
    CommonErrorNameMessageError:
      type: object
      properties:
        name:
          type: string
          description: The error name.
        message:
          type: string
          description: The error message.
      description: Information about the error.
      title: CommonErrorNameMessageError
    commonErrorNameMessage:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/CommonErrorNameMessageError'
          description: Information about the error.
      title: commonErrorNameMessage
    GetSdkGitConnectionRequestUnauthorizedError:
      oneOf:
        - $ref: '#/components/schemas/commonErrorTypeTitleDetailStatus'
        - $ref: '#/components/schemas/commonErrorNameMessage'
      title: GetSdkGitConnectionRequestUnauthorizedError
    GetSdkGitConnectionRequestForbiddenError:
      oneOf:
        - $ref: '#/components/schemas/commonErrorTypeTitleDetailStatus'
        - $ref: '#/components/schemas/commonErrorNameMessage'
      title: GetSdkGitConnectionRequestForbiddenError
    CommonErrorTypeTitleDetailDetail:
      oneOf:
        - type: string
        - type: object
          additionalProperties:
            description: Any type
      description: Information about the error.
      title: CommonErrorTypeTitleDetailDetail
    commonErrorTypeTitleDetail:
      type: object
      properties:
        type:
          type: string
          description: The type of error.
        title:
          type: string
          description: A short summary of the problem.
        detail:
          $ref: '#/components/schemas/CommonErrorTypeTitleDetailDetail'
          description: Information about the error.
      title: commonErrorTypeTitleDetail
    GetSdkGitConnectionRequestInternalServerError:
      oneOf:
        - $ref: '#/components/schemas/commonErrorTypeTitleDetail'
        - $ref: '#/components/schemas/commonErrorTypeTitleDetailStatus'
        - $ref: '#/components/schemas/commonErrorNameMessage'
      title: GetSdkGitConnectionRequestInternalServerError
  securitySchemes:
    PostmanApiKey:
      type: apiKey
      in: header
      name: x-api-key
    scimApiKey:
      type: apiKey
      in: header
      name: Authorization
      description: >-
        A valid [SCIM API
        key](https://learning.postman.com/docs/administration/scim-provisioning/scim-provisioning-overview/#generating-scim-api-key)
        for calls to SCIM endpoints.
    basicAuth:
      type: http
      scheme: basic

```

## Examples



**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 Successful Response
import requests

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

headers = {"x-api-key": "<apiKey>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript Successful Response
const url = 'https://api.getpostman.com/sdk-git-connections/8d4f7c1a-2b3e-4f5a-9c8d-1a2b3c4d5e6f';
const options = {method: 'GET', headers: {'x-api-key': '<apiKey>'}};

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

```go Successful Response
package main

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

func main() {

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

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("x-api-key", "<apiKey>")

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

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

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

}
```

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

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

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

request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<apiKey>'

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

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

HttpResponse<String> response = Unirest.get("https://api.getpostman.com/sdk-git-connections/8d4f7c1a-2b3e-4f5a-9c8d-1a2b3c4d5e6f")
  .header("x-api-key", "<apiKey>")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.getpostman.com/sdk-git-connections/8d4f7c1a-2b3e-4f5a-9c8d-1a2b3c4d5e6f', [
  'headers' => [
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp Successful Response
using RestSharp;

var client = new RestClient("https://api.getpostman.com/sdk-git-connections/8d4f7c1a-2b3e-4f5a-9c8d-1a2b3c4d5e6f");
var request = new RestRequest(Method.GET);
request.AddHeader("x-api-key", "<apiKey>");
IRestResponse response = client.Execute(request);
```

```swift Successful Response
import Foundation

let headers = ["x-api-key": "<apiKey>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.getpostman.com/sdk-git-connections/8d4f7c1a-2b3e-4f5a-9c8d-1a2b3c4d5e6f")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

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()
```