> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.tester.army/api-reference/tester-army-api/projects/llms.txt.
> For full documentation content, see https://docs.tester.army/api-reference/tester-army-api/projects/llms-full.txt.

# Upload a project mobile app

POST https://tester.army/v1/projects/{projectId}/mobile
Content-Type: multipart/form-data

Upload a mobile app binary to a mobile project. Optionally set removeAfter to delete temporary uploads after a delay.

Reference: https://docs.tester.army/api-reference/tester-army-api/projects/upload-a-project-mobile-app

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: testerarmy
  version: 1.0.0
paths:
  /v1/projects/{projectId}/mobile:
    post:
      operationId: upload-a-project-mobile-app
      summary: Upload a project mobile app
      description: >-
        Upload a mobile app binary to a mobile project. Optionally set
        removeAfter to delete temporary uploads after a delay.
      tags:
        - subpackage_projects
      parameters:
        - name: projectId
          in: path
          description: Project ID
          required: true
          schema:
            type: string
            format: uuid
        - name: Authorization
          in: header
          description: API key authentication using Bearer token format
          required: true
          schema:
            type: string
      responses:
        '201':
          description: Mobile app uploaded successfully
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/Projects_uploadAProjectMobileApp_Response_201
        '400':
          description: Bad Request - Invalid input parameters
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/UploadAProjectMobileAppRequestBadRequestError
        '401':
          description: Unauthorized - Invalid or missing API key
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/UploadAProjectMobileAppRequestUnauthorizedError
        '404':
          description: Project not found
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/UploadAProjectMobileAppRequestNotFoundError
        '429':
          description: Too Many Requests - Usage limit exceeded
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/UploadAProjectMobileAppRequestTooManyRequestsError
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/UploadAProjectMobileAppRequestInternalServerError
        '504':
          description: Gateway Timeout - Test execution exceeded time limit
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/UploadAProjectMobileAppRequestGatewayTimeoutError
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                file:
                  type: string
                  format: binary
                removeAfter:
                  type: string
                  description: Optional expiration in seconds for temporary uploads
              required:
                - file
servers:
  - url: https://tester.army
components:
  schemas:
    V1ProjectsProjectIdMobilePostResponsesContentApplicationJsonSchemaAppPlatform:
      type: string
      enum:
        - ios
        - android
      title: >-
        V1ProjectsProjectIdMobilePostResponsesContentApplicationJsonSchemaAppPlatform
    V1ProjectsProjectIdMobilePostResponsesContentApplicationJsonSchemaAppSource:
      type: string
      enum:
        - manual_upload
        - group_webhook_artifact
        - api_upload
      title: >-
        V1ProjectsProjectIdMobilePostResponsesContentApplicationJsonSchemaAppSource
    V1ProjectsProjectIdMobilePostResponsesContentApplicationJsonSchemaApp:
      type: object
      properties:
        id:
          type: string
          format: uuid
        platform:
          $ref: >-
            #/components/schemas/V1ProjectsProjectIdMobilePostResponsesContentApplicationJsonSchemaAppPlatform
        filename:
          type: string
        bundleId:
          type:
            - string
            - 'null'
        appVersion:
          type:
            - string
            - 'null'
        buildVersion:
          type:
            - string
            - 'null'
        fileSize:
          type: number
          format: double
        source:
          $ref: >-
            #/components/schemas/V1ProjectsProjectIdMobilePostResponsesContentApplicationJsonSchemaAppSource
        expiresAt:
          type:
            - string
            - 'null'
          format: date-time
        removeAfter:
          type:
            - integer
            - 'null'
        createdAt:
          type: string
          format: date-time
      required:
        - id
        - platform
        - filename
        - bundleId
        - appVersion
        - buildVersion
        - fileSize
        - source
        - expiresAt
        - removeAfter
        - createdAt
      title: V1ProjectsProjectIdMobilePostResponsesContentApplicationJsonSchemaApp
    Projects_uploadAProjectMobileApp_Response_201:
      type: object
      properties:
        app:
          $ref: >-
            #/components/schemas/V1ProjectsProjectIdMobilePostResponsesContentApplicationJsonSchemaApp
      required:
        - app
      title: Projects_uploadAProjectMobileApp_Response_201
    UploadAProjectMobileAppRequestBadRequestError:
      type: object
      properties:
        error:
          type: string
          description: Error code or type
        message:
          type: string
          description: Human-readable error message
      required:
        - error
        - message
      title: UploadAProjectMobileAppRequestBadRequestError
    UploadAProjectMobileAppRequestUnauthorizedError:
      type: object
      properties:
        error:
          type: string
          description: Error code or type
        message:
          type: string
          description: Human-readable error message
      required:
        - error
        - message
      title: UploadAProjectMobileAppRequestUnauthorizedError
    UploadAProjectMobileAppRequestNotFoundError:
      type: object
      properties:
        error:
          type: string
          description: Error code or type
        message:
          type: string
          description: Human-readable error message
      required:
        - error
        - message
      title: UploadAProjectMobileAppRequestNotFoundError
    UploadAProjectMobileAppRequestTooManyRequestsError:
      type: object
      properties:
        error:
          type: string
          description: Error code or type
        message:
          type: string
          description: Human-readable error message
      required:
        - error
        - message
      title: UploadAProjectMobileAppRequestTooManyRequestsError
    UploadAProjectMobileAppRequestInternalServerError:
      type: object
      properties:
        error:
          type: string
          description: Error code or type
        message:
          type: string
          description: Human-readable error message
      required:
        - error
        - message
      title: UploadAProjectMobileAppRequestInternalServerError
    UploadAProjectMobileAppRequestGatewayTimeoutError:
      type: object
      properties:
        error:
          type: string
          description: Error code or type
        message:
          type: string
          description: Human-readable error message
      required:
        - error
        - message
      title: UploadAProjectMobileAppRequestGatewayTimeoutError
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: API key authentication using Bearer token format

