Skip to content
Subako Docs
English
Esc
↑↓navigate↵open⌘Jpreview

Create a function package

POST/v1/functions
Authorization
AuthorizationBearer token · headerrequired
Header parameters
Idempotency-Keystring
Retry the same operation with this key to return its saved receipt. Scoped by the operation's authenticated caller or resource. A different input under the same key returns 409. Receipts are retained for at least 7 days after completion, then removed by an hourly sweep. After removal the key can execute again. Fresh-only secrets are never included in a replay.
min length 1 · max length 255
Kikuvi-Workspacestring<uuid>
Workspace to create in. Required for a user caller; implied by the key for an API key caller.
Request body
requiredapplication/gzip
A gzipped tar holding subako-package.json and module.wasm at its root. Core asks the module its tools through MCP's tools/list.
string<binary>
Responses
201The new package's first version.
assetsany | FunctionAssetsBodyrequired
Show properties
One of:
any
any
FunctionAssetsBody
bytesinteger<int64>required
filesFunctionAssetFileBody[]required
Each file the archive holds, in path order.
Show properties
Array of FunctionAssetFileBody
pathstringrequired
The path under `assets/`, `/`-separated.
sha256stringrequired
Hex SHA-256 of the file's bytes.
sizeinteger<int64>required
min 0
sha256stringrequired
created_atstring<date-time>required
function_idstring<uuid>required
idstring<uuid>required
manifestFunctionManifestBodyrequired
What a version serves: the name and description its `subako-package.json` gives, and each tool its module lists.
Show properties
descriptionstringrequired
functionsManifestFunctionBody[]required
Show properties
Array of ManifestFunctionBody
descriptionstringrequired
input_schemaanyrequired
JSON Schema for the tool's arguments.
namestringrequired
output_schemaanyrequired
JSON Schema for the tool's output; `{}` when the tool names none.
namestringrequired
module_bytesinteger<int64>required
module_sha256stringrequired
versioninteger<int32>required
400Malformed archive, a bundle validation failure, a module that does not list valid tools, a deployment that runs no functions, a malformed workspace header, or a user caller with no workspace header.
errorErrorDetailrequired
What went wrong: a `code` to branch on and a `message` to show. The message is written for a person and may change; the code will not.
Show properties
codeErrorCoderequired
The machine-readable half of an error response, and the field a client branches on. Closed: every error carries exactly one of these.
Allowed:unauthorizedforbiddennot_foundinvalid_requestconflictclient_outdatedprecondition_failedtoo_many_requestsinternal
messagestringrequired
401Missing, malformed, or invalid bearer token.
errorErrorDetailrequired
What went wrong: a `code` to branch on and a `message` to show. The message is written for a person and may change; the code will not.
Show properties
codeErrorCoderequired
The machine-readable half of an error response, and the field a client branches on. Closed: every error carries exactly one of these.
Allowed:unauthorizedforbiddennot_foundinvalid_requestconflictclient_outdatedprecondition_failedtoo_many_requestsinternal
messagestringrequired
403Caller lacks function.manage, or an API key's Kikuvi-Workspace header names another workspace.
errorErrorDetailrequired
What went wrong: a `code` to branch on and a `message` to show. The message is written for a person and may change; the code will not.
Show properties
codeErrorCoderequired
The machine-readable half of an error response, and the field a client branches on. Closed: every error carries exactly one of these.
Allowed:unauthorizedforbiddennot_foundinvalid_requestconflictclient_outdatedprecondition_failedtoo_many_requestsinternal
messagestringrequired
404No such workspace, or the caller cannot see it.
errorErrorDetailrequired
What went wrong: a `code` to branch on and a `message` to show. The message is written for a person and may change; the code will not.
Show properties
codeErrorCoderequired
The machine-readable half of an error response, and the field a client branches on. Closed: every error carries exactly one of these.
Allowed:unauthorizedforbiddennot_foundinvalid_requestconflictclient_outdatedprecondition_failedtoo_many_requestsinternal
messagestringrequired
409Idempotency-Key was already used for a different request.
errorErrorDetailrequired
What went wrong: a `code` to branch on and a `message` to show. The message is written for a person and may change; the code will not.
Show properties
codeErrorCoderequired
The machine-readable half of an error response, and the field a client branches on. Closed: every error carries exactly one of these.
Allowed:unauthorizedforbiddennot_foundinvalid_requestconflictclient_outdatedprecondition_failedtoo_many_requestsinternal
messagestringrequired
413Request body exceeds the upload size limit.
errorErrorDetailrequired
What went wrong: a `code` to branch on and a `message` to show. The message is written for a person and may change; the code will not.
Show properties
codeErrorCoderequired
The machine-readable half of an error response, and the field a client branches on. Closed: every error carries exactly one of these.
Allowed:unauthorizedforbiddennot_foundinvalid_requestconflictclient_outdatedprecondition_failedtoo_many_requestsinternal
messagestringrequired
Try it
Server
Authorization
Parameters
Bodyapplication/gzip
Request
curl -X POST "https://api.us.cloud.subako.ai/v1/functions" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/gzip" \
  -d '"string"'
Response
{
  "assets": {},
  "created_at": "2019-08-24T14:15:22Z",
  "function_id": "88972a47-7c82-4b1c-bc75-afe8ae423a46",
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "manifest": {
    "description": "string",
    "functions": [
      {
        "description": "string",
        "input_schema": null,
        "name": "string",
        "output_schema": null
      }
    ],
    "name": "string"
  },
  "module_bytes": 0,
  "module_sha256": "string",
  "version": 0
}