---
title: "POST /api/v2/secret-scanning/data-sources/bitbucket"
method: POST
path: "/api/v2/secret-scanning/data-sources/bitbucket"
tags: ["Secret Scanning"]
---

# POST /api/v2/secret-scanning/data-sources/bitbucket

`POST /api/v2/secret-scanning/data-sources/bitbucket`

Create a Bitbucket Data Source for the specified project.

## Request body

- object
  - `name` string, required — The name of the Bitbucket Data Source to create. Must be slug-friendly.
  - `projectId` string, required — The ID of the project to create the Bitbucket Data Source in.
  - `description` string, nullable — An optional description for the Bitbucket Data Source.
  - `connectionId` string, uuid, required — The ID of the Bitbucket Connection to use for this Data Source.
  - `isAutoScanEnabled` boolean — Whether scans should be automatically performed when a push occurs to repositories associated with this Data Source.
  - `config` object, required
    - `workspaceSlug` string, required — The workspace to scan.
    - `includeRepos` string[] — The repositories to include when scanning. Defaults to all repositories (["*"]).

## Response `200`

Default Response

- object
  - `dataSource` object, required
    - `id` string, uuid, required
    - `externalId` string, nullable
    - `name` string, required
    - `description` string, nullable
    - `encryptedCredentials` unknown
    - `isAutoScanEnabled` boolean, nullable
    - `projectId` string, required
    - `createdAt` string, date-time, required
    - `updatedAt` string, date-time, required
    - `isDisconnected` boolean
    - `type` 'bitbucket', required
    - `connectionId` string, uuid, required
    - `connection` object, required
      - `app` 'bitbucket', required
      - `name` string, required
      - `id` string, uuid, required
    - `config` object, required
      - `workspaceSlug` string, required — The workspace to scan.
      - `includeRepos` string[] — The repositories to include when scanning. Defaults to all repositories (["*"]).

## Other responses

- `400` — Default Response
- `401` — Default Response
- `403` — Default Response
- `404` — Default Response
- `422` — Default Response
- `500` — Default Response

---

[API](https://skmtc.net/infisical/apis/infisical-api.md) · [All operations](https://skmtc.net/infisical/apis/infisical-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/infisical/infisical-api/revisions/885aef3e6c11/schema)
