Skip to content
sproutboatDocs
Esc
↑↓navigate↵open⌘Jpreview

Upload a source bundle

The bytes of the app’s generated JavaScript, as application/octet-stream. At most 8 MiB, non-empty, valid UTF-8, and sha256 must be the lowercase hex SHA-256 of exactly these bytes (else 400 digest mismatch). Idempotent. Not tied to an app until a build names it. The source belongs to the uploading team: another team’s build cannot name it. New bytes count against the team’s 24-hour budget (429 quota-upload), and uploads are rate-limited per team (429 upload-rate). A source no build used is deleted after a grace period of at least 48 hours.

PUT/v1/sources/{sha256}
Authorization
AuthorizationBearer token · headerrequired

A team API key, sbk_..., from Settings, API keys.

or
x-api-keyAPI key · headerrequired

The same key, in a header of its own.

Path parameters
sha256Sha256required

Lowercase hex SHA-256 of the exact bytes of the body.

matches ^[0-9a-f]{64}$
Request body
requiredapplication/octet-stream
string<binary>
Responses
200

Stored.

sha256Sha256required
matches ^[0-9a-f]{64}$
sizeintegerrequired
storedbooleanrequired

False when the Cloud already had these bytes.

400

The request is malformed. path names the field when one is at fault; some refusals (a digest mismatch, a body that is not JSON) carry a message only.

One of:
ErrorInvalid
errorstringrequired

A message for people. Do not parse it.

reasonstringrequired
Allowed:invalid
ErrorPlain
errorstringrequired

A message for people. Do not parse it.

reasonstring

A stable, machine-readable cause, when there is one.

pathstring

The request field at fault.

needstring

The grant a 403 asks for, app:write for example.

retry_after_sinteger
401

No key, or an invalid, expired or revoked key (unknown or missing API token, invalid, expired or revoked API key). No reason.

errorstringrequired

A message for people. Do not parse it.

reasonstring

A stable, machine-readable cause, when there is one.

pathstring

The request field at fault.

needstring

The grant a 403 asks for, app:write for example.

retry_after_sinteger
403

The key lacks a grant (reason: forbidden, need: "<resource>:<action>").

errorstringrequired

A message for people. Do not parse it.

reasonstringrequired
Allowed:forbidden
needstringrequired

The grant, as <resource>:<action>, for example app:write.

413

The body is over the limit for this route (reason: too-large; some refusals carry a message only).

One of:
ErrorTooLarge
errorstringrequired

A message for people. Do not parse it.

reasonstringrequired
Allowed:too-large
ErrorPlain
errorstringrequired

A message for people. Do not parse it.

reasonstring

A stable, machine-readable cause, when there is one.

pathstring

The request field at fault.

needstring

The grant a 403 asks for, app:write for example.

retry_after_sinteger
429

The key is rate-limited (key-rate-limited), the team uploads too fast (upload-rate), or it is over its 24-hour budget of new source bytes (quota-upload). Honor Retry-After.

One of:
ErrorKeyRateLimited
errorstringrequired

A message for people. Do not parse it.

reasonstringrequired
Allowed:key-rate-limited
retry_after_sintegerrequired

Seconds to wait; also the Retry-After header.

ErrorUploadRate
errorstringrequired

A message for people. Do not parse it.

reasonstringrequired
Allowed:upload-rate
retry_afterintegerrequired

Seconds to wait; also the Retry-After header.

ErrorQuotaUpload
errorstringrequired

A message for people. Do not parse it.

reasonstringrequired
Allowed:quota-upload
keystringrequired

Which budget.

Allowed:source_mb_per_dayasset_mb_per_day
limitintegerrequired

MiB per 24 hours.

used_mbintegerrequired

MiB uploaded in the last 24 hours.

retry_after_sintegerrequired

Also the Retry-After header.

Request
curl -X PUT 'https://dash.sproutboat.com/v1/sources/string' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/octet-stream' \
  -d 'string'
Response
{
  "sha256": "string",
  "size": 0,
  "stored": true
}