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
image: node:22
pipelines: default: - step: name: Import OpenAPI spec to Theneo caches: - node script: # Install CLI + login - npm install -g @theneo/cli@latest - echo "Logging in to Theneo..." - theneo login --token "$THENEO_API_KEY"
# Import the spec file
- |
theneo project import \
--project "$THENEO_PROJECT_KEY" \
--workspace "$THENEO_WORKSPACE_SLUG" \
--publish \
--file "$API_DOCUMENT_PATH" \
--import-type merge</CodeLine>
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.
Import options
- overwrite — replace the current documentation with the new spec entirely.
- merge — attempt to merge changes (experimental; may append in some cases).
- endpoints — add new endpoints into a dedicated section for manual arrangement.
Import an entire folder (Markdown + API)
To import exported Markdown content alongside your API configuration:
# bitbucket-pipelines.yml
image: node:22
pipelines: default: - step: name: Push documentation to Theneo caches: - node script: - npm install -g @theneo/cli@latest - echo "Logging in to Theneo..." - theneo login --token "$THENEO_API_KEY" - echo "Listing Theneo projects..." - theneo project list - echo "Updating the project in Theneo..." - theneo import --project "$THENEO_PROJECT_KEY" --workspace "$THENEO_WORKSPACE_SLUG" --dir "$Folder_PATH"
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.
On this page
- Bitbucket