CodeBeaver cloud exposes a RESTful API
The CodeBeaver API is a RESTful API that allows you to interact with CodeBeaver programmatically.
The CodeBeaver API uses API keys to authenticate requests. You can manage your API keys from the Team page. Every team can have multiple API keys. Team members can deactivate API keys if needed.
The POST Webhook endpoint allows you to programmatically trigger CodeBeaver to analyze and write tests for your code. This is particularly useful when you want to integrate CodeBeaver into your own CI/CD pipelines or development workflows.
To authenticate your request, include your API token in the Authorization header:
The token must be active and associated with your team. You can generate and manage API tokens from the CodeBeaver Team page.
The webhook accepts different types of actions through its payload. Here are the supported payload structures:
For triggering analysis on a Pull Request:
For triggering analysis on a specific commit:
type
: Specifies what you want CodeBeaver to analyze. Currently supports:
pull_request
: Analyze changes in a pull requestcommit
: Analyze changes in a specific commitaction
: Defines what CodeBeaver should do. Supports:
analyze
: Analyzes changes and provides test results and bug detection analysisanalyze-and-generate
: Does everything analyze
does, plus generates test filesdry-run
: Performs analysis and shows what would be generated without making any changesgit_provider
: Identifies which Git hosting service you’re using. Supports:
github
: GitHub repositoriesgitlab
: GitLab repositoriesbitbucket
: Bitbucket repositoriesgit_provider_id
: The unique identifier of your repository in your Git provider’s system
pr_number
: Required when type is “pull_request”. The number of the pull request to analyze
commit_sha
: Required when type is “commit”. The full SHA hash of the commit to analyze
A successful request will return:
The API may return the following error responses:
401 Unauthorized:
or
400 Bad Request:
or
or
or
Here’s a complete example showing how to trigger CodeBeaver on a pull request using curl:
And here’s how you might integrate it into a Python script:
To ensure service quality, the webhook API is rate limited. Current limits are:
When using the webhook API, consider these recommendations:
If you encounter any issues or need assistance with the webhook API:
CodeBeaver cloud exposes a RESTful API
The CodeBeaver API is a RESTful API that allows you to interact with CodeBeaver programmatically.
The CodeBeaver API uses API keys to authenticate requests. You can manage your API keys from the Team page. Every team can have multiple API keys. Team members can deactivate API keys if needed.
The POST Webhook endpoint allows you to programmatically trigger CodeBeaver to analyze and write tests for your code. This is particularly useful when you want to integrate CodeBeaver into your own CI/CD pipelines or development workflows.
To authenticate your request, include your API token in the Authorization header:
The token must be active and associated with your team. You can generate and manage API tokens from the CodeBeaver Team page.
The webhook accepts different types of actions through its payload. Here are the supported payload structures:
For triggering analysis on a Pull Request:
For triggering analysis on a specific commit:
type
: Specifies what you want CodeBeaver to analyze. Currently supports:
pull_request
: Analyze changes in a pull requestcommit
: Analyze changes in a specific commitaction
: Defines what CodeBeaver should do. Supports:
analyze
: Analyzes changes and provides test results and bug detection analysisanalyze-and-generate
: Does everything analyze
does, plus generates test filesdry-run
: Performs analysis and shows what would be generated without making any changesgit_provider
: Identifies which Git hosting service you’re using. Supports:
github
: GitHub repositoriesgitlab
: GitLab repositoriesbitbucket
: Bitbucket repositoriesgit_provider_id
: The unique identifier of your repository in your Git provider’s system
pr_number
: Required when type is “pull_request”. The number of the pull request to analyze
commit_sha
: Required when type is “commit”. The full SHA hash of the commit to analyze
A successful request will return:
The API may return the following error responses:
401 Unauthorized:
or
400 Bad Request:
or
or
or
Here’s a complete example showing how to trigger CodeBeaver on a pull request using curl:
And here’s how you might integrate it into a Python script:
To ensure service quality, the webhook API is rate limited. Current limits are:
When using the webhook API, consider these recommendations:
If you encounter any issues or need assistance with the webhook API: