Skip to main content
These endpoints allow you to upload app builds programmatically. For most use cases, we recommend using our GitHub Action instead. All requests require an API key in the X-API-Key header. See API Reference for authentication details.

Start Upload

Initiate an app build upload and get a presigned URL for uploading your build file.
POST /api/ci/start-upload — Returns 200 OK

Request Body

bundle_id
string
required
Your app’s bundle identifier (e.g., com.company.app)
platform
string
required
Target platform: ios or android
filename
string
required
Name of the build file (e.g., app-release.apk or MyApp.zip)

Example Request

curl -X POST https://backend.autosana.ai/api/ci/start-upload \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "bundle_id": "com.company.app",
    "platform": "android",
    "filename": "app-release.apk"
  }'

Response Fields

upload_url
string
Presigned URL for uploading your build file via PUT request. Valid for 1 hour.
file_path
string
Storage path of the uploaded file. Pass this to the confirm-upload endpoint.

Example Response

{
  "upload_url": "https://storage.supabase.co/...",
  "file_path": "app-uuid/android/app-release-20250115T103000.apk"
}
After receiving the response, upload your build file to the upload_url using a PUT request:
curl -X PUT "UPLOAD_URL_FROM_RESPONSE" \
  -H "Content-Type: application/octet-stream" \
  --data-binary @./path/to/your/app.apk

Confirm Upload

After uploading your build file, call this endpoint to finalize the upload and trigger any configured automations.
POST /api/ci/confirm-upload — Returns 200 OK

Request Body

bundle_id
string
required
Your app’s bundle identifier (must match the one used in start-upload)
platform
string
required
Target platform: ios or android
uploaded_file_path
string
required
The file_path returned from the start-upload response
commit_sha
string
Git commit SHA for tracking which commit this build came from.
branch_name
string
Git branch name. Displayed in the Autosana UI for build identification.

Example Request

curl -X POST https://backend.autosana.ai/api/ci/confirm-upload \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "bundle_id": "com.company.app",
    "platform": "android",
    "uploaded_file_path": "app-uuid/android/app-release-20250115T103000.apk",
    "commit_sha": "abc123def456",
    "branch_name": "feature/new-login"
  }'

Response Fields

status
string
Result status: success or error
message
string
Human-readable description of the result
triggered_flows
integer
Number of automations triggered by this upload (based on your Automations configuration).

Example Response

{
  "status": "success",
  "message": "App build uploaded successfully",
  "triggered_flows": 3
}

Upload Workflow

Here’s the complete workflow for uploading a build via the API:
1

Start Upload

Call /api/ci/start-upload with your app details to get a presigned upload URL.
2

Upload File

PUT your build file (.apk for Android, .zip for iOS) to the presigned URL.
3

Confirm Upload

Call /api/ci/confirm-upload to finalize the upload and trigger automations.

Build Requirements

iOS Builds

Upload a .zip file containing a simulator-compatible .app bundle. See App Build Guide for details.

Android Builds

Upload a universal .apk file (not AAB). The APK must be compatible with x86_64 emulators.