Skip to content
Connect an agent

Media

Upload one part

One part of a multipart upload, as the raw body with its Content-Length.

PUT/v1/media/{id}/parts/{partNumber}

TL;DR

QuestionAnswer
What does it do?Upload one part.
What does it need?An API key or an OAuth access token.
What does it take?id, partNumber in the path.
What does it return?Status 200 with a body of type UploadedPart.
In the SDK?flung.media.uploadPart()
What can go wrong?401 Missing, unknown, revoked or expired API key; 404 No such file in this workspace; 422 The request failed validation; 429 Too many requests for this credential; wait for retry-after seconds. Every failure has the same error shape.

What it does

One part of a multipart upload, as the raw body with its Content-Length. Sending a part again replaces it.

Example

bash
curl -X PUT 'https://api.flung.dev/v1/media/med_aaaaaaaaaaaaaaaaaaaaaaaa/parts/1' \  --header "Authorization: Bearer $FLUNG_API_KEY" \  --header 'Content-Type: application/octet-stream' \  --data-binary @launch.png

A successful answer looks like this:

json
{  "partNumber": 1,  "bytes": 1}

Path parameters

FieldTypeRequiredDescription
idstringyes
partNumberintegeryes

Responses

StatusMeaningBody
200The part was stored.UploadedPart
401Missing, unknown, revoked or expired API key.Error
404No such file in this workspace.Error
422The request failed validation.Error
429Too many requests for this credential; wait for retry-after seconds.Error

Response body

A 200 answer has the type UploadedPart.

FieldTypeRequiredDescription
partNumberintegeryes
bytesintegeryes

See also

DocWhy
API referenceEvery endpoint
SchemasEvery request and response type
ErrorsEvery error code and what to do about it