Integrations
Preview

Connect GitLab, Bitbucket or Azure DevOps

Checks the token with the host before anything is kept, keeps it in the secret store, makes the secret the host's webhook is set up with and returns it once in `webhookSecret`. A source reads through the connection when its `credentialsRef` is the answer's `credentialsRef` and its URL is under the c

POST
/git-hosts
cookiebetter-auth.session_token<token>

Better Auth session cookie. Production uses the __Secure- prefixed name.

Idempotency-Key?string

Makes retries safe. A repeated key with the same request returns the first result and sets Idempotent-Replayed: true. The same key with a different request answers 409 idempotency.key_reused, and while the first request is still running 409 idempotency.in_progress. Results are kept for 24 hours. Server errors and refusals for lack of sign-in or permission are not kept, so a retry runs again.

Match^[A-Za-z0-9_.:-]+$
Length1 <= length <= 255
application/json
  1. body
kind*GitHostKind

The git host. gitlab is gitlab.com or a self-managed GitLab; bitbucket is Bitbucket Cloud (Data Center is not supported); azure-devops is Azure DevOps Services, or Azure DevOps Server at its own address; github-enterprise is GitHub Enterprise Server at its own address (github.com is connected as a GitHub App); gitea is Gitea or Forgejo at its own address.

Value in"gitlab""bitbucket""azure-devops""github-enterprise""gitea"
name*string

Tells the organization's connections apart, such as platform group.

Length1 <= length <= 63
baseUrl?string

Where repositories of the connection are, and what they must be under. GitLab: the instance, default https://gitlab.com. Bitbucket: https://bitbucket.org/<workspace>. Azure DevOps: https://dev.azure.com/<organization>, or a Server collection such as https://ado.example.com/tfs/DefaultCollection.

Lengthlength <= 512
auth?GitHostAuth

token is an access token: a GitLab personal, project or group access token (scopes api, or read_api plus read_repository when no status or comment is wanted); a Bitbucket repository, project or workspace access token; an Azure DevOps personal access token (Code read and status, Pull request threads read and write). basic is a Bitbucket app password or API token with the account's user name.

Value in"token""basic"
username?string

The Bitbucket user name, for basic only.

Lengthlength <= 254
token*string

The token or password. Kept in the secret store, never returned.

Length1 <= length <= 4096
caPem?string

PEM certificates of a private certificate authority the instance's certificate chains to, added to the public roots for this connection. Certificates only; a key is refused.

Lengthlength <= 65536

Response Body

The connection, with its webhook secret this once.

application/json
  1. response
id*string
Formatuuid
kind*GitHostKind

The git host. gitlab is gitlab.com or a self-managed GitLab; bitbucket is Bitbucket Cloud (Data Center is not supported); azure-devops is Azure DevOps Services, or Azure DevOps Server at its own address; github-enterprise is GitHub Enterprise Server at its own address (github.com is connected as a GitHub App); gitea is Gitea or Forgejo at its own address.

Value in"gitlab""bitbucket""azure-devops""github-enterprise""gitea"
name*string
baseUrl*string
auth*GitHostAuth

token is an access token: a GitLab personal, project or group access token (scopes api, or read_api plus read_repository when no status or comment is wanted); a Bitbucket repository, project or workspace access token; an Azure DevOps personal access token (Code read and status, Pull request threads read and write). basic is a Bitbucket app password or API token with the account's user name.

Value in"token""basic"
username?string
credentialsRef*string

What a source's credentialsRef is set to, to read through this connection.

webhookPath*string

The path, under this server's public address, the host's webhook is set up to call.

webhookHint?string

The last four characters of the webhook's signing secret, for showing it masked.

hasPrivateCa?boolean

Whether the connection trusts a private certificate authority of its own.

paused?boolean
projects?array<string>

The repositories the connection covers, as paths on the host; empty means all.

posts?

What Wardn writes back to the host, each on or off.

webhookSecret?string

The secret the host's webhook is set up with: GitLab's secret token, Bitbucket's webhook secret, or the password of an Azure DevOps service hook's basic authentication (any user name). Present only in the answer that made the connection; keep it, it is not shown again.

lastDeliveryAt?|
Formatdate-time
createdAt*string
Formatdate-time
updatedAt*string
Formatdate-time
Example Request
curl -X POST 'https://wardn.example.com/api/v1/git-hosts' \  -H 'Content-Type: application/json' \  -d '{  "kind": "gitlab",  "name": "string",  "token": "string"}'
Example Response
{  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "kind": "gitlab",  "name": "string",  "baseUrl": "string",  "auth": "token",  "username": "string",  "credentialsRef": "githost:0193a3f1-7e5c-7b6a-9f00-000000000001",  "webhookPath": "string",  "webhookHint": "string",  "hasPrivateCa": true,  "paused": true,  "projects": [    "string"  ],  "posts": {    "syncStatus": true,    "releaseStatus": true,    "comment": true,    "previewLink": true,    "environments": [      "string"    ]  },  "webhookSecret": "string",  "lastDeliveryAt": "2019-08-24T14:15:22Z",  "createdAt": "2019-08-24T14:15:22Z",  "updatedAt": "2019-08-24T14:15:22Z"}