Skip to content

Builds

The /builds endpoint allows you to list existing builds and trigger new build executions. A build generates executable process instances (e.g. Informatica mappings, DDL statements) from patterns and instance metadata.

See Also

GET /api/v1/builds — Find Builds

Retrieve a list of builds matching the specified filter criteria.

Endpoint

GET https://app.metakraftwerk.com/api/v1/builds

Query Parameters

ParameterTypeRequiredDescription
projectstringNoFilter by project name.
project_idintegerNoFilter by project ID.
userstringNoFilter by username who started the build.
user_idintegerNoFilter by user ID who started the build.
patternstringNoFilter by pattern name.
pattern_idintegerNoFilter by pattern ID.
releasesobjectNoJSON object mapping release group names to release names (e.g. {"DWH_GROUP": "R1"}).

Response Schema

Returns an array of build objects:

FieldTypeDescription
idintegerUnique build ID.
customer_idintegerCustomer ID.
user_idintegerUser ID who started the build.
project_idintegerProject ID.
progressintegerBuild progress percentage (0–100).
statusstringBuild status: BUILDING, FINISHED, FAILED, CANCELED.
messagestringCurrent status message.
build_startstringISO 8601 timestamp of build start.
build_endstringISO 8601 timestamp of build completion.
created_atstringISO 8601 timestamp of build creation.
updated_atstringISO 8601 timestamp of last update.
history_commitedintegerWhether the history has been committed.
versionintegerBuild version.
activeintegerWhether the build is active.
mtsintegerInternal timestamp.
namestringBuild name.
deliveries_calculatedintegerWhether deliveries have been calculated.
descriptionstringBuild description.
commit_indintegerCommit indicator.
deletedintegerWhether the build is deleted.
instancesintegerNumber of instances in the build.
patternsinteger[]Array of pattern IDs included in the build.
releasesinteger[]Array of release IDs included in the build.
downloadsobject[]Array of download objects (see Downloads).

Examples

cURL

bash
curl -X GET "https://app.metakraftwerk.com/api/v1/builds?project=DEMO_PROJECT" \
  -H "Authorization: Bearer $ACCESS_TOKEN"

JavaScript (Fetch)

javascript
const response = await fetch(
  'https://app.metakraftwerk.com/api/v1/builds?project=DEMO_PROJECT',
  { headers: { 'Authorization': `Bearer ${accessToken}` } }
);

const builds = await response.json();

Error Responses

StatusConditionExample Message
401Missing or invalid tokenNot authenticated
403User lacks project accessYou don't have permissions to access this project!
404Project not foundA project with the name 'X' does not exist!

GET /api/v1/builds/:id — Get Build

Retrieve a single build by its ID, including download links if the build has finished.

Endpoint

GET https://app.metakraftwerk.com/api/v1/builds/:id

Path Parameters

ParameterTypeRequiredDescription
idintegerYesThe build ID.

Response Schema

Returns a single build object with the same schema as the find response. If the build has finished, the downloads array contains the generated files.

Examples

cURL

bash
curl -X GET "https://app.metakraftwerk.com/api/v1/builds/5139" \
  -H "Authorization: Bearer $ACCESS_TOKEN"

JavaScript (Fetch)

javascript
const response = await fetch(
  'https://app.metakraftwerk.com/api/v1/builds/5139',
  { headers: { 'Authorization': `Bearer ${accessToken}` } }
);

const build = await response.json();

Error Responses

StatusConditionExample Message
401Missing or invalid tokenNot authenticated
404Build not foundNo record found for id 'X'

POST /api/v1/builds — Create Build

Start a new build for one or more instances.

Endpoint

POST https://app.metakraftwerk.com/api/v1/builds

Authentication

The authenticated user must have write_builds permission on the target project.

Request Headers

HeaderValue
Content-Typeapplication/json
AuthorizationBearer <ACCESS_TOKEN>

Request Body

FieldTypeRequiredDescription
projectstringYes*Project name. Mutually exclusive with project_id.
project_idintegerYes*Project ID. Mutually exclusive with project.
instancesobject[]YesArray of instance definitions to build.
releasesobjectNoObject mapping release group names to release names (e.g. {"DWH_GROUP": "R1"}).
descriptionstringNoDescription for the build.
waitbooleanNoWhen true, the request blocks until the build completes and returns the full result with downloads. Defaults to false.
restorebooleanNoWhen true, restores deleted instances before building. Defaults to false.

TIP

* Exactly one of project or project_id is required.

Instance Definition

Each entry in the instances array can be specified in two ways:

By ID:

FieldTypeDescription
idintegerInstance ID.

By name:

FieldTypeDescription
patternstringPattern name.
folderstringFolder path (e.g. /BUSINESS_VAULT).
namestringInstance name.

By name pattern (*):

You can pass the literal string "*" as name to dynamically resolve the build set instead of listing every instance by hand. The build service expands a * entry into one entry per matching instance by calling the find endpoint of the instances API internally. pattern and folder are still required on the entry — they constrain the lookup to one folder of one pattern. To match across several folders, add one * entry per folder.

In addition to pattern, folder and name, the entry can carry any of the filter fields below. They are forwarded to the instances find endpoint as query parameters. See the instance filter parameters for the full semantics of each.

FieldTypeDescription
patternstringRequired. Pattern name.
folderstringRequired. Folder path (e.g. /BUSINESS_VAULT).
namestringRequired. Must be "*" to enable expansion.
checked_outbooleanRestrict to checked-out (true) or checked-in (false) instances.
checked_out_by_user_idintegerTogether with checked_out=true, restrict to instances locked by this user id.
checked_out_by_userstringTogether with checked_out=true, restrict to instances locked by this user name.
deletedbooleantrue matches soft-deleted instances; false matches non-deleted instances. Combine with the top-level restore: true to also build deleted instances.
labelsstring[]Match instances that carry at least one of the given label names.
upload_disabledbooleanFilter by the upload-disabled flag.
insert_disabledbooleanFilter by the insert-disabled flag.
edit_disabledbooleanFilter by the edit-disabled flag.

