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
- Authentication — Required for all API requests
- Builds API — Trigger and monitor builds
- Download of the build results — Downloading build results via the web interface
GET /api/v1/downloads — Find Downloads
Retrieve a list of download entries for a specific build.
Endpoint
GET https://app.metakraftwerk.com/api/v1/downloadsQuery Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
build_id | integer | No | Filter by build ID. |
pattern | string | No | Filter by pattern name. |
pattern_id | integer | No | Filter by pattern ID. |
Response Schema
Returns an array of download objects:
| Field | Type | Description |
|---|---|---|
id | integer | Unique download ID. |
customer_id | integer | Customer ID. |
pattern_id | integer | Pattern ID. |
name | string | Display name of the file. |
file_name | string | Internal file path on the server. |
type | string | Download type (e.g. IICS). |
build_id | integer | Associated build ID. |
project_id | integer | Associated project ID. |
version | integer | Version number. |
upload_id | integer | Associated upload ID. |
file_id | integer | Associated file ID (if applicable). |
downloaded | integer | Number of times the file has been downloaded. |
instance_id | integer | Associated 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
| Status | Condition | Example Message |
|---|---|---|
401 | Missing or invalid token | Not 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/:idPath Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | integer | Yes | The 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" \
-OJJavaScript (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
| Status | Condition | Example Message |
|---|---|---|
401 | Missing or invalid token | Not authenticated |
403 | User lacks read_builds permission | You don't have permissions to download build results! |
404 | Download not found | No record found for id 'X' |
Typical Workflow
- Start a build —
POST /api/v1/builds(see Builds API). - Get download list —
GET /api/v1/downloads?build_id=<BUILD_ID>to list available files. - Download each file —
GET /api/v1/downloads/:idfor 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