> ## Documentation Index
> Fetch the complete documentation index at: https://docs.squarecloud.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Upload Application

> Send an application to Square Cloud. It has a rate limit of 1 request every 3 seconds.

<ParamField header="Authorization" type="string" placeholder="API Key" required>
  The API key for your account. You can find this in your [account settings](https://squarecloud.app/account/security).
</ParamField>

### Parameters

<ParamField body="file" type="file" placeholder="application.zip" required>
  The application to be uploaded must be compressed in a zip file (.zip) and the Content-Type must be multipart/form-data.
</ParamField>

### Response

<ResponseField name="status" type="string">
  Indicates whether the call was successful.. `success` if successful, `error` if not.
</ResponseField>

<ResponseField name="code" type="string">
  The status code of the response.
</ResponseField>

<ResponseField name="response" type="object">
  The contents of the response.

  <Expandable title="Toggle object">
    <ResponseField name="id" type="string">
      The ID of the uploaded application.
    </ResponseField>

    <ResponseField name="name" type="string">
      The name of the uploaded application.
    </ResponseField>

    <ResponseField name="description" type="string">
      The description of the uploaded application.
    </ResponseField>

    <ResponseField name="domain" type="string">
      The subdomain of the uploaded application (null if not applicable).
    </ResponseField>

    <ResponseField name="ram" type="number">
      The RAM usage of the uploaded application in MB.
    </ResponseField>

    <ResponseField name="cpu" type="number">
      The CPU usage of the uploaded application.
    </ResponseField>

    <ResponseField name="language" type="object">
      <Expandable title="Toggle object">
        <ResponseField name="name" type="string">
          The programming language of the uploaded application.
        </ResponseField>

        <ResponseField name="version" type="string">
          The recommended version of the programming language.
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="cluster" type="string">
      The cluster where the application is cloud hosted.
    </ResponseField>
  </Expandable>
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST \
    --url https://api.squarecloud.app/v2/apps \
    --header 'Authorization: YOUR_API_KEY' \
    --form 'file=@./application.zip'
  ```

  ```javascript JavaScript theme={null}
  import fs from 'node:fs';

  const form = new FormData();
  form.append('file', new Blob([fs.readFileSync('./application.zip')]), 'application.zip');

  const response = await fetch('https://api.squarecloud.app/v2/apps', {
    method: 'POST',
    headers: { Authorization: 'YOUR_API_KEY' },
    body: form,
  });
  ```

  ```python Python theme={null}
  import requests

  with open('application.zip', 'rb') as f:
      response = requests.post(
          'https://api.squarecloud.app/v2/apps',
          headers={'Authorization': 'YOUR_API_KEY'},
          files={'file': ('application.zip', f, 'application/zip')},
      )
  ```
</RequestExample>

<ResponseExample>
  ```json theme={null}
  {
      "status": "success",
      "code": "SUCCESS",
      "response": {
          "id": "945f574e6cc14ea6818f91d7d56de101",
          "name": "Estrelinha Legal",
          "description": "Nossa, fui enviada na velocidade da luz! ✨",
          "domain": null,
          "ram": 1024,
          "cpu": 6,
          "language": {
              "name": "JavaScript",
              "version": "recommended"
          }
      }
  }
  ```
</ResponseExample>
