---
updatedAt: 2025-02-13T17:50:35.000Z
agentTools:
  projectIndex: https://docs.emergetools.com/llms.txt
---

# REST API

If you're not already using the [Fastlane Plugin](https://docs.emergetools.com/docs/fastlane), [Gradle Plugin](https://docs.emergetools.com/docs/gradle-plugin), or [GitHub Action](https://docs.emergetools.com/docs/github-actions), you can upload your build using our REST API. The process looks like this:

1. Make a GET request to our `/upload` endpoint to retrieve a signed URL
2. Make a PUT request to the signed URL with the upload file contents

## Getting a Signed URL

Using the `/upload` endpoint you can create a new upload and retrieve a signed URL to upload your uploaded file. The full documentation for this API endpoint is available [here](https://docs.emergetools.com/reference#post_upload).

Emerge supports many common iOS & Android builds, see [Supported Artifacts](https://docs.emergetools.com/docs/uploading-basics#supported-artifacts) for a comprehensive list of all build types Emerge supports for iOS & Android.

## Uploading to the signed URL

With the signed URL, you can make a PUT request to upload your app's build file.

If uploading a `.zip` file, the request should include the `Content-Type: application/zip` header. For example:

```shell
curl -v -H 'Content-Type: application/zip' -T MyArchive.xcarchive.zip "SIGNED_URL"
```

A complete example of a manual upload using shell commands is below:

```shell
#!/bin/bash

API_KEY=<YOUR_API_KEY>
PATH_TO_BUILD_ARTIFACT=<PATH_TO_YOUR_BUILD.xcarchive.zip>

json_body='{
  "filename":"your_build.xcarchive.zip",
  "branch":"example_branch_name",
  "repoName":"example_repo_name",
  "buildType":"release",
  "prNumber": "123",
  "sha":"123456",
  "baseSha":"654321",
  "previousSha":"123455"}'

upload_response=$(curl \
                     --url "https://api.emergetools.com/upload" \
                     --header 'Accept: application/json' \
                     --header 'Content-Type: application/json' \
                     --header "X-API-Token: $API_KEY" \
                     --data "$json_body")

# Pull the uploadURL field from the response using jq
upload_url=$(echo "$upload_response" | jq -r .uploadURL)

curl -v -H 'Content-Type: application/zip' -T "$PATH_TO_BUILD_ARTIFACT" "$upload_url"
```