Skip to content

Upload one part

PUT
/attachment-uploads/{id}/parts/{n}
curl --request PUT \
--url https://api.engram.page/attachment-uploads/example/parts/1 \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/octet-stream' \
--data binary

Stores part n (1-based) as raw application/octet-stream bytes. Every part is exactly part_size bytes except the last, which is the remainder; any other size returns 422 bad_part_size and a part number outside the session returns 422 bad_part_number. Re-sending a part replaces it. A body that stalls returns 408. A session that already completed returns 409 upload_completed.

id
required
string

Upload id

n
required
integer

Part number, from 1

Part bytes

Media typeapplication/octet-stream
string format: binary

Part stored

Media typeapplication/json
AttachmentUploadPart
object
part
required
integer

Example generated

{
"part": 1
}

No such upload

Media typeapplication/json
Error
object
errors
One of:
string

Example generated

{
"errors": {}
}

Body stalled before it finished

Media typeapplication/json
MessageError
object
code

Stable machine-readable reason, where one is defined.

string
error
required
string

Example

{
"code": "blob_missing",
"error": "not found"
}

upload_completed: the session already completed

Media typeapplication/json
Error
object
errors
One of:
string

Example generated

{
"errors": {}
}

Bad part number or size

Media typeapplication/json
Error
object
errors
One of:
string

Example generated

{
"errors": {}
}

Storage backend failure

Media typeapplication/json
MessageError
object
code

Stable machine-readable reason, where one is defined.

string
error
required
string

Example

{
"code": "blob_missing",
"error": "not found"
}

rotation_in_progress: an encryption key rotation holds the account; retry after retry-after seconds.

Media typeapplication/json
MessageError
object
code

Stable machine-readable reason, where one is defined.

string
error
required
string

Example

{
"code": "blob_missing",
"error": "not found"
}