The lookup is always constrained to:

  • the project the build is started in (taken from the top-level project / project_id),
  • the releases you passed at the top level (so the asterisk only resolves instances that exist in those releases),
  • invalid: false — instances with validation errors are never expanded into the build set,
  • build_disabled: false — instances whose build is disabled are skipped (they could not be built anyway).

These four constraints are not user-overridable.

TIP

The * shortcut is purely a convenience. It is fully equivalent to first calling GET /api/v1/instances with the same filters, collecting the resulting (pattern, folder, name) triples, and passing them as explicit By name entries. Use it when the build set should be derived dynamically — for example "build every checked-out instance with the ready label".

Example: build every checked-out instance with a label

json
{
  "project": "DEMO_PROJECT",
  "releases": { "DWH_GROUP": "R1" },
  "instances": [
    {
      "pattern": "CORE_DV_HLS",
      "folder": "/BUSINESS_VAULT",
      "name": "*",
      "checked_out": true,
      "labels": ["ready"]
    }
  ]
}

Example: combine * with explicit entries

json
{
  "project": "DEMO_PROJECT",
  "releases": { "DWH_GROUP": "R1" },
  "instances": [
    { "id": 4711 },
    { "pattern": "FACT", "folder": "/STG", "name": "ORDERS" },
    { "pattern": "DIM",  "folder": "/LDG", "name": "*", "labels": ["ready"] }
  ]
}

Response Schema

FieldTypeDescription
buildobjectThe created build object.
build.idintegerBuild ID.
build.statusstringBuild status (BUILDING or FINISHED if wait=true).
build.progressintegerBuild progress (0–100).
build.downloadsobject[]Array of download objects (only populated when wait=true and status is FINISHED).
build.downloads[].idintegerDownload ID. Use with the Downloads API to retrieve the file.
build.downloads[].patternstringPattern name.
build.downloads[].pattern_idintegerPattern ID.
build.downloads[].namestringFile name.
warningsstring[]Array of warning messages (e.g. missing releases).

Examples

cURL

bash
curl -X POST "https://app.metakraftwerk.com/api/v1/builds" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "project": "DEMO_PROJECT",
    "releases": { "DWH_GROUP": "R1" },
    "instances": [
      { "pattern": "CORE_DV_HLS", "folder": "/BUSINESS_VAULT", "name": "AIRPLANE" }
    ],
    "description": "build via rest api",
    "wait": true,
    "restore": true
  }'

JavaScript (Fetch)

javascript
const response = await fetch('https://app.metakraftwerk.com/api/v1/builds', {
  method: 'POST',
  headers: {
    'Authorization': `Bearer ${accessToken}`,
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    project: 'DEMO_PROJECT',
    releases: { DWH_GROUP: 'R1' },
    instances: [
      { pattern: 'CORE_DV_HLS', folder: '/BUSINESS_VAULT', name: 'AIRPLANE' }
    ],
    description: 'build via rest api',
    wait: true,
    restore: true
  })
});

const result = await response.json();

Response Example (wait: true)

json
{
  "build": {
    "id": 5139,
    "customer_id": 1,
    "user_id": 1,
    "project_id": 402,
    "progress": 100,
    "status": "FINISHED",
    "message": "calculating deliveries ...",
    "build_start": "2026-04-02T08:14:40.320Z",
    "build_end": "2026-04-02T08:14:58.898Z",
    "created_at": "2026-04-02T08:14:40.320Z",
    "updated_at": "2026-04-02T08:14:58.898Z",
    "history_commited": 1,
    "version": 10,
    "active": 1,
    "mts": 1775124880390,
    "name": null,
    "deliveries_calculated": 1,
    "description": "build via rest api",
    "commit_ind": 0,
    "deleted": 0,
    "instances": 1,
    "patterns": [808],
    "releases": [21],
    "downloads": [
      {
        "id": 5442,
        "pattern": "CORE_DV_HLS",
        "pattern_id": 808,
        "file_id": null,
        "name": "CORE_DV_HLS_2026-4-2_10_14.zip"
      }
    ]
  },
  "warnings": []
}

Response Example (wait: false)

When wait is false or omitted, the build starts asynchronously and the response returns immediately:

json
{
  "build": {
    "id": 5139,
    "status": "BUILDING"
  },
  "warnings": []
}

You can poll the build status using GET /api/v1/builds/:id until the status changes to FINISHED.

Error Responses

StatusConditionExample Message
400Missing required fieldsA project id or name is required!
400No instances specifiedNo instances specified!
401Missing or invalid tokenNot authenticated
403User lacks project accessYou don't have permissions to access this project!
403User lacks build permissionYou don't have permissions to start builds in this project!
404Project not foundA project with the name 'X' does not exist!
404Instance not foundInstance not found

Build Workflow

The typical workflow for creating a build and retrieving results is:

  1. Start the buildPOST /api/v1/builds with wait: true (synchronous) or wait: false (asynchronous).
  2. Poll for completion (async only) — GET /api/v1/builds/:id until status is FINISHED.
  3. List downloads — The downloads array in the build response contains the generated files.
  4. Download files — Use GET /api/v1/downloads/:id to download each file.

WARNING

Long-running builds with wait: true may time out depending on your HTTP client configuration. For large builds, consider using wait: false and polling for status.


PUT /api/v1/builds — Update

Not implemented

PATCH /api/v1/builds/:id — Patch

Not implemented

DELETE /api/v1/builds/:id — Remove

Not implemented