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

# Blob Chunked Upload Part

> Diese Dokumentation bietet einen umfassenden Überblick über den Endpoint PUT /v1/objects/chunked der SquareCloud Blob API.

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

Chunked Part sendet einen Chunk eines mit [Chunked Init](/de/blob-reference/endpoint/chunked-init) geöffneten Uploads. Der Body sind die **rohen Bytes** des Chunks, nicht multipart/form-data. Teilnummern laufen von 1 bis `max_parts` (205) und dürfen in **beliebiger Reihenfolge** gesendet werden; ein fehlgeschlagener Teil kann einfach mit derselben Nummer erneut gesendet werden, und erneutes Senden ist sicher, weil Teile idempotent sind.

Jeder Chunk außer dem letzten muss zwischen **5 MB und 32 MB** groß sein; der letzte darf kleiner sein. Sende höchstens **6 Teile parallel**: Ein siebter gleichzeitig laufender Teil liefert `TOO_MANY_CONCURRENT_CHUNKS` zurück; warte in dem Fall, bis einer fertig ist, und wiederhole diesen Teil. Mit 6 parallelen Teilen sind 16-MB-Chunks ein guter Standardwert für einen Browser.

Diese Route ist vom kontoweiten API-Budget (`plan.rate`) ausgenommen, sodass ein langer Upload dein API-Kontingent für den Rest der Plattform nicht erschöpfen kann. Ihr eigener Limiter erlaubt 60 Teile pro 10 Sekunden, darüber hinaus für 10 Sekunden blockiert.

<ParamField query="upload" type="string" placeholder="Upload token" required>
  Das opake `upload`-Token, das Chunked Init zurückgegeben hat.
</ParamField>

<ParamField query="part" type="number" placeholder="1..205" required>
  Die Teilnummer, von 1 bis 205. Teile dürfen in beliebiger Reihenfolge gesendet werden.
</ParamField>

<ParamField body="body" type="binary" required>
  Die rohen Chunk-Bytes (`Content-Type: application/octet-stream`). **Nicht** multipart/form-data.
</ParamField>

### Response

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

<ResponseField name="response" type="object">
  <Expandable title="Objekt ein-/ausblenden">
    <ResponseField name="part" type="number">
      Die Teilnummer, die gespeichert wurde.
    </ResponseField>

    <ResponseField name="size" type="number">
      Die Größe des gespeicherten Chunks, in Bytes.
    </ResponseField>

    <ResponseField name="etag" type="string">
      Das Storage-ETag des Teils. Nur informativ: Der Abschluss liest die Teileliste aus dem Storage zurück, du sendest es also nie zurück.
    </ResponseField>
  </Expandable>
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl --request PUT \
    --url 'https://blob.squarecloud.app/v1/objects/chunked?upload=UPLOAD_TOKEN&part=1' \
    --header 'Authorization: YOUR_API_KEY' \
    --header 'Content-Type: application/octet-stream' \
    --data-binary '@./chunk-1.bin'
  ```

  ```javascript JavaScript theme={null}
  const chunk = file.slice(0, 16 * 1024 * 1024); // first 16 MB

  const params = new URLSearchParams({ upload: uploadToken, part: '1' });

  const response = await fetch(`https://blob.squarecloud.app/v1/objects/chunked?${params}`, {
    method: 'PUT',
    headers: {
      Authorization: 'YOUR_API_KEY',
      'Content-Type': 'application/octet-stream',
    },
    body: chunk,
  });
  ```

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

  with open('./bigfile.bin', 'rb') as f:
      chunk = f.read(16 * 1024 * 1024)

  response = requests.put(
      'https://blob.squarecloud.app/v1/objects/chunked',
      headers={'Authorization': 'YOUR_API_KEY', 'Content-Type': 'application/octet-stream'},
      params={'upload': upload_token, 'part': 1},
      data=chunk,
  )
  ```
</RequestExample>

<ResponseExample>
  ```json theme={null}
  {
    "status": "success",
    "response": {
      "part": 1,
      "size": 16777216,
      "etag": "\"9bb58f26192e4ba00f01e2e7b136bbd8\""
    }
  }
  ```
</ResponseExample>

### Fehlerbehebung

<Tabs>
  <Tab title="400 Status Code">
    ### Chunkbezogen

    <CodeGroup>
      ```json INVALID_UPLOAD_TOKEN theme={null}
      // The upload token is missing, malformed, or does not belong to your account.
      {
          "status": "error",
          "code": "INVALID_UPLOAD_TOKEN"
      }
      ```

      ```json INVALID_CHUNK_PART theme={null}
      // The part number must be an integer between 1 and 205.
      {
          "status": "error",
          "code": "INVALID_CHUNK_PART"
      }
      ```

      ```json EMPTY_CHUNK theme={null}
      // The chunk body was empty.
      {
          "status": "error",
          "code": "EMPTY_CHUNK"
      }
      ```
    </CodeGroup>
  </Tab>

  <Tab title="401 Status Code">
    ### Nicht autorisiert

    <CodeGroup>
      ```json ACCESS_DENIED theme={null}
      // The API key is missing or invalid. Set a valid key in the Authorization header.
      {
          "status": "error",
          "code": "ACCESS_DENIED"
      }
      ```

      ```json PERMISSION_DENIED theme={null}
      // The account has no active paid plan. Uploading to Blob Storage requires a paid plan.
      {
          "status": "error",
          "code": "PERMISSION_DENIED"
      }
      ```
    </CodeGroup>
  </Tab>

  <Tab title="404 Status Code">
    ### Nicht gefunden

    <CodeGroup>
      ```json UPLOAD_NOT_FOUND theme={null}
      // The upload was already completed, aborted, or expired.
      {
          "status": "error",
          "code": "UPLOAD_NOT_FOUND"
      }
      ```
    </CodeGroup>
  </Tab>

  <Tab title="413 Status Code">
    ### Payload zu groß

    <CodeGroup>
      ```json CHUNK_TOO_LARGE theme={null}
      // Each chunk accepts up to 32 MB.
      {
          "status": "error",
          "code": "CHUNK_TOO_LARGE"
      }
      ```
    </CodeGroup>
  </Tab>

  <Tab title="429 Status Code">
    ### Rate-limitiert

    <CodeGroup>
      ```json RATE_LIMITED theme={null}
      // Part rate limit reached (60 parts per 10s window, blocked for 10s).
      {
          "status": "error",
          "code": "RATE_LIMITED"
      }
      ```

      ```json TOO_MANY_CONCURRENT_CHUNKS theme={null}
      // At most 6 chunks may be in flight at a time. Wait for one to finish, then retry this part.
      {
          "status": "error",
          "code": "TOO_MANY_CONCURRENT_CHUNKS"
      }
      ```
    </CodeGroup>
  </Tab>

  <Tab title="500 Status Code">
    ### Upload fehlgeschlagen

    <CodeGroup>
      ```json UPLOAD_FAILED theme={null}
      // Failed to upload the chunk. Retry this part.
      {
          "status": "error",
          "code": "UPLOAD_FAILED"
      }
      ```
    </CodeGroup>
  </Tab>
</Tabs>
