Upload an Android binary
Upload an APK to Doksi-hosted storage and register it as a reusable target. Call POST /uploads to create a presigned S3 URL, PUT the APK zip to it, then call POST /targets to parse the manifest and mint a target_id you can reuse across runs.
Use this flow when your CI pipeline builds an APK locally. The returned
target_id is reusable across any number of runs. Upload once per build and
reference it from every subsequent POST /runs call.
The flow
- Create a presigned upload URL with
POST /uploads. - PUT the APK zip directly to S3.
- Register the upload as a reusable target with
POST /targets. - Pass the returned
target_idtoPOST /runs.
# 1. Create the presigned URL.
MINT=$(curl -sX POST "$BASE/uploads" \
-H "Authorization: Bearer $DOKSI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"storefront"}')
UPLOAD_ID=$(echo "$MINT" | jq -r '.upload_id')
UPLOAD_URL=$(echo "$MINT" | jq -r '.upload_url')
# 2. PUT the APK zip. The presigned URL is valid for one hour and requires
# Content-Type: application/zip.
zip app.zip app/build/outputs/apk/release/app-release.apk
curl -X PUT "$UPLOAD_URL" \
-H "Content-Type: application/zip" \
--data-binary @app.zip
# 3. Register the upload as a target.
TARGET=$(curl -sX POST "$BASE/targets" \
-H "Authorization: Bearer $DOKSI_API_KEY" \
-H "Content-Type: application/json" \
-d "{\"upload_id\":\"$UPLOAD_ID\",\"name\":\"Storefront\",\"version\":\"1.2.3\"}")
TARGET_ID=$(echo "$TARGET" | jq -r '.target_id')The zip may contain a single .apk, or split APKs (base.apk plus
split_config.*.apk). Doksi parses the manifest from base.apk when present.
Step 1: POST /uploads
Authorization
BearerAuth API key issued from Settings > Integrations > CI/CD. Keys have the format dk_live_<40-hex>.
In: header
Request Body
application/json
Response Body
application/json
application/json
application/json
curl -X POST "https://api.doksi.ai/external/integration/cicd/uploads" \ -H "Content-Type: application/json" \ -d '{}'{
"upload_id": "string",
"upload_url": "http://example.com",
"expires_at": "2019-08-24T14:15:22Z"
}{
"error": "string"
}{
"error": "string"
}Step 2: POST /targets
Authorization
BearerAuth API key issued from Settings > Integrations > CI/CD. Keys have the format dk_live_<40-hex>.
In: header
Request Body
application/json
Response Body
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://api.doksi.ai/external/integration/cicd/targets" \ -H "Content-Type: application/json" \ -d '{ "upload_id": "string" }'{
"target_id": "string",
"platform": "android",
"name": "string",
"package_name": "string",
"version": "string",
"version_code": 0
}{
"error": "string"
}{
"error": "string"
}{
"error": "string"
}{
"error": "string"
}