Chelabase
ManagementFunctions

Create a function, or change its kind or its auth on the branch

PUT
/v1/databases/{id}/branches/{branch_id}/functions/{name}

Creates the function when the database has none of this name (201), else changes what the body names (200). A name is a lowercase letter, then up to 62 of a-z, 0-9 and -; public is reserved (the keyless invoke prefix). Changing the kind needs Admin and is refused while a protected branch has the function active.

Authorization

bearer
AuthorizationBearer <token>

In: header

Path Parameters

id*string

Database id

Formatuuid
branch_id*string

Branch id

Formatuuid
name*string

Function name

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

auth?|null
kind?|null

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X PUT "https://example.com/v1/databases/497f6eca-6276-4993-bfeb-53cbbbba6f08/branches/497f6eca-6276-4993-bfeb-53cbbbba6f08/functions/string" \  -H "Content-Type: application/json" \  -d '{}'
{  "auth": "key",  "created_at": "2019-08-24T14:15:22Z",  "deployment_id": "6ef0ac85-9892-4664-a2a5-58bf2af5a8a6",  "enabled": true,  "health": "healthy",  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "kind": "function",  "last_error": "string",  "name": "string",  "rollout": {    "deployment_id": "6ef0ac85-9892-4664-a2a5-58bf2af5a8a6",    "error": "string",    "started_at": "2019-08-24T14:15:22Z",    "state": "pending"  },  "run_as_active": true,  "run_as_role": "string",  "signing_secret": "string",  "updated_at": "2019-08-24T14:15:22Z"}