---
title: "POST /#X-Amz-Target=com.amazonaws.codestar.connections.CodeStar_connections_20191201.CreateConnection"
method: POST
path: "/#X-Amz-Target=com.amazonaws.codestar.connections.CodeStar_connections_20191201.CreateConnection"
---

# POST /#X-Amz-Target=com.amazonaws.codestar.connections.CodeStar_connections_20191201.CreateConnection

`POST /#X-Amz-Target=com.amazonaws.codestar.connections.CodeStar_connections_20191201.CreateConnection`

Creates a connection that can then be given to other AWS services like CodePipeline so that it can access third-party code repositories. The connection is in pending status until the third-party connection handshake is completed from the console.

## Headers

- `X-Amz-Target` 'com.amazonaws.codestar.connections.CodeStar_connections_20191201.CreateConnection', required

## Request body

- CreateConnectionInput
  - `ProviderType` 'Bitbucket' | 'GitHub' | 'GitHubEnterpriseServer' — The name of the external provider where your third-party code repository is configured.
  - `ConnectionName` string, required — The name of the connection to be created. The name must be unique in the calling AWS account.
  - `Tags` Tag[] — The key-value pair to use when tagging the resource.
    - `Key` string, required — The tag's key.
    - `Value` string, required — The tag's value.
  - `HostArn` string — The Amazon Resource Name (ARN) of the host associated with the connection to be created.

## Response `200`

Success

- CreateConnectionOutput
  - `ConnectionArn` string, required — <p>The Amazon Resource Name (ARN) of the connection to be created. The ARN is used as the connection reference when the connection is shared between AWS services.</p> <note> <p>The ARN is never reused if the connection is deleted.</p> </note>
  - `Tags` Tag[] — Specifies the tags applied to the resource.
    - `Key` string, required — The tag's key.
    - `Value` string, required — The tag's value.

## Other responses

- `480` — LimitExceededException
- `481` — ResourceNotFoundException
- `482` — ResourceUnavailableException

---

[API](https://skmtc.net/aws/apis/codestar-connections.md) · [All operations](https://skmtc.net/aws/apis/codestar-connections/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/aws/codestar-connections/versions/4018814757c0/schema)
