Skip to content
Reference>REST API>/downloads

Downloads

The /downloads endpoint allows you to list and download build result files. After a build completes, the generated artifacts (e.g. ZIP archives containing Informatica mappings, DDL scripts) are available as downloads.

See Also

GET /api/v1/downloads — Find Downloads

Retrieve a list of download entries for a specific build.

Endpoint

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

Query Parameters

ParameterTypeRequiredDescription
build_idintegerNoFilter by build ID.
patternstringNoFilter by pattern name.
pattern_idintegerNoFilter by pattern ID.

Response Schema

Returns an array of download objects:

FieldTypeDescription
idintegerUnique download ID.
customer_idintegerCustomer ID.
pattern_idintegerPattern ID.
namestringDisplay name of the file.
file_namestringInternal file path on the server.
typestringDownload type (e.g. IICS).
build_idintegerAssociated build ID.
project_idintegerAssociated project ID.
versionintegerVersion number.
upload_idintegerAssociated upload ID.
file_idintegerAssociated file ID (if applicable).
downloadedintegerNumber of times the file has been downloaded.
instance_idintegerAssociated instance ID (if applicable).

Examples

cURL

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

JavaScript (Fetch)

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

const downloads = await response.json();

Response Example

json
[
  {
    "id": 5442,
    "customer_id": 1,
    "pattern_id": 808,
    "name": "CORE_DV_HLS_2026-4-2_10_14.zip",
    "file_name": "/files/results/5139_808_iics_CORE_DV_HLS_2026-4-2_10_14.zip",
    "type": "IICS",
    "build_id": 5139,
    "project_id": 402,
    "version": 1,
    "upload_id": 1359,
    "file_id": null,
    "downloaded": 0,
    "instance_id": null
  }
]

Error Responses

StatusConditionExample Message
401Missing or invalid tokenNot authenticated

GET /api/v1/downloads/:id — Download File

Download a specific build result file by its ID. The response is a binary file download.

Endpoint

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

Path Parameters

ParameterTypeRequiredDescription
idintegerYesThe download ID.

Authentication

The authenticated user must have read_builds permission on the associated project.

Response

The response is a binary file download. The server sets the Content-Disposition header with the filename and returns the file as a buffer.

Examples

cURL

bash
# Download the file and save with server-provided filename
curl -X GET "https://app.metakraftwerk.com/api/v1/downloads/5442" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -OJ

JavaScript (Fetch)

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

const blob = await response.blob();
const filename = response.headers.get('Content-Disposition')
  ?.match(/filename="?(.+?)"?$/)?.[1] || 'download.zip';

// Save file (browser example)
const url = URL.createObjectURL(blob);
const a = document.createElement('a');
a.href = url;
a.download = filename;
a.click();
URL.revokeObjectURL(url);

Error Responses

StatusConditionExample Message
401Missing or invalid tokenNot authenticated
403User lacks read_builds permissionYou don't have permissions to download build results!
404Download not foundNo record found for id 'X'

Typical Workflow

  1. Start a buildPOST /api/v1/builds (see Builds API).
  2. Get download listGET /api/v1/downloads?build_id=<BUILD_ID> to list available files.
  3. Download each fileGET /api/v1/downloads/:id for each download entry.

POST /api/v1/downloads — Create

Not implemented

PUT /api/v1/downloads — Update

Not implemented

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

Not implemented

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

Not implemented