Blobs

Download a blob

Returns the bytes of a blob, from whichever store holds them, as a download. Send one Range to get part of it.

GET
/blobs/{hash}

Authorization

bearerAuth
headerAuthorizationBearer <token>

Authenticate with an API key (marfa_k1_…) or an OAuth access token (marfa_at_…).

Path parameters

hash*string

The blob's hash, sha256:<hex>. You can read a blob only if an item, edge or extension you can read references its hash, and whoever wrote that reference had uploaded the bytes or could read them. The blobs.manage permission reads every blob.

Response body

About errors

Returns the bytes, with the Content-Type the blob was first uploaded under, as a download.

response?fileapplication/octet-stream
Formatbinary

Returns the range you asked for. Marfa serves one range, bytes=<first>-<last> or bytes=<first>-. For any other Range, it returns the whole blob with 200.

response?fileapplication/octet-stream
Formatbinary
  • validation_error: the hash is malformed.
application/json
  1. response

An error response.

error*

What went wrong.

unauthorized: the request has no credential, or its credential is not valid. For a key that has expired, details.expired_at says when it expired.

application/json
  1. response

An error response.

error*

What went wrong.

  • type_not_permitted: your credential reaches no type.
application/json
  1. response

An error response.

error*

What went wrong.

  • blob_not_found: no blob has this hash, nothing you can read references it, or no store holds its bytes.
application/json
  1. response

An error response.

error*

What went wrong.

contract_mismatch: X-Marfa-Contract names another contract version than this instance speaks, or is not a whole number. Nothing was done.

application/json
  1. response

An error response.

error*

What went wrong.

  • range_not_satisfiable: the range starts past the end of the blob, or ends before it starts. Content-Range gives the blob's size.
application/json
  1. response

An error response.

error*

What went wrong.

rate_limited: you sent too many requests. Wait for the number of seconds in Retry-After, then try again.

application/json
  1. response

An error response.

error*

What went wrong.

internal_error: Marfa failed in a way it didn't expect, and the request may not have completed. Read what you changed before you repeat a write.

application/json
  1. response

An error response.

error*

What went wrong.

  • blob_store_unavailable: no store that holds this blob answered, so Marfa couldn't tell whether it still has the bytes. Try again later.
  • write_contention: the database was busy, and Marfa couldn't complete the request in time. Nothing changed. Try the request again.
application/json
  1. response

An error response.

error*

What went wrong.

insufficient_storage: the disk that holds the instance's data has no room for the request, or the request would leave less free than the instance keeps in reserve. Nothing changed, unless details.write_outcome is unknown, which means the write may have landed: read what you changed before you repeat it. Free space on the disk, then try the request again.

application/json
  1. response

An error response.

error*

What went wrong.

curl -X GET 'http://localhost:8600/blobs/string'
About errors
"string"