Bitbucket
Bitbucket Pipelines keep your API documentation in sync with your repository — every push updates Theneo automatically. Here's how to set it up.
Step 1: Create your Theneo documentation
Start by creating an API documentation project in Theneo.
Prerequisites
- An established documentation project on Theneo.
- A generated API key from your account.
- Your API documentation file in your Bitbucket repository.
Step 2: Configure the pipeline
Add Theneo's automation to your bitbucket-pipelines.yml so your docs update with each repository change.
Import a single API spec
Bitbucket-pipelines.yml
# bitbucket-pipelines.yml
image: node:22
pipelines:
default:
- step:
name: Import OpenAPI spec to Theneo
caches:
- node
script:
- npm install -g @theneo/cli@latest
- theneo login --token "$THENEO_API_KEY"
- >-
theneo project import
--project "$THENEO_PROJECT_KEY"
--workspace "$THENEO_WORKSPACE_SLUG"
--file "$API_DOCUMENT_PATH"
--import-type merge
--publish
Variables
API_DOCUMENT_PATH— the path to your API spec within your repository (e.g.docs/petstore.yaml).THENEO_PROJECT_KEY— your project's slug. Find it in your project URL:https://app.theneo.io/[workspace-name]/[project-slug]— e.g. forhttps://app.theneo.io/theneo/bitbucket-demo, the slug isbitbucket-demo.THENEO_API_KEY— your Theneo API key, generated from the Theneo website.THENEO_WORKSPACE_SLUG— your workspace slug, the first part of your project URL.DOCS_FOLDER_PATH— the folder that holds your exported Markdown (used by the folder import below).
Import options
- merge — updates only the sections whose API contract changed and keeps your customizations (recommended).
- append — adds new sections and endpoints on top of your existing docs.
- overwrite — replaces the current documentation with the new spec.
- endpoints — adds endpoints to the Collections tab for manual placement.
Import an entire folder (Markdown + API)
To import exported Markdown content alongside your API configuration:
Bitbucket-pipelines.yml
# bitbucket-pipelines.yml
image: node:22
pipelines:
default:
- step:
name: Push documentation to Theneo
caches:
- node
script:
- npm install -g @theneo/cli@latest
- theneo login --token "$THENEO_API_KEY"
- theneo import --project "$THENEO_PROJECT_KEY" --workspace "$THENEO_WORKSPACE_SLUG" --dir "$DOCS_FOLDER_PATH" --publish
Once the pipeline runs, your API documentation in Theneo reflects every change pushed to your repository — keeping an accurate, up-to-date reference for your developers and stakeholders.
Was this section helpful?
On this page
- Bitbucket