API_KEY="floom_YOUR_KEY"
BASE="https://dashboard.floom.dev"
# 1. Get upload URL
UPLOAD=$(curl -s -X POST "$BASE/api/artifacts/upload-url" \
-H "Authorization: Bearer $API_KEY")
UPLOAD_URL=$(echo $UPLOAD | python3 -c "import json,sys; print(json.load(sys.stdin)['uploadUrl'])")
R2_KEY=$(echo $UPLOAD | python3 -c "import json,sys; print(json.load(sys.stdin)['r2Key'])")
# 2. Zip and upload
zip /tmp/app.zip main.py
curl -s -X PUT "$UPLOAD_URL" -H "Content-Type: application/zip" --data-binary @/tmp/app.zip
# 3. Create artifact
curl -s -X POST "$BASE/api/artifacts" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d "{\"manifest\": {\"name\": \"Hello World\", \"description\": \"Greets you by name\", \"inputs\": [{\"name\": \"name\", \"label\": \"Name\", \"type\": \"text\", \"required\": true}], \"outputs\": [{\"name\": \"greeting\", \"label\": \"Greeting\", \"type\": \"text\"}], \"secrets_needed\": [], \"python_dependencies\": []}, \"entrypoint\": \"main.py\", \"r2Key\": \"$R2_KEY\"}"
# 4. Deploy
ARTIFACT_ID="<from step 3 response>"
curl -s -X POST "$BASE/api/deploy" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d "{\"artifactId\": \"$ARTIFACT_ID\"}"