Skip to content
Cloud
Docs

Build API reference

Remote source-to-artifact builds for Socra projects.

Published contracts: @socra/build-api@0.2.0.

Base URL

https://build.socra.cloud

Builds

An immutable source-to-artifact execution.

Create build

POST/v1/builds

Request body

project_idcustomrequired
repositorystringrequired
pattern: ^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$
refstringoptional
default: "main" · min length: 1 · max length: 256
profile"bun-web" | "bun-service" | "docker"required
rootstringoptional
default: "."
namestringrequired
min length: 1 · max length: 63 · pattern: ^[a-z0-9]+(?:-[a-z0-9]+)*$
source_archivestringoptional
min length: 1
source_digeststringoptional
pattern: ^sha256:[0-9a-f]{64}$

Response

17 fields

idcustomrequired
project_idcustomrequired
repositorystringrequired
pattern: ^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$
refstringrequired
min length: 1 · max length: 256
commit_shastring | nullrequired
profile"bun-web" | "bun-service" | "docker"required
rootstringrequired
namestringrequired
min length: 1 · max length: 63 · pattern: ^[a-z0-9]+(?:-[a-z0-9]+)*$
status"queued" | "running" | "succeeded" | "failed" | "cancelled"required
artifact_idstring | nullrequired
errorstring | nullrequired
logsstringrequired
cache_hitbooleanrequired
created_atcustomrequired
updated_atcustomrequired
started_atcustom | nullrequired
finished_atcustom | nullrequired

List builds

GET/v1/builds

Query parameters

project_idcustomrequired
status"queued" | "running" | "succeeded" | "failed" | "cancelled"optional
limitintegeroptional
min: 1 · max: 100
afterstringoptional

Response

2 fields

dataobject[]required
idcustomrequired
project_idcustomrequired
repositorystringrequired
pattern: ^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$
refstringrequired
min length: 1 · max length: 256
commit_shastring | nullrequired
profile"bun-web" | "bun-service" | "docker"required
rootstringrequired
namestringrequired
min length: 1 · max length: 63 · pattern: ^[a-z0-9]+(?:-[a-z0-9]+)*$
status"queued" | "running" | "succeeded" | "failed" | "cancelled"required
artifact_idstring | nullrequired
errorstring | nullrequired
logsstringrequired
cache_hitbooleanrequired
created_atcustomrequired
updated_atcustomrequired
started_atcustom | nullrequired
finished_atcustom | nullrequired
has_morebooleanrequired

Get build

GET/v1/builds/{id}

Path parameters

idcustomrequired

Query parameters

No query parameters

Response

17 fields

idcustomrequired
project_idcustomrequired
repositorystringrequired
pattern: ^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$
refstringrequired
min length: 1 · max length: 256
commit_shastring | nullrequired
profile"bun-web" | "bun-service" | "docker"required
rootstringrequired
namestringrequired
min length: 1 · max length: 63 · pattern: ^[a-z0-9]+(?:-[a-z0-9]+)*$
status"queued" | "running" | "succeeded" | "failed" | "cancelled"required
artifact_idstring | nullrequired
errorstring | nullrequired
logsstringrequired
cache_hitbooleanrequired
created_atcustomrequired
updated_atcustomrequired
started_atcustom | nullrequired
finished_atcustom | nullrequired

Cancel build

POST/v1/builds/{id}/cancel

Path parameters

idcustomrequired

Request body

No request body

Response

17 fields

idcustomrequired
project_idcustomrequired
repositorystringrequired
pattern: ^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$
refstringrequired
min length: 1 · max length: 256
commit_shastring | nullrequired
profile"bun-web" | "bun-service" | "docker"required
rootstringrequired
namestringrequired
min length: 1 · max length: 63 · pattern: ^[a-z0-9]+(?:-[a-z0-9]+)*$
status"queued" | "running" | "succeeded" | "failed" | "cancelled"required
artifact_idstring | nullrequired
errorstring | nullrequired
logsstringrequired
cache_hitbooleanrequired
created_atcustomrequired
updated_atcustomrequired
started_atcustom | nullrequired
finished_atcustom | nullrequired

Artifacts

A content-addressed OCI image produced by a build.

List artifacts

GET/v1/artifacts

Query parameters

project_idcustomrequired
build_idcustomoptional
limitintegeroptional
min: 1 · max: 100
afterstringoptional

Response

2 fields

dataobject[]required
idcustomrequired
project_idcustomrequired
build_idcustomrequired
namestringrequired
imagestringrequired
pattern: ^[a-z0-9.-]+(?::[0-9]+)?\/[a-z0-9._/-]+@sha256:[0-9a-f]{64}$
digeststringrequired
pattern: ^sha256:[0-9a-f]{64}$
created_atcustomrequired
has_morebooleanrequired

Get artifact

GET/v1/artifacts/{id}

Path parameters

idcustomrequired

Query parameters

No query parameters

Response

7 fields

idcustomrequired
project_idcustomrequired
build_idcustomrequired
namestringrequired
imagestringrequired
pattern: ^[a-z0-9.-]+(?::[0-9]+)?\/[a-z0-9._/-]+@sha256:[0-9a-f]{64}$
digeststringrequired
pattern: ^sha256:[0-9a-f]{64}$
created_atcustomrequired