Connect a Git repository to an SDK

View as Markdown
Connects a Postman source element (collection or specification) to a Git repository for one SDK language. This creates a new connection in the `active` state. **Note:** - Each source and language pair maps to a single connection. If a connection already exists for the pair, this returns `409 Conflict` response. - To update an existing connection, use the PUT `/sdk-git-connections/{sdkGitConnectionId}` endpoint. - The `autoUpdatePullRequestsEnabled` property is is only available to **Enterprise** plan users. If the user is on a **Team** plan, this value is always `false`.

Authentication

x-api-keystring
API Key authentication via header
OR
Authorizationstring
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.
OR
AuthorizationBasic

Basic authentication of the form Basic <base64(username:password)>.

Request

This endpoint expects an object.
sourceobjectRequired
The collection or specification that the SDK is generated from.
languageenumRequired
The target output language for the generated SDK.
repositoryUrlstringRequiredformat: "uri"
The canonical URL of the target Git repository.
targetBranchstringOptionalDefaults to main

The branch the SDK is published to. Defaults to main.

autoUpdatePullRequestsEnabledbooleanOptional

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 headers

Locationstring
The URL of the created Git connection resource.

Response

Successful Response
sdkGitConnectionIdstring
The Git connection's ID.
sourceobject
The collection or specification that the SDK is generated from.
languageenum
The target output language for the generated SDK.
statusenum

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.
repositoryUrlstringformat: "uri"
The canonical URL of the target Git repository.
targetBranchstringDefaults to main

The branch the SDK is published to. This defaults to the main value.

autoUpdatePullRequestsEnabledboolean

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.
pullRequestslist of objects

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.

createdAtdatetime
The date and time at which the Git connection was created.
updatedAtdatetime
The date and time at which the Git connection was last updated.
sdkobject
Information about the generated SDK.

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
409
Conflict Error
429
Too Many Requests Error
500
Internal Server Error