bitbucket

Connect Bitbucket workspaces to the organization

Completes the OAuth callback from the static /bitbucket/setup page. Recovers the org from the signed state, re-checks membership, exchanges the authorization code, binds every workspace the token can access to that org (skipping any already connected to a different org), and syncs their repositories. The response carries the org slug so the SPA can navigate to the org-scoped repos view. Yields 403 when the state is missing/expired/forged or the org is no longer the user's; 409 when every accessible workspace is already connected to another org; 502 if the OAuth exchange fails upstream.

post/api/v0/integrations/bitbucket/connect

Request

  • Base URL: https://api.harmont.dev
  • URL: https://api.harmont.dev/api/v0/integrations/bitbucket/connect
  • Auth: HTTP bearer

Request body

codestring required

Authorization code from Bitbucket.

statestring required

The signed CSRF state nonce echoed back by Bitbucket on the callback. Issued by the oauth-url endpoint and bound to the authenticated user.

Example request

{
  "code": "abc123",
  "state": "SFMyNTY..."
}

Response

The connected workspaces

orgstring required

The org slug the workspaces were connected to, recovered from the signed OAuth state. The SPA navigates to this org's repos view.

Example response

{
  "org": "acme",
  "workspaces": [
    {
      "name": "Acme Inc",
      "slug": "acme"
    }
  ]
}

Changes

No recorded changes to this operation across all 1 revision of this API.