Create a build
POST
/buildsCreates a new build
Example
Section titled “Example”Use resource IDs from your own project. Keep the API token in your server or CI environment.
import { createConfiguration, BuildsApi } from '@testcollab/sdk';
const config = createConfiguration(process.env.TESTCOLLAB_TOKEN!);const api = new BuildsApi(config);
const result = await api.addBuild({ "buildPayload": { "version": "example", "project": 123 }});console.log(result);curl --request POST \ "https://api.testcollab.io/builds?token=$TESTCOLLAB_TOKEN" \ --header 'Content-Type: application/json' \ --data '{ "version": "example", "environment": "example", "release_date": "example", "notes": "example", "release_notes_url": "example", "source": "manual", "vcs_provider": "example", "ci_provider": "example", "commit_sha": "example"}'Request body
Section titled “Request body”| Field | Type | Required | Description |
|---|---|---|---|
version |
string | Yes | Human-facing version identifier of the software the tests run against. Stored trimmed, and must contain at least one letter or number — a value made only of whitespace or punctuation (” “, “-”, “.”) is rejected with a 400 (). |
environment |
string | No | Free-form environment name (e.g. Production, Staging, UAT). Optional — omit the key to leave it unchanged, or send an empty string to clear it. Any other value is stored trimmed and must contain at least one letter or number (). |
release_date |
string | No | — |
notes |
string | No | — |
release_notes_url |
string | No | — |
source |
string | No | How the build was created. Defaults to manual when omitted. Values: manual, ci. |
vcs_provider |
string | No | — |
ci_provider |
string | No | — |
commit_sha |
string | No | — |
branch |
string | No | — |
tag |
string | No | — |
repo_url |
string | No | — |
commit_url |
string | No | — |
build_number |
string | No | — |
build_url |
string | No | — |
external_ref |
string | No | — |
metadata |
object | No | Provider-specific fields |
release |
number | No | Release ID to assign this build to manually (optional; send null to unlink). A manual assignment overrides pattern auto-matching (). |
project |
number | Yes | — |
Response
Section titled “Response”200 — Created build
| Field | Type | Required | Description |
|---|---|---|---|
id |
number | Yes | — |
version |
string | Yes | — |
environment |
string | No | — |
source |
string | Yes | Values: manual, ci. |
release_date |
string | No | — |
created_at |
string | No | — |
{ "id": 123, "version": "example", "environment": "example", "source": "manual", "release_date": "example", "created_at": "example"}Errors
Section titled “Errors”| Status | Meaning |
|---|---|
400 |
Bad input parameter |
401 |
Unauthorized |
403 |
Forbidden |
500 |
Internal server error |