Hosting
Upload hosted code
POST /v1/hosting/uploads flows:write
What hcc deploy sends for definitions with hosting: 'hcc'. We put the bundle on our hosting with its secrets, check that it serves what manifest says, and answer with an id. Nothing runs it until the deploy's PUT /v1/flows, /v1/campaigns or /v1/text-flows carries that id as uploadId. Live hosted code runs on a live plan in good standing: without one this is 402, with the reason billing stops new calls for.
Body
-
bundlestring requiredThe hosted bundle: one ES module, everything inlined
-
bundleHashstring requiredThe bundle's SHA-256, hex
-
manifestHostedManifest requiredThe hosted definitions it serves, by version
Fields
-
flowsobject[] requiredFields
-
namestring required -
versionstring required
-
-
campaignsobject[] requiredFields
-
namestring required -
versionstring required
-
-
textFlowsobject[] requiredFields
-
namestring required -
versionstring required
-
-
-
alsoTestbooleanLive keys only: also upload the same bundle to test, with test's secrets, for a deploy whose
PUTs sendalsoTest. They take itstest.idastestUploadId. Defaultfalse.
Responses
- 200
Uploaded and loaded, ready to activate
Fields
-
dataHostedUpload requiredFields
-
idstring requiredPass it as
uploadIdto the deploy -
status"ready" required -
bundleHashstring required -
environment"live" | "test" required -
testobjectWith
alsoTest: the same bundle on test. Pass itsidastestUploadId.
-
-
- 400
Invalid request
- 401
Missing or invalid API key
- 404
Not found
- 429
rate_limited, or another limit named byerror.code
Get the hosted code running
GET /v1/hosting/active flows:read
What hcc deploy --check compares a fresh build's hash with.
Responses
- 200
The active hosted script, or null
Fields
-
dataHostedScript requiredThe hosted code running, or null when none is.
Fields
-
bundleHashstring required -
bundleBytesinteger required -
activatedAtstring | null required -
manifestHostedManifest requiredThe hosted definitions it serves, by version
-
-
- 400
Invalid request
- 401
Missing or invalid API key
- 404
Not found
- 429
rate_limited, or another limit named byerror.code
List hosted secrets
GET /v1/hosting/secrets flows:read
The key's environment's secret names and when each was set. Never values.
Responses
- 200
The secrets
Fields
-
dataHostedSecret[] requiredFields
-
namestring required -
environment"live" | "test" required -
setAtstring required
-
-
- 400
Invalid request
- 401
Missing or invalid API key
- 404
Not found
- 429
rate_limited, or another limit named byerror.code
Set a hosted secret
PUT /v1/hosting/secrets/{name} secrets:write
Hosted code reads it as ctx.env.NAME, or env('NAME') in a definition. It's write-only: nothing returns its value. Setting it replaces the old value, and running hosted code gets it without a deploy.
Path
namestring required
Body
-
valuestring required
Responses
- 200
Set
Fields
-
dataHostedSecretWrite requiredFields
-
appliedboolean requiredWhether the running hosted code has it now. False: none is running, or it couldn't be reached; the next deploy brings it.
-
-
- 400
Invalid request
- 401
Missing or invalid API key
- 404
Not found
- 429
rate_limited, or another limit named byerror.code
Delete a hosted secret
DELETE /v1/hosting/secrets/{name} secrets:write
Path
namestring required
Responses
- 200
Deleted
Fields
-
dataHostedSecretWrite requiredFields
-
appliedboolean requiredWhether the running hosted code has it now. False: none is running, or it couldn't be reached; the next deploy brings it.
-
-
- 400
Invalid request
- 401
Missing or invalid API key
- 404
Not found
- 429
rate_limited, or another limit named byerror.code