```

## SDK Code Examples

```python
import requests

url = "https://tester.army/v1/projects/projectId/mobile"

files = { "file": "open('string', 'rb')" }
payload = { "removeAfter":  }
headers = {"Authorization": "Bearer <token>"}

response = requests.post(url, data=payload, files=files, headers=headers)

print(response.json())
```

```javascript
const url = 'https://tester.army/v1/projects/projectId/mobile';
const form = new FormData();
form.append('file', 'string');
form.append('removeAfter', '');

const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};

options.body = form;

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://tester.army/v1/projects/projectId/mobile"

	payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"string\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"removeAfter\"\r\n\r\n\r\n-----011000010111000001101001--\r\n")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://tester.army/v1/projects/projectId/mobile")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"string\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"removeAfter\"\r\n\r\n\r\n-----011000010111000001101001--\r\n"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://tester.army/v1/projects/projectId/mobile")
  .header("Authorization", "Bearer <token>")
  .body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"string\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"removeAfter\"\r\n\r\n\r\n-----011000010111000001101001--\r\n")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://tester.army/v1/projects/projectId/mobile', [
  'multipart' => [
    [
        'name' => 'file',
        'filename' => 'string',
        'contents' => null
    ]
  ]
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://tester.army/v1/projects/projectId/mobile");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddParameter("undefined", "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"string\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"removeAfter\"\r\n\r\n\r\n-----011000010111000001101001--\r\n", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "Bearer <token>"]
let parameters = [
  [
    "name": "file",
    "fileName": "string"
  ],
  [
    "name": "removeAfter",
    "value": 
  ]
]

let boundary = "---011000010111000001101001"

var body = ""
var error: NSError? = nil
for param in parameters {
  let paramName = param["name"]!
  body += "--\(boundary)\r\n"
  body += "Content-Disposition:form-data; name=\"\(paramName)\""
  if let filename = param["fileName"] {
    let contentType = param["content-type"]!
    let fileContent = String(contentsOfFile: filename, encoding: String.Encoding.utf8)
    if (error != nil) {
      print(error as Any)
    }
    body += "; filename=\"\(filename)\"\r\n"
    body += "Content-Type: \(contentType)\r\n\r\n"
    body += fileContent
  } else if let paramValue = param["value"] {
    body += "\r\n\r\n\(paramValue)"
  }
}

let request = NSMutableURLRequest(url: NSURL(string: "https://tester.army/v1/projects/projectId/mobile")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```