Skip to main content
POST
/
builds
/
upload
curl -X POST "https://nunu.ai/api/v1/builds/upload" \
  -H "X-Api-Key: YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "project_id": "your-project-id",
    "name": "Production Build v1.2.3",
    "file_name": "app-release.apk",
    "file_size": 52428800,
    "platform": "android",
    "multipart": false,
    "auto_delete": true,
    "tags": ["version:1.2.3", "env:production"],
    "details": {
      "vcs": {
        "commit": { "short_hash": "a1b2c3d" },
        "branch": "main"
      }
    }
  }'
{
  "upload_type": "single-part",
  "build_id": "123e4567-e89b-12d3-a456-426614174000",
  "upload_url": "https://storage.example.com/...",
  "object_key": "abc123-def456/app-release.apk"
}
Permission Required: project:manage-build-storage
Initiate a build upload. The API automatically selects single-part or multipart upload based on file size.
For most users, we recommend using the CLI or GitHub Action instead of the API directly.

Upload Methods

MethodFile SizeUse Case
Single-part< 3GBSimple uploads
Multipart≥ 3GB (up to 5TB)Large files, parallel uploads
The API automatically uses multipart for files ≥3GB unless you explicitly set multipart: false.

Request Body

project_id
string
required
Project ID for the build
name
string
required
Build name (1-255 characters)
file_name
string
required
File name (1-255 characters)
file_size
integer
required
Size in bytes (positive integer)
platform
string
required
Target platform: windows, macos, linux, android, ios-native, ios-simulator, xbox, playstation
description
string
Description (max 1000 characters)
multipart
boolean
Force multipart upload. Auto-enabled for files ≥3GB.
auto_delete
boolean
default:"false"
Auto-delete old builds when storage capacity is reached
deletion_policy
string
default:"least_recent"
Deletion policy: least_recent (LRU) or oldest (FIFO)
upload_timeout
integer
Timeout in minutes (1-1440). Default: 10 for single-part, 60 for multipart.
tags
string[]
Array of tags (1-50 characters each)
details
object
Build metadata (VCS, CI, app info)

Response (Single-Part)

upload_type
string
required
Always single-part
build_id
string
required
Build ID for completing the upload
upload_url
string
required
Presigned URL to PUT the file
object_key
string
required
Object key for the upload

Response (Multipart)

upload_type
string
required
Always multipart
build_id
string
required
Build ID for completing the upload
upload_id
string
required
Upload ID for getting part URLs
object_key
string
required
Object key for the upload
total_parts
integer
required
Total number of parts to upload
part_size
integer
required
Size of each part in bytes (typically 100MB)
curl -X POST "https://nunu.ai/api/v1/builds/upload" \
  -H "X-Api-Key: YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "project_id": "your-project-id",
    "name": "Production Build v1.2.3",
    "file_name": "app-release.apk",
    "file_size": 52428800,
    "platform": "android",
    "multipart": false,
    "auto_delete": true,
    "tags": ["version:1.2.3", "env:production"],
    "details": {
      "vcs": {
        "commit": { "short_hash": "a1b2c3d" },
        "branch": "main"
      }
    }
  }'
{
  "upload_type": "single-part",
  "build_id": "123e4567-e89b-12d3-a456-426614174000",
  "upload_url": "https://storage.example.com/...",
  "object_key": "abc123-def456/app-release.apk"
}

Upload Flow

1

Initiate

POST to /builds/upload with multipart: false
2

Upload

PUT the file to the returned upload_url
3

Complete

POST to /builds/upload/complete

Complete Single-Part Example

#!/bin/bash
PROJECT_ID="your-project-id"
API_TOKEN="your-api-token"
FILE_PATH="build/app.apk"

# Step 1: Initiate
RESPONSE=$(curl -s -X POST \
  "https://nunu.ai/api/v1/builds/upload" \
  -H "Content-Type: application/json" \
  -H "X-Api-Key: $API_TOKEN" \
  -d "{
    \"project_id\": \"$PROJECT_ID\",
    \"name\": \"Production Build\",
    \"file_name\": \"$(basename $FILE_PATH)\",
    \"file_size\": $(stat -f%z $FILE_PATH 2>/dev/null || stat -c%s $FILE_PATH),
    \"platform\": \"android\",
    \"multipart\": false
  }")

UPLOAD_URL=$(echo $RESPONSE | jq -r '.upload_url')
BUILD_ID=$(echo $RESPONSE | jq -r '.build_id')

# Step 2: Upload
curl -X PUT "$UPLOAD_URL" \
  -H "Content-Type: application/octet-stream" \
  --data-binary "@$FILE_PATH"

# Step 3: Complete
curl -X POST \
  "https://nunu.ai/api/v1/builds/upload/complete" \
  -H "Content-Type: application/json" \
  -H "X-Api-Key: $API_TOKEN" \
  -d "{\"build_id\": \"$BUILD_ID\"}"

echo "Upload complete! Build ID: $BUILD_ID"

Authorizations

X-Api-Key
string
header
required

API key for authentication

Body

application/json
project_id
string
required

Project ID for the build

name
string
required

Build name (1-255 chars)

file_name
string
required

File name (1-255 chars)

file_size
integer
required

Size in bytes (positive integer)

platform
enum<string>
required

Target platform

Available options:
windows,
macos,
linux,
android,
ios-native,
ios-simulator,
xbox,
playstation
description
string

Description (max 1000 chars)

multipart
boolean

Use multipart upload? (Auto for files ≥3GB)

auto_delete
boolean
default:false

Auto-delete old builds when capacity reached

deletion_policy
enum<string>
default:least_recent
Available options:
least_recent,
oldest
upload_timeout
integer

Timeout in minutes (1-1440)

tags
string[]

Array of tags (1-50 chars each)

details
object

Optional build metadata

Response

Upload initiated successfully

upload_type
string
Allowed value: "single-part"
build_id
string
upload_url
string
object_key
string