> ## 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.

# Anwendung hochladen

> Senden Sie eine Anwendung an Square Cloud. Es gilt ein Rate-Limit von 1 Anfrage alle 3 Sekunden.

<ParamField header="Authorization" type="string" placeholder="API Key" required>
  Der API-Schlüssel für Ihr Konto. Sie finden ihn in Ihren [Kontoeinstellungen](https://squarecloud.app/de/account/security).
</ParamField>

### Parameter

<ParamField body="file" type="file" placeholder="application.zip" required>
  Die hochzuladende Anwendung muss in einer ZIP-Datei (.zip) komprimiert sein und der Content-Type muss multipart/form-data sein.
</ParamField>

### Antwort

<ResponseField name="status" type="string">
  Gibt an, ob der Aufruf erfolgreich war. `success` bei Erfolg, `error` andernfalls.
</ResponseField>

<ResponseField name="response" type="object">
  Der Inhalt der Antwort.

  <Expandable title="Objekt umschalten">
    <ResponseField name="id" type="string">
      Die ID der hochgeladenen Anwendung.
    </ResponseField>

    <ResponseField name="name" type="string">
      Der Name der hochgeladenen Anwendung.
    </ResponseField>

    <ResponseField name="description" type="string">
      Die Beschreibung der hochgeladenen Anwendung.
    </ResponseField>

    <ResponseField name="domain" type="string">
      Die Subdomain der hochgeladenen Anwendung (null, falls nicht zutreffend).
    </ResponseField>

    <ResponseField name="ram" type="number">
      Der RAM-Verbrauch der hochgeladenen Anwendung in MB.
    </ResponseField>

    <ResponseField name="cpu" type="number">
      Der CPU-Verbrauch der hochgeladenen Anwendung.
    </ResponseField>

    <ResponseField name="language" type="object">
      <Expandable title="Objekt umschalten">
        <ResponseField name="name" type="string">
          Die Programmiersprache der hochgeladenen Anwendung.
        </ResponseField>

        <ResponseField name="version" type="string">
          Die empfohlene Version der Programmiersprache.
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="cluster" type="string">
      Der Cluster, in dem die Anwendung in der Cloud gehostet wird.
    </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",
      "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>
