# Create a Job

URL: /docs/api/workloads/job/create

`POST /apis/funcd.io/v1alpha1/namespaces/{namespace}/jobs`

## Authentication

One of:

- `bearer`: A credential of funcd's config, sent as Authorization: Bearer followed by its token.
- `apiKey`: A credential of funcd's config, sent in the X-Api-Key header.

## Parameters

| Parameter | In | Type | Description |
| --- | --- | --- | --- |
| `namespace` | path | string, required | The object's namespace. |
| `dryRun` | query | boolean | Admit the write and store nothing. |

## Body

`Job` as `application/json`, required.

```json
{
  "additionalProperties": false,
  "properties": {
    "apiVersion": {
      "type": "string"
    },
    "kind": {
      "type": "string"
    },
    "metadata": {
      "additionalProperties": false,
      "properties": {
        "creationTimestamp": {
          "description": "When funcd created the object.",
          "format": "date-time",
          "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{3}Z$",
          "patternDescription": "an RFC3339 UTC timestamp with exactly 3 fractional digits (2026-10-07T20:03:35.965Z)",
          "type": "string"
        },
        "deletionTimestamp": {
          "description": "When funcd held the object at its deletion: an object of an Engineless add-on kind with deletion: delete stays, deleting, until its Function has destroyed what it holds. funcd sets it on no other object, and a write keeps it.",
          "format": "date-time",
          "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{3}Z$",
          "patternDescription": "an RFC3339 UTC timestamp with exactly 3 fractional digits (2026-10-07T20:03:35.965Z)",
          "type": "string"
        },
        "finalizers": {
          "description": "funcd does not read it.",
          "items": {
            "type": "string"
          },
          "type": [
            "array",
            "null"
          ]
        },
        "generateName": {
          "description": "A prefix from which funcd makes the name, adding a random suffix, when a create leaves name empty.",
          "pattern": "^[a-z0-9][a-z0-9-]{0,62}$",
          "type": "string"
        },
        "generation": {
          "description": "Set by funcd: 1 when the object is created, then one more each time its spec changes.",
          "format": "int64",
          "type": "integer"
        },
        "name": {
          "description": "The object's name, unique among the objects of its kind in its namespace. A create may leave it empty and set generateName instead.",
          "maxLength": 63,
          "minLength": 1,
          "pattern": "^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$",
          "type": "string"
        },
        "namespace": {
          "description": "The namespace the object belongs to. A cluster-scoped kind has none.",
          "maxLength": 63,
          "minLength": 1,
          "pattern": "^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$",
          "type": "string"
        },
        "ownerReferences": {
          "description": "The objects that own this one. funcd deletes an owned object when its owner goes.",
          "items": {
            "additionalProperties": false,
            "properties": {
              "blockOwnerDeletion": {
                "description": "funcd does not read it.",
                "type": "boolean"
              },
              "controller": {
                "description": "Whether this owner is the one that manages the object.",
                "type": "boolean"
              },
              "kind": {
                "description": "The kind of the object it names.",
                "type": "string"
              },
              "name": {
                "description": "The name of the object it names.",
                "maxLength": 63,
                "minLength": 1,
                "pattern": "^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$",
                "type": "string"
              },
              "namespace": {
                "description": "The namespace of the object it names.",
                "maxLength": 63,
                "minLength": 1,
                "pattern": "^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$",
                "type": "string"
              },
              "uid": {
                "description": "The owner's unique ID.",
                "type": "string"
              }
            },
            "required": [
              "uid",
              "kind",
              "name"
            ],
            "type": "object"
          },
          "type": [
            "array",
            "null"
          ]
        },
        "resourceGroup": {
          "description": "The resource group the object belongs to, within its namespace.",
          "maxLength": 63,
          "minLength": 1,
          "pattern": "^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$",
          "type": "string"
        },
        "resourceVersion": {
          "description": "An opaque version of the stored object, which funcd sets. An update that sends it gets a conflict when the object changed since; compare it for equality only.",
          "type": "string"
        },
        "tags": {
          "additionalProperties": {
            "type": "string"
          },
          "description": "Labels on the object, as keys and values.",
          "type": "object"
        },
        "uid": {
          "description": "The object's unique ID, which funcd sets when it creates the object.",
          "type": "string"
        }
      },
      "type": "object"
    },
    "spec": {
      "additionalProperties": false,
      "properties": {
        "approval": {
          "additionalProperties": false,
          "properties": {
            "bypass": {
              "description": "When true, a run runs at once, with no preview and no approval. Unset or false, a run first calls the code's preview, then waits in AwaitingApproval until a person approves or rejects it. A Job for unattended work sets it.",
              "type": "boolean"
            },
            "expiry": {
              "description": "How long a preview stays valid for its approval: 1m to 168h; unset means 24h. A preview older than this when it is approved, or when its run's slot frees after the approval, is previewed again: the run runs when the new preview is the same document, and waits for a new approval when it differs.",
              "pattern": "^([0-9]+h([0-9]+m)?([0-9]+s)?([0-9]+ms)?|[0-9]+m([0-9]+s)?([0-9]+ms)?|[0-9]+s([0-9]+ms)?|[0-9]+ms)$",
              "patternDescription": "a duration: whole numbers with the units h, m, s and ms, largest unit first (10m, 1h30m, 500ms)",
              "type": "string"
            }
          },
          "type": "object",
          "description": "Whether a run waits for a person's approval of its preview before it runs. Unset, every run previews and waits."
        },
        "bindings": {
          "additionalProperties": false,
          "properties": {
            "addon": {
              "description": "The add-on objects whose engines the code calls, each under its alias: through ctx.addon.fetch, or with any HTTP client at FUNCD_ADDON_<ALIAS>_URL with the header X-Funcd-Addon-Token set to FUNCD_ADDON_<ALIAS>_TOKEN. Each call goes through funcd, which asks Cedar for addon::call and serves only the paths that the object's edge entry serves.",
              "items": {
                "additionalProperties": false,
                "properties": {
                  "alias": {
                    "description": "The name the handler calls the object by: ctx.addon.fetch takes it, and the worker gets FUNCD_ADDON_<ALIAS>_URL and FUNCD_ADDON_<ALIAS>_TOKEN for an HTTP SDK. Unique in the list.",
                    "pattern": "^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$",
                    "type": "string"
                  },
                  "object": {
                    "description": "An add-on object of the Function's namespace, declared by its App when an App holds the Function. A missing one holds the Function in Pending with AddonObjectNotFound.",
                    "maxLength": 63,
                    "minLength": 1,
                    "pattern": "^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$",
                    "type": "string"
                  }
                },
                "required": [
                  "alias",
                  "object"
                ],
                "type": "object"
              },
              "type": [
                "array",
                "null"
              ]
            },
            "blob": {
              "description": "The Bucket prefixes the code reaches through ctx.blob, and over S3 while the S3 gateway is on, each under its alias. The binding grants reads; only the prefix's owner and the writers that a RolesAssignment names may write. A Bucket or prefix that does not exist yet holds the Function in Pending with BucketNotFound.",
              "items": {
                "additionalProperties": false,
                "properties": {
                  "alias": {
                    "description": "The binding's name, unique in the list; code that reaches the prefix through ctx.blob passes it.",
                    "pattern": "^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$",
                    "type": "string"
                  },
                  "bucket": {
                    "description": "The Bucket, in the same namespace, that holds the prefix.",
                    "maxLength": 63,
                    "minLength": 1,
                    "pattern": "^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$",
                    "type": "string"
                  },
                  "prefix": {
                    "description": "The prefix, by its name in the Bucket's prefixes.",
                    "pattern": "^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$",
                    "type": "string"
                  }
                },
                "required": [
                  "alias",
                  "bucket",
                  "prefix"
                ],
                "type": "object"
              },
              "type": [
                "array",
                "null"
              ]
            },
            "config": {
              "description": "ConfigMaps whose keys each worker gets as environment variables when it starts, a later ConfigMap's value winning for a key that both hold. A key that starts with FUNCD_, or that a bound Secret holds, is left out; and while the S3 gateway is on, a Function that binds a Bucket gets the AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY that funcd issues it, in place of a ConfigMap's. A missing ConfigMap holds the Function Failed with ConfigResolveFailed.",
              "items": {
                "maxLength": 63,
                "minLength": 1,
                "pattern": "^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$",
                "type": "string"
              },
              "type": [
                "array",
                "null"
              ]
            },
            "job": {
              "description": "The Jobs whose runs the code starts with ctx.job.start and reads with ctx.job.get, each under its alias. The binding grants both, and a namespace Policy that forbids job::start or job::read to the Function revokes one. A run that the code starts passes the checks of a run that a person starts, and a Job's own spec refuses this list.",
              "items": {
                "additionalProperties": false,
                "properties": {
                  "alias": {
                    "description": "The name that the code passes to ctx.job.start and ctx.job.get. Unique in the list.",
                    "pattern": "^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$",
                    "type": "string"
                  },
                  "job": {
                    "description": "A Job of the Function's namespace. While the Job is missing, a start on its alias answers 404, and a read still answers each run that a deleted Job left, until job.retention removes it.",
                    "maxLength": 63,
                    "minLength": 1,
                    "pattern": "^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$",
                    "type": "string"
                  }
                },
                "required": [
                  "alias",
                  "job"
                ],
                "type": "object"
              },
              "type": [
                "array",
                "null"
              ]
            },
            "kv": {
              "description": "The KV tables the code reaches through ctx.kv, each under its alias. The binding grants reads; only the table's owner and the writers that a RolesAssignment names may write. A store or table that does not exist yet holds the Function in Pending with KVStoreNotFound.",
              "items": {
                "additionalProperties": false,
                "properties": {
                  "alias": {
                    "description": "The binding's name, unique in the list, which the code passes to ctx.kv.",
                    "pattern": "^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$",
                    "type": "string"
                  },
                  "store": {
                    "description": "The KVStore, in the same namespace, that holds the table.",
                    "maxLength": 63,
                    "minLength": 1,
                    "pattern": "^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$",
                    "type": "string"
                  },
                  "table": {
                    "description": "The table, by its name in the store's tables.",
                    "pattern": "^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$",
                    "type": "string"
                  }
                },
                "required": [
                  "alias",
                  "store",
                  "table"
                ],
                "type": "object"
              },
              "type": [
                "array",
                "null"
              ]
            },
            "lake": {
              "description": "The Lakes the code queries, each under its alias. The Function waits in Pending with LakeNotReady until every bound Lake is Ready.",
              "items": {
                "additionalProperties": false,
                "properties": {
                  "alias": {
                    "description": "The binding's name, unique in the list. Each worker reads the Lake's address and its token from FUNCD_LAKE_<ALIAS>_URL and FUNCD_LAKE_<ALIAS>_TOKEN, the alias upper-cased.",
                    "pattern": "^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$",
                    "type": "string"
                  },
                  "lake": {
                    "description": "The Lake to query, in the same namespace.",
                    "maxLength": 63,
                    "minLength": 1,
                    "pattern": "^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$",
                    "type": "string"
                  }
                },
                "required": [
                  "alias",
                  "lake"
                ],
                "type": "object"
              },
              "type": [
                "array",
                "null"
              ]
            },
            "links": {
              "description": "The Functions the code calls, each under its alias: through ctx.invoke one whose protocol is cloudevent, through ctx.fetch one whose protocol is http. Each target must exist in the namespace when this Function is applied, the namespace's links form no cycle, and a Function that a link targets cannot be deleted until the link goes.",
              "items": {
                "additionalProperties": false,
                "properties": {
                  "alias": {
                    "description": "The link's name, unique in the list, which the code passes to ctx.invoke or ctx.fetch.",
                    "pattern": "^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$",
                    "type": "string"
                  },
                  "target": {
                    "description": "The Function to call, in the same namespace.",
                    "maxLength": 63,
                    "minLength": 1,
                    "pattern": "^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$",
                    "type": "string"
                  },
                  "timeout": {
                    "description": "Bounds the synchronous call, a cold-start wake included: 0s to 5m; 0s or unset means the 30s link default.",
                    "pattern": "^([0-9]+h([0-9]+m)?([0-9]+s)?([0-9]+ms)?|[0-9]+m([0-9]+s)?([0-9]+ms)?|[0-9]+s([0-9]+ms)?|[0-9]+ms)$",
                    "patternDescription": "a duration: whole numbers with the units h, m, s and ms, largest unit first (10m, 1h30m, 500ms)",
                    "type": "string"
                  }
                },
                "required": [
                  "alias",
                  "target"
                ],
                "type": "object"
              },
              "type": [
                "array",
                "null"
              ]
            },
            "secret": {
              "description": "Secrets whose keys the code reads through ctx.secret, on each read and with no cache, a later Secret's value winning for a key that both hold. No value reaches the worker's environment. No worker starts while a bound Secret is missing, and a worker whose Function a Policy forbids to read one is not ready.",
              "items": {
                "maxLength": 63,
                "minLength": 1,
                "pattern": "^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$",
                "type": "string"
              },
              "type": [
                "array",
                "null"
              ]
            },
            "sql": {
              "description": "The SQLDatabases the code queries through ctx.sql, each under its alias. The binding grants reads; only the database's owner and the writers that a RolesAssignment names may write. A database that does not exist yet holds the Function in Pending with SQLDatabaseNotFound.",
              "items": {
                "additionalProperties": false,
                "properties": {
                  "alias": {
                    "description": "The binding's name, unique in the list, which the code passes to ctx.sql.",
                    "pattern": "^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$",
                    "type": "string"
                  },
                  "database": {
                    "description": "The SQLDatabase to query, in the same namespace.",
                    "maxLength": 63,
                    "minLength": 1,
                    "pattern": "^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$",
                    "type": "string"
                  }
                },
                "required": [
                  "alias",
                  "database"
                ],
                "type": "object"
              },
              "type": [
                "array",
                "null"
              ]
            }
          },
          "type": "object",
          "description": "What the code may use: KV tables, Bucket prefixes, SQL databases, Lakes and Functions, each under an alias, and ConfigMaps and Secrets. A binding is the grant: a call on an alias with no binding is refused with 403. Each store, Lake, ConfigMap and Secret it names must be declared at the root, in this spec's kv, buckets, sql, lakes, configMaps or secrets."
        },
        "buckets": {
          "description": "The Buckets the Job declares: by name it creates and owns one, and a Bucket of that name that it does not own holds it in Pending with StoreNotOwned; by ref it uses an existing one. spec.bindings.blob binds only a declared Bucket.",
          "items": {
            "additionalProperties": false,
            "properties": {
              "deletion": {
                "description": "retain (the default) keeps the store and its data when the resource that declares it is deleted, and delete removes them. An App applies the same choice when it drops the entry.",
                "enum": [
                  "retain",
                  "delete"
                ],
                "type": "string"
              },
              "name": {
                "description": "The object's name. It takes the namespace and resource group of the resource that declares it.",
                "maxLength": 63,
                "minLength": 1,
                "pattern": "^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$",
                "type": "string"
              },
              "prefixes": {
                "description": "The Bucket's prefixes, each a key space with its own owner and cap. Prefix names are unique within the Bucket. A Function or a Lake that binds a prefix the Bucket does not list waits, with the reason BucketNotFound.",
                "items": {
                  "additionalProperties": false,
                  "properties": {
                    "name": {
                      "description": "The prefix's name, unique within the Bucket. Over S3, it is the first segment of each object's key.",
                      "pattern": "^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$",
                      "type": "string"
                    },
                    "owner": {
                      "additionalProperties": false,
                      "properties": {
                        "kind": {
                          "description": "The workload's kind. A Function, a Lake and a Job may share a name, so the kind says which one it is; each field names the kinds it accepts.",
                          "enum": [
                            "Function",
                            "Lake",
                            "Job"
                          ],
                          "type": "string"
                        },
                        "name": {
                          "description": "The workload's name, in the object's namespace.",
                          "maxLength": 63,
                          "minLength": 1,
                          "pattern": "^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$",
                          "type": "string"
                        }
                      },
                      "required": [
                        "kind",
                        "name"
                      ],
                      "type": "object",
                      "description": "The one Function, Lake or Job that may write the prefix, named with its kind, besides the writers that a RolesAssignment names. In a Bucket that a Function, a Lake or a Job declares by name, an omitted owner is that workload. In a Workflow's buckets, a Function owner names a step and a Lake owner a lake that the Workflow declares. The prefix that a Site serves its bundle from must have no owner, since the Site writes its builds there; the prefixes of a Site's ingress rules may have one."
                    },
                    "quota": {
                      "additionalProperties": false,
                      "properties": {
                        "maxBytes": {
                          "description": "The same cap as a number of bytes. Set maxSize or maxBytes, not both.",
                          "format": "int64",
                          "minimum": 0,
                          "type": "integer"
                        },
                        "maxSize": {
                          "description": "The cap on the total size held, above zero. Set maxSize or maxBytes, not both; neither means no cap. A write that would pass the cap gets 507 in a KV store or a Bucket; a SQL execute call gets 507 once the database holds the cap.",
                          "pattern": "^[0-9]{1,15}((Ki|Mi|Gi|Ti)B?)?$",
                          "patternDescription": "a size: 1 to 15 digits and an optional binary unit, Ki, Mi, Gi or Ti, with or without a B (512Ki, 2GiB)",
                          "type": "string"
                        }
                      },
                      "type": "object",
                      "description": "A cap on the prefix's total size: a write into the prefix must fit both this cap and the Bucket's, and while it is set funcd refuses to sign a presigned PUT URL into the prefix, with 403. It also caps a Lake's files under the prefix, though not the Lake's catalog."
                    }
                  },
                  "required": [
                    "name"
                  ],
                  "type": "object"
                },
                "type": [
                  "array",
                  "null"
                ]
              },
              "quota": {
                "additionalProperties": false,
                "properties": {
                  "maxBytes": {
                    "description": "The same cap as a number of bytes. Set maxSize or maxBytes, not both.",
                    "format": "int64",
                    "minimum": 0,
                    "type": "integer"
                  },
                  "maxObjectBytes": {
                    "description": "The largest object a write may store, in bytes. A larger write gets 413, or EntityTooLarge over S3, and while it is set funcd refuses to sign a presigned PUT URL for the Bucket, with 403. 0 sets no cap of the Bucket's own, so only funcd's upload limits apply, such as s3gateway.maxUploadBytes.",
                    "format": "int64",
                    "minimum": 0,
                    "type": "integer"
                  },
                  "maxSize": {
                    "description": "The cap on the total size held, above zero. Set maxSize or maxBytes, not both; neither means no cap. A write that would pass the cap gets 507 in a KV store or a Bucket; a SQL execute call gets 507 once the database holds the cap.",
                    "pattern": "^[0-9]{1,15}((Ki|Mi|Gi|Ti)B?)?$",
                    "patternDescription": "a size: 1 to 15 digits and an optional binary unit, Ki, Mi, Gi or Ti, with or without a B (512Ki, 2GiB)",
                    "type": "string"
                  }
                },
                "type": "object",
                "description": "Caps on the Bucket's total size and on each object. While the Bucket has a size cap, funcd refuses to sign a presigned PUT URL for it, with 403."
              },
              "ref": {
                "description": "The name of an existing object of this kind in the namespace of the resource that declares it. A ref entry sets no other field.",
                "maxLength": 63,
                "minLength": 1,
                "pattern": "^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$",
                "type": "string"
              }
            },
            "type": "object"
          },
          "type": [
            "array",
            "null"
          ]
        },
        "concurrency": {
          "description": "How many of the Job's runs may hold a worker at once, those Previewing included: 1 to 15; unset means 1, and a local volume allows only 1. A run past it waits in Pending with Queued.",
          "format": "int64",
          "maximum": 15,
          "minimum": 1,
          "type": "integer"
        },
        "configMaps": {
          "description": "The ConfigMaps the Job declares: by name it defines one from its data, which goes with the Job, by ref it uses an existing one. spec.bindings.config binds only a declared ConfigMap.",
          "items": {
            "additionalProperties": false,
            "properties": {
              "data": {
                "additionalProperties": {
                  "type": "string"
                },
                "description": "Keys and their string values, for settings that are not secret. Each key is an environment variable name: ASCII letters, digits and _, not starting with a digit. Each value must be UTF-8 text with no NUL byte: a Function or a Lake that binds a ConfigMap holding another value does not start. Each worker of a Function that lists the ConfigMap in bindings.config gets each key as an environment variable when it starts, except a key that starts with FUNCD_ or that a bound Secret also holds; and while the S3 gateway is on, a Function that binds a Bucket gets the AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY that funcd issues it, in place of the ConfigMap's. A Lake that lists it gives its engine only the keys that the Lake's bindings.config lets through.",
                "type": "object"
              },
              "name": {
                "description": "The ConfigMap's name, at most 52 characters. It is stored as <name>-<hash of data>, and the config of each part that names it is set to that stored name.",
                "maxLength": 63,
                "minLength": 1,
                "pattern": "^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$",
                "type": "string"
              },
              "ref": {
                "description": "The name of an existing object of this kind in the namespace of the resource that declares it. A ref entry sets no other field.",
                "maxLength": 63,
                "minLength": 1,
                "pattern": "^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$",
                "type": "string"
              }
            },
            "type": "object"
          },
          "type": [
            "array",
            "null"
          ]
        },
        "handler": {
          "description": "The name of the export that the shim calls once for each run, such as handle. A Job without one, or whose code has no such export, is not Ready, with ShapeInvalid.",
          "pattern": "^[A-Za-z_][A-Za-z0-9_.]*$",
          "type": "string"
        },
        "image": {
          "description": "The OCI reference of the code's artifact: a registry reference with a tag or a digest, or an oci-layout:// reference to a layout on the server's disk. A Job whose image is missing, or cannot be resolved or pulled, starts no run.",
          "type": "string"
        },
        "imageDigest": {
          "description": "The sha256 digest that funcd pulls the image by and checks it against. Unset, funcd resolves the image to its digest when it creates the Revision of a new spec and keeps that digest, so a tag that moves later changes nothing.",
          "pattern": "^sha256:[a-f0-9]{64}$",
          "type": "string"
        },
        "kv": {
          "description": "The KVStores the Job declares: by name it creates and owns one, and a store of that name that it does not own holds it in Pending with StoreNotOwned; by ref it uses an existing one. spec.bindings.kv binds only a declared store.",
          "items": {
            "additionalProperties": false,
            "properties": {
              "deletion": {
                "description": "retain (the default) keeps the store and its data when the resource that declares it is deleted, and delete removes them. An App applies the same choice when it drops the entry.",
                "enum": [
                  "retain",
                  "delete"
                ],
                "type": "string"
              },
              "name": {
                "description": "The object's name. It takes the namespace and resource group of the resource that declares it.",
                "maxLength": 63,
                "minLength": 1,
                "pattern": "^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$",
                "type": "string"
              },
              "quota": {
                "additionalProperties": false,
                "properties": {
                  "maxBytes": {
                    "description": "The same cap as a number of bytes. Set maxSize or maxBytes, not both.",
                    "format": "int64",
                    "minimum": 0,
                    "type": "integer"
                  },
                  "maxKeyBytes": {
                    "description": "The longest key, in bytes. 0 means 1024 (1 KiB).",
                    "format": "int64",
                    "maximum": 64000,
                    "minimum": 0,
                    "type": "integer"
                  },
                  "maxSize": {
                    "description": "The cap on the total size held, above zero. Set maxSize or maxBytes, not both; neither means no cap. A write that would pass the cap gets 507 in a KV store or a Bucket; a SQL execute call gets 507 once the database holds the cap.",
                    "pattern": "^[0-9]{1,15}((Ki|Mi|Gi|Ti)B?)?$",
                    "patternDescription": "a size: 1 to 15 digits and an optional binary unit, Ki, Mi, Gi or Ti, with or without a B (512Ki, 2GiB)",
                    "type": "string"
                  },
                  "maxValueBytes": {
                    "description": "The largest value a write may store, in bytes. 0 means 1048576 (1 MiB).",
                    "format": "int64",
                    "maximum": 1048576,
                    "minimum": 0,
                    "type": "integer"
                  }
                },
                "type": "object",
                "description": "Caps on the store's total size, on each value and on each key."
              },
              "ref": {
                "description": "The name of an existing object of this kind in the namespace of the resource that declares it. A ref entry sets no other field.",
                "maxLength": 63,
                "minLength": 1,
                "pattern": "^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$",
                "type": "string"
              },
              "tables": {
                "description": "The store's tables. A table is a key space that only its owner and the writers that a RolesAssignment names may write. Table names are unique within the store, and a store with no table has nothing a Function can write.",
                "items": {
                  "additionalProperties": false,
                  "properties": {
                    "name": {
                      "description": "The table's name, unique within the store.",
                      "pattern": "^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$",
                      "type": "string"
                    },
                    "owner": {
                      "additionalProperties": false,
                      "properties": {
                        "kind": {
                          "description": "The workload's kind. A Function, a Lake and a Job may share a name, so the kind says which one it is; each field names the kinds it accepts.",
                          "enum": [
                            "Function",
                            "Lake",
                            "Job"
                          ],
                          "type": "string"
                        },
                        "name": {
                          "description": "The workload's name, in the object's namespace.",
                          "maxLength": 63,
                          "minLength": 1,
                          "pattern": "^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$",
                          "type": "string"
                        }
                      },
                      "required": [
                        "kind",
                        "name"
                      ],
                      "type": "object",
                      "description": "The Function or Job that owns the table, in the store's namespace, named with its kind. The owner writes the table, and so does a principal that a RolesAssignment grants kv::write on the table, its store or its namespace, such as the KV Data Writer role. In a store that a Function or a Job declares, the owner defaults to that workload; in one that a Workflow declares, a Function owner names a step, and the Function that funcd creates for that step is the owner; in a KVStore applied on its own, a table with no owner is written only through such a grant. Every workload, the owner included, reaches the table through an entry of its spec.bindings.kv."
                    }
                  },
                  "required": [
                    "name"
                  ],
                  "type": "object"
                },
                "type": [
                  "array",
                  "null"
                ]
              }
            },
            "type": "object"
          },
          "type": [
            "array",
            "null"
          ]
        },
        "lakes": {
          "description": "The Lakes the Job declares: by name it creates one that goes with the Job, by ref it uses an existing one. spec.bindings.lake binds only a declared Lake, and a Lake declared by name declares nothing at its own root: it binds the Job's buckets, configMaps and secrets.",
          "items": {
            "additionalProperties": false,
            "properties": {
              "bindings": {
                "additionalProperties": false,
                "properties": {
                  "blob": {
                    "description": "The Bucket prefixes the engine may read, each under an alias. It writes only a prefix whose owner is this Lake, and the Lake's location must be one of them.",
                    "items": {
                      "additionalProperties": false,
                      "properties": {
                        "alias": {
                          "description": "The binding's name, unique in the list; code that reaches the prefix through ctx.blob passes it.",
                          "pattern": "^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$",
                          "type": "string"
                        },
                        "bucket": {
                          "description": "The Bucket, in the same namespace, that holds the prefix.",
                          "maxLength": 63,
                          "minLength": 1,
                          "pattern": "^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$",
                          "type": "string"
                        },
                        "prefix": {
                          "description": "The prefix, by its name in the Bucket's prefixes.",
                          "pattern": "^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$",
                          "type": "string"
                        }
                      },
                      "required": [
                        "alias",
                        "bucket",
                        "prefix"
                      ],
                      "type": "object"
                    },
                    "type": [
                      "array",
                      "null"
                    ]
                  },
                  "config": {
                    "description": "ConfigMaps whose data the engine gets as environment variables. Only QUACK_TOKEN and the DUCKDB_ keys pass, DUCKDB_EXTENSION_DIRECTORY excepted, and a bound Secret's value wins over a ConfigMap's for the same key. A missing ConfigMap holds the Lake in Pending, with the reason BindingResolveFailed.",
                    "items": {
                      "maxLength": 63,
                      "minLength": 1,
                      "pattern": "^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$",
                      "type": "string"
                    },
                    "type": [
                      "array",
                      "null"
                    ]
                  },
                  "secret": {
                    "description": "Secrets whose data the engine gets as environment variables, such as its QUACK_TOKEN; the same keys pass as for config. funcd asks Cedar, as the Lake, for secret::read on each: a forbidden Secret holds the Lake in Pending, with the reason BindingResolveFailed, as does a missing one in a lake that another resource declares. A changed value replaces the engine.",
                    "items": {
                      "maxLength": 63,
                      "minLength": 1,
                      "pattern": "^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$",
                      "type": "string"
                    },
                    "type": [
                      "array",
                      "null"
                    ]
                  }
                },
                "required": [
                  "blob"
                ],
                "type": "object",
                "description": "What the Lake's engine uses: Bucket prefixes, and the ConfigMaps and Secrets of its environment."
              },
              "buckets": {
                "description": "The Buckets that a Lake applied on its own declares: by name the Lake creates the Bucket, an omitted prefix owner being the Lake, and a Bucket of that name that is not the Lake's holds it in Pending with StoreNotOwned; by ref it binds an existing one. Each Bucket that the Lake's bindings.blob names must be declared here. A lake that another resource declares sets none.",
                "items": {
                  "additionalProperties": false,
                  "properties": {
                    "deletion": {
                      "description": "retain (the default) keeps the store and its data when the resource that declares it is deleted, and delete removes them. An App applies the same choice when it drops the entry.",
                      "enum": [
                        "retain",
                        "delete"
                      ],
                      "type": "string"
                    },
                    "name": {
                      "description": "The object's name. It takes the namespace and resource group of the resource that declares it.",
                      "maxLength": 63,
                      "minLength": 1,
                      "pattern": "^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$",
                      "type": "string"
                    },
                    "prefixes": {
                      "description": "The Bucket's prefixes, each a key space with its own owner and cap. Prefix names are unique within the Bucket. A Function or a Lake that binds a prefix the Bucket does not list waits, with the reason BucketNotFound.",
                      "items": {
                        "additionalProperties": false,
                        "properties": {
                          "name": {
                            "description": "The prefix's name, unique within the Bucket. Over S3, it is the first segment of each object's key.",
                            "pattern": "^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$",
                            "type": "string"
                          },
                          "owner": {
                            "additionalProperties": false,
                            "properties": {
                              "kind": {
                                "description": "The workload's kind. A Function, a Lake and a Job may share a name, so the kind says which one it is; each field names the kinds it accepts.",
                                "enum": [
                                  "Function",
                                  "Lake",
                                  "Job"
                                ],
                                "type": "string"
                              },
                              "name": {
                                "description": "The workload's name, in the object's namespace.",
                                "maxLength": 63,
                                "minLength": 1,
                                "pattern": "^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$",
                                "type": "string"
                              }
                            },
                            "required": [
                              "kind",
                              "name"
                            ],
                            "type": "object",
                            "description": "The one Function, Lake or Job that may write the prefix, named with its kind, besides the writers that a RolesAssignment names. In a Bucket that a Function, a Lake or a Job declares by name, an omitted owner is that workload. In a Workflow's buckets, a Function owner names a step and a Lake owner a lake that the Workflow declares. The prefix that a Site serves its bundle from must have no owner, since the Site writes its builds there; the prefixes of a Site's ingress rules may have one."
                          },
                          "quota": {
                            "additionalProperties": false,
                            "properties": {
                              "maxBytes": {
                                "description": "The same cap as a number of bytes. Set maxSize or maxBytes, not both.",
                                "format": "int64",
                                "minimum": 0,
                                "type": "integer"
                              },
                              "maxSize": {
                                "description": "The cap on the total size held, above zero. Set maxSize or maxBytes, not both; neither means no cap. A write that would pass the cap gets 507 in a KV store or a Bucket; a SQL execute call gets 507 once the database holds the cap.",
                                "pattern": "^[0-9]{1,15}((Ki|Mi|Gi|Ti)B?)?$",
                                "patternDescription": "a size: 1 to 15 digits and an optional binary unit, Ki, Mi, Gi or Ti, with or without a B (512Ki, 2GiB)",
                                "type": "string"
                              }
                            },
                            "type": "object",
                            "description": "A cap on the prefix's total size: a write into the prefix must fit both this cap and the Bucket's, and while it is set funcd refuses to sign a presigned PUT URL into the prefix, with 403. It also caps a Lake's files under the prefix, though not the Lake's catalog."
                          }
                        },
                        "required": [
                          "name"
                        ],
                        "type": "object"
                      },
                      "type": [
                        "array",
                        "null"
                      ]
                    },
                    "quota": {
                      "additionalProperties": false,
                      "properties": {
                        "maxBytes": {
                          "description": "The same cap as a number of bytes. Set maxSize or maxBytes, not both.",
                          "format": "int64",
                          "minimum": 0,
                          "type": "integer"
                        },
                        "maxObjectBytes": {
                          "description": "The largest object a write may store, in bytes. A larger write gets 413, or EntityTooLarge over S3, and while it is set funcd refuses to sign a presigned PUT URL for the Bucket, with 403. 0 sets no cap of the Bucket's own, so only funcd's upload limits apply, such as s3gateway.maxUploadBytes.",
                          "format": "int64",
                          "minimum": 0,
                          "type": "integer"
                        },
                        "maxSize": {
                          "description": "The cap on the total size held, above zero. Set maxSize or maxBytes, not both; neither means no cap. A write that would pass the cap gets 507 in a KV store or a Bucket; a SQL execute call gets 507 once the database holds the cap.",
                          "pattern": "^[0-9]{1,15}((Ki|Mi|Gi|Ti)B?)?$",
                          "patternDescription": "a size: 1 to 15 digits and an optional binary unit, Ki, Mi, Gi or Ti, with or without a B (512Ki, 2GiB)",
                          "type": "string"
                        }
                      },
                      "type": "object",
                      "description": "Caps on the Bucket's total size and on each object. While the Bucket has a size cap, funcd refuses to sign a presigned PUT URL for it, with 403."
                    },
                    "ref": {
                      "description": "The name of an existing object of this kind in the namespace of the resource that declares it. A ref entry sets no other field.",
                      "maxLength": 63,
                      "minLength": 1,
                      "pattern": "^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$",
                      "type": "string"
                    }
                  },
                  "type": "object"
                },
                "type": [
                  "array",
                  "null"
                ]
              },
              "configMaps": {
                "description": "The ConfigMaps that a Lake applied on its own declares: by name the Lake defines one, and a ConfigMap of its stored name that is not the Lake's holds it in Pending with StoreNotOwned; by ref it binds an existing one. Each ConfigMap that the Lake's bindings.config names must be declared here. A lake that another resource declares sets none.",
                "items": {
                  "additionalProperties": false,
                  "properties": {
                    "data": {
                      "additionalProperties": {
                        "type": "string"
                      },
                      "description": "Keys and their string values, for settings that are not secret. Each key is an environment variable name: ASCII letters, digits and _, not starting with a digit. Each value must be UTF-8 text with no NUL byte: a Function or a Lake that binds a ConfigMap holding another value does not start. Each worker of a Function that lists the ConfigMap in bindings.config gets each key as an environment variable when it starts, except a key that starts with FUNCD_ or that a bound Secret also holds; and while the S3 gateway is on, a Function that binds a Bucket gets the AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY that funcd issues it, in place of the ConfigMap's. A Lake that lists it gives its engine only the keys that the Lake's bindings.config lets through.",
                      "type": "object"
                    },
                    "name": {
                      "description": "The ConfigMap's name, at most 52 characters. It is stored as <name>-<hash of data>, and the config of each part that names it is set to that stored name.",
                      "maxLength": 63,
                      "minLength": 1,
                      "pattern": "^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$",
                      "type": "string"
                    },
                    "ref": {
                      "description": "The name of an existing object of this kind in the namespace of the resource that declares it. A ref entry sets no other field.",
                      "maxLength": 63,
                      "minLength": 1,
                      "pattern": "^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$",
                      "type": "string"
                    }
                  },
                  "type": "object"
                },
                "type": [
                  "array",
                  "null"
                ]
              },
              "ingress": {
                "additionalProperties": false,
                "properties": {
                  "auth": {
                    "additionalProperties": false,
                    "properties": {
                      "mode": {
                        "description": "How the edge checks callers. authenticated requires a bearer token, or an X-Api-Key header, of an identity that RBAC lets get Functions in the namespace: 401 without a valid one, 403 when it may not; while server.auth.edge is off, every caller gets 401. open lets anonymous callers in. oidc signs callers in with the OIDCProvider that provider names, and passes the signed-in user to the code behind it in the X-Funcd-Principal headers. Empty takes the enclosing stance, if any, else the namespace's spec.edgeDefaults.auth.mode, else open.",
                        "enum": [
                          "",
                          "authenticated",
                          "open",
                          "oidc"
                        ],
                        "type": "string"
                      },
                      "provider": {
                        "description": "With mode oidc, the OIDCProvider of the namespace that signs callers in; required with oidc and refused with another mode.",
                        "maxLength": 63,
                        "minLength": 1,
                        "pattern": "^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$",
                        "type": "string"
                      },
                      "unauthenticated": {
                        "description": "With mode oidc, what a call that is not signed in gets: redirect, the default, sends a GET or HEAD navigation to the provider with 302 and gives any other call 401; 401 gives every such call 401; allow passes every call, with no principal. Refused with another mode.",
                        "enum": [
                          "",
                          "redirect",
                          "401",
                          "allow"
                        ],
                        "type": "string"
                      }
                    },
                    "type": "object",
                    "description": "How the edge checks callers at the resource's own address; unset, the namespace's spec.edgeDefaults.auth decides, else open. A Lake refuses it, since the Lake gateway checks each caller."
                  },
                  "enabled": {
                    "description": "Turns the resource's own address on or off. Unset, it is on unless the namespace's spec.defaultExposure is explicit; a Lake's address is on only when this is true.",
                    "type": "boolean"
                  },
                  "host": {
                    "description": "The exact host of the resource's own address. Empty is the namespace's host, <namespace>.<server.baseDomain>, or, in the default namespace, any host that no other namespace reserves.",
                    "type": "string"
                  },
                  "path": {
                    "description": "The edge path of the resource's own address, which begins with / and does not end with / unless it is /. Empty is / when host is set, else /function/<name>, /site/<name> or /lake/<name> by kind.",
                    "type": "string"
                  }
                },
                "type": "object",
                "description": "Exposes the Lake gateway at the edge, only when enabled is true and while the Lake is Ready. The path defaults to /lake/<name>, or / with a host. Setting auth is refused, since the Lake gateway checks each caller itself."
              },
              "location": {
                "additionalProperties": false,
                "properties": {
                  "bucket": {
                    "description": "A Bucket of the same namespace.",
                    "maxLength": 63,
                    "minLength": 1,
                    "pattern": "^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$",
                    "type": "string"
                  },
                  "prefix": {
                    "description": "A prefix of that Bucket.",
                    "pattern": "^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$",
                    "type": "string"
                  }
                },
                "required": [
                  "bucket",
                  "prefix"
                ],
                "type": "object",
                "description": "The Bucket prefix that holds the Lake's files, one of the Lake's bindings.blob. The Lake waits in Pending, with the reason PrefixNotOwned, until the prefix's owner is this Lake. The Lake's catalog is kept outside the Bucket, under the same location, so a Lake located where another was finds that Lake's files and catalog."
              },
              "name": {
                "description": "The object's name. It takes the namespace and resource group of the resource that declares it.",
                "maxLength": 63,
                "minLength": 1,
                "pattern": "^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$",
                "type": "string"
              },
              "ref": {
                "description": "The name of an existing object of this kind in the namespace of the resource that declares it. A ref entry sets no other field.",
                "maxLength": 63,
                "minLength": 1,
                "pattern": "^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$",
                "type": "string"
              },
              "resources": {
                "additionalProperties": false,
                "properties": {
                  "cpu": {
                    "description": "The CPU cap of the worker or engine it sizes, as a number of cores of at least 0.01, such as 0.5 or 2. Empty takes the default of the resource that declares it, or no cap when there is none. Only the containerd runtime enforces it.",
                    "type": "string"
                  },
                  "memory": {
                    "description": "The memory cap of the worker or engine it sizes, such as 256Mi or 4GiB: 1 to 15 digits and an optional binary unit, Ki, Mi, Gi or Ti, with or without a B, above zero. Empty takes the default of the resource that declares it, or no cap when there is none. Only the containerd runtime enforces it, and there a worker that uses more memory than the cap is killed.",
                    "type": "string"
                  }
                },
                "type": "object",
                "description": "The cpu and memory of the Lake's engine. An empty cpu or memory sets no limit on it, and a change replaces the running engine."
              },
              "secrets": {
                "description": "The Secrets that a Lake applied on its own declares, with the keys its engine reads. Each Secret that the Lake's bindings.secret names must be declared here, and the Lake waits in Pending, with SecretNotFound or SecretKeyMissing, while one is missing or lacks a key. A lake that another resource declares sets none.",
                "items": {
                  "additionalProperties": false,
                  "properties": {
                    "description": {
                      "description": "What the Secret is for, for the installer who provides it.",
                      "type": "string"
                    },
                    "keys": {
                      "description": "The keys read from the Secret: its data must hold each of them.",
                      "items": {
                        "pattern": "^[A-Za-z_][A-Za-z0-9_]*$",
                        "type": "string"
                      },
                      "minItems": 1,
                      "type": "array"
                    },
                    "name": {
                      "description": "The name of a Secret in the namespace of the resource that declares it. funcd holds its value; the resource never writes it.",
                      "maxLength": 63,
                      "minLength": 1,
                      "pattern": "^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$",
                      "type": "string"
                    }
                  },
                  "required": [
                    "name",
                    "keys"
                  ],
                  "type": "object"
                },
                "type": [
                  "array",
                  "null"
                ]
              }
            },
            "type": "object"
          },
          "type": [
            "array",
            "null"
          ]
        },
        "resources": {
          "additionalProperties": false,
          "properties": {
            "cpu": {
              "description": "The CPU cap of the worker or engine it sizes, as a number of cores of at least 0.01, such as 0.5 or 2. Empty takes the default of the resource that declares it, or no cap when there is none. Only the containerd runtime enforces it.",
              "type": "string"
            },
            "memory": {
              "description": "The memory cap of the worker or engine it sizes, such as 256Mi or 4GiB: 1 to 15 digits and an optional binary unit, Ki, Mi, Gi or Ti, with or without a B, above zero. Empty takes the default of the resource that declares it, or no cap when there is none. Only the containerd runtime enforces it, and there a worker that uses more memory than the cap is killed.",
              "type": "string"
            }
          },
          "type": "object",
          "description": "The CPU and memory caps of each run's worker; a field left empty takes functions.defaultResources. Only the containerd runtime enforces them."
        },
        "runtime": {
          "description": "The runtime that runs the code, such as nodejs22 or python314, or one that an Addon ships for Jobs. A Job without one is not Ready, with ShapeInvalid, and one whose runtime this node cannot run is not Ready, with RuntimeUnavailable.",
          "maxLength": 63,
          "minLength": 1,
          "pattern": "^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$",
          "type": "string"
        },
        "secrets": {
          "description": "The Secrets of the namespace that the bindings may name, each with the keys the code reads; spec.bindings.secret names only a declared Secret. The Job waits in Pending, with SecretNotFound or SecretKeyMissing, until each one exists with every declared key.",
          "items": {
            "additionalProperties": false,
            "properties": {
              "description": {
                "description": "What the Secret is for, for the installer who provides it.",
                "type": "string"
              },
              "keys": {
                "description": "The keys read from the Secret: its data must hold each of them.",
                "items": {
                  "pattern": "^[A-Za-z_][A-Za-z0-9_]*$",
                  "type": "string"
                },
                "minItems": 1,
                "type": "array"
              },
              "name": {
                "description": "The name of a Secret in the namespace of the resource that declares it. funcd holds its value; the resource never writes it.",
                "maxLength": 63,
                "minLength": 1,
                "pattern": "^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$",
                "type": "string"
              }
            },
            "required": [
              "name",
              "keys"
            ],
            "type": "object"
          },
          "type": [
            "array",
            "null"
          ]
        },
        "sql": {
          "description": "The SQLDatabases the Job declares: by name it creates and owns one, and a database of that name that it does not own holds it in Pending with StoreNotOwned; by ref it uses an existing one. spec.bindings.sql binds only a declared database.",
          "items": {
            "additionalProperties": false,
            "properties": {
              "deletion": {
                "description": "retain (the default) keeps the store and its data when the resource that declares it is deleted, and delete removes them. An App applies the same choice when it drops the entry.",
                "enum": [
                  "retain",
                  "delete"
                ],
                "type": "string"
              },
              "name": {
                "description": "The object's name. It takes the namespace and resource group of the resource that declares it.",
                "maxLength": 63,
                "minLength": 1,
                "pattern": "^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$",
                "type": "string"
              },
              "owner": {
                "additionalProperties": false,
                "properties": {
                  "kind": {
                    "description": "The workload's kind. A Function, a Lake and a Job may share a name, so the kind says which one it is; each field names the kinds it accepts.",
                    "enum": [
                      "Function",
                      "Lake",
                      "Job"
                    ],
                    "type": "string"
                  },
                  "name": {
                    "description": "The workload's name, in the object's namespace.",
                    "maxLength": 63,
                    "minLength": 1,
                    "pattern": "^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$",
                    "type": "string"
                  }
                },
                "required": [
                  "kind",
                  "name"
                ],
                "type": "object",
                "description": "The one Function, Lake or Job that may write the database, in its namespace, named with its kind, besides the writers that a RolesAssignment names. In a database that a Function or a Job declares by name, it defaults to that workload, and in a Workflow's sql a Function owner names a step and a Lake owner a lake that the Workflow declares. A Lake writes no SQL, so a database a Lake owns is written by those writers only. With no owner, only those writers can write it."
              },
              "quota": {
                "additionalProperties": false,
                "properties": {
                  "maxBytes": {
                    "description": "The same cap as a number of bytes. Set maxSize or maxBytes, not both.",
                    "format": "int64",
                    "minimum": 0,
                    "type": "integer"
                  },
                  "maxSize": {
                    "description": "The cap on the total size held, above zero. Set maxSize or maxBytes, not both; neither means no cap. A write that would pass the cap gets 507 in a KV store or a Bucket; a SQL execute call gets 507 once the database holds the cap.",
                    "pattern": "^[0-9]{1,15}((Ki|Mi|Gi|Ti)B?)?$",
                    "patternDescription": "a size: 1 to 15 digits and an optional binary unit, Ki, Mi, Gi or Ti, with or without a B (512Ki, 2GiB)",
                    "type": "string"
                  }
                },
                "type": "object",
                "description": "A cap on the database's total size, the bytes of its pages in use. Once it is reached, an execute gets 507 unless each of its statements is a DELETE or a DROP. A change keeps the engine running."
              },
              "ref": {
                "description": "The name of an existing object of this kind in the namespace of the resource that declares it. A ref entry sets no other field.",
                "maxLength": 63,
                "minLength": 1,
                "pattern": "^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$",
                "type": "string"
              },
              "resources": {
                "additionalProperties": false,
                "properties": {
                  "cpu": {
                    "description": "The CPU cap of the worker or engine it sizes, as a number of cores of at least 0.01, such as 0.5 or 2. Empty takes the default of the resource that declares it, or no cap when there is none. Only the containerd runtime enforces it.",
                    "type": "string"
                  },
                  "memory": {
                    "description": "The memory cap of the worker or engine it sizes, such as 256Mi or 4GiB: 1 to 15 digits and an optional binary unit, Ki, Mi, Gi or Ti, with or without a B, above zero. Empty takes the default of the resource that declares it, or no cap when there is none. Only the containerd runtime enforces it, and there a worker that uses more memory than the cap is killed.",
                    "type": "string"
                  }
                },
                "type": "object",
                "description": "The cpu and memory of the database's engine. An empty memory means 256Mi, and an empty cpu sets no cpu limit. A change replaces the running engine."
              }
            },
            "type": "object"
          },
          "type": [
            "array",
            "null"
          ]
        },
        "timeout": {
          "description": "The bound on each call of a run's handler, its preview's and its apply's, from its worker's start: 0s to 168h; 0s or unset means none. A run past it ends Failed with RunTimedOut, and its worker stops.",
          "pattern": "^([0-9]+h([0-9]+m)?([0-9]+s)?([0-9]+ms)?|[0-9]+m([0-9]+s)?([0-9]+ms)?|[0-9]+s([0-9]+ms)?|[0-9]+ms)$",
          "patternDescription": "a duration: whole numbers with the units h, m, s and ms, largest unit first (10m, 1h30m, 500ms)",
          "type": "string"
        },
        "volumes": {
          "description": "The directories each run's worker mounts. Apply refuses a Job with one unless runtime.mode is containerd and volumes.capacity or volumes.capacityBytes is set. A local volume is the Job's own, never a same-named Function's, and allows a concurrency of at most 1.",
          "items": {
            "additionalProperties": false,
            "properties": {
              "deletion": {
                "description": "Only for a local volume declared by name: retain, the default, keeps the volume and its files with no owner when the Function drops it or is deleted, so that a ref can take it again; delete removes them.",
                "enum": [
                  "retain",
                  "delete"
                ],
                "type": "string"
              },
              "name": {
                "description": "The volume's name, unique in the list; set name or ref, not both. The code reads the directory's path from FUNCD_VOLUME_<NAME>, the name or ref upper-cased.",
                "maxLength": 63,
                "minLength": 1,
                "pattern": "^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$",
                "type": "string"
              },
              "ref": {
                "description": "Instead of name: a retained local volume that this Function, or an earlier Function of the same name, dropped with retain, and that the Function takes over; with no such volume, it waits in Pending with VolumeNotFound. Only a local volume takes a ref; it sets no deletion and states the retained volume's own size, since apply refuses another size.",
                "maxLength": 63,
                "minLength": 1,
                "pattern": "^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$",
                "type": "string"
              },
              "size": {
                "description": "The volume's size, the most its directory may hold, above zero; set size or sizeBytes, not both. Apply refuses a local volume whose size changes, or that does not fit both the capacity that volumes.capacity or volumes.capacityBytes sets and the namespace's spec.volumeBudget.",
                "pattern": "^[0-9]{1,15}((Ki|Mi|Gi|Ti)B?)?$",
                "patternDescription": "a size: 1 to 15 digits and an optional binary unit, Ki, Mi, Gi or Ti, with or without a B (512Ki, 2GiB)",
                "type": "string"
              },
              "sizeBytes": {
                "description": "The same size as a number of bytes. Set size or sizeBytes, not both.",
                "format": "int64",
                "minimum": 1,
                "type": "integer"
              },
              "type": {
                "description": "emptyDir is a new empty directory for each worker, removed with it; local is one durable directory that keeps its files through a crash, a redeploy and a scale to zero. A Function with a local volume runs at most 1 replica, and while it redeploys, its old and new workers hold the volume at once.",
                "enum": [
                  "emptyDir",
                  "local"
                ],
                "type": "string"
              }
            },
            "required": [
              "type"
            ],
            "type": "object"
          },
          "type": [
            "array",
            "null"
          ]
        }
      },
      "type": "object"
    },
    "status": {
      "additionalProperties": false,
      "properties": {
        "conditions": {
          "description": "The conditions that explain the phase.",
          "items": {
            "additionalProperties": false,
            "properties": {
              "lastTransitionTime": {
                "description": "When the status last changed.",
                "format": "date-time",
                "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{3}Z$",
                "patternDescription": "an RFC3339 UTC timestamp with exactly 3 fractional digits (2026-10-07T20:03:35.965Z)",
                "type": "string"
              },
              "message": {
                "description": "A sentence that explains the status.",
                "type": "string"
              },
              "observedGeneration": {
                "description": "The object's generation when funcd set the condition.",
                "format": "int64",
                "type": "integer"
              },
              "reason": {
                "description": "A short CamelCase reason for the status.",
                "type": "string"
              },
              "status": {
                "description": "Whether the condition holds.",
                "type": "string"
              },
              "type": {
                "description": "What the condition reports, such as Ready.",
                "type": "string"
              }
            },
            "required": [
              "type",
              "status"
            ],
            "type": "object"
          },
          "type": [
            "array",
            "null"
          ]
        },
        "contract": {
          "additionalProperties": false,
          "properties": {
            "dialect": {
              "description": "The URI of the JSON Schema dialect that input and output follow. funcd checks nothing against it.",
              "type": "string"
            },
            "input": {
              "description": "The JSON Schema of the input. A declared one must be an object, and each property it does not require must declare a default."
            },
            "output": {
              "description": "The JSON Schema of the output. A declared one must be an object, and each property it does not require must declare a default."
            }
          },
          "type": "object",
          "description": "The input and output schemas of the current Revision's image, read by its digest. A new run's input is checked against the input schema; an image with none holds the Job with ContractMissing."
        },
        "currentRevision": {
          "description": "The Revision of the latest spec, named <job>-v<generation>. A run pins the current one when it starts, and keeps it until it ends.",
          "maxLength": 63,
          "minLength": 1,
          "pattern": "^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$",
          "type": "string"
        },
        "observedGeneration": {
          "description": "The generation of the spec that funcd last acted on.",
          "format": "int64",
          "type": "integer"
        },
        "phase": {
          "description": "Where the object is in its lifecycle.",
          "enum": [
            "Pending",
            "Deploying",
            "Ready",
            "Idle",
            "Degraded",
            "Failed",
            "Terminating"
          ],
          "type": "string"
        }
      },
      "type": "object"
    }
  },
  "required": [
    "metadata",
    "spec",
    "apiVersion",
    "kind"
  ],
  "type": "object"
}
```

## Answers

| Status | Problem type | When | What to do |
| --- | --- | --- | --- |
| 200 |  | OK |  |
| 400 | `urn:funcd:problem:invalid` | A field breaks a rule that the schema cannot hold, which the detail names. | Correct the field that the detail names. |
| 400 | `urn:funcd:problem:invalid` | The body's metadata.namespace is not the namespace of the path. | Send the object to the path of its own namespace. |
| 400 | `about:blank` | The body is missing or is not JSON. | Send a JSON body. |
| 400 | `urn:funcd:problem:invalid` | A link in spec.bindings.links names a Function that does not exist in the namespace. | Apply the target Function first. |
| 400 | `urn:funcd:problem:invalid` | A binding names a store, a Lake, a ConfigMap or a Secret that the spec does not declare, such as a KVStore missing from spec.kv. | Declare it in the spec, or bind one that it declares. |
| 400 | `urn:funcd:problem:invalid` | The spec sets spec.volumes, and volumes are off on this daemon. | Remove spec.volumes, or ask the operator to turn volumes on. |
| 400 | `urn:funcd:problem:invalid` | A local volume's size differs from the size it was applied with: a volume is not resized. | Keep the volume's size. A new size needs a new volume, under another name. |
| 401 | `urn:funcd:problem:unauthorized` | The request carries no bearer token or API key, or one that funcd does not know. | Send a credential of funcd's config as a bearer token in the Authorization header, or in X-Api-Key. |
| 403 | `urn:funcd:problem:forbidden` | The credential's role or namespaces do not allow it to create a Job in the namespace. | Use a credential whose role allows it, such as a developer of the namespace or an admin. |
| 409 | `urn:funcd:problem:conflict` | A Job of that name already exists in the namespace. | Choose another name, or replace the existing Job. |
| 409 | `urn:funcd:problem:conflict` | A local volume does not fit in the capacity that volumes.capacity sets, with the volumes reserved already. | Delete the volumes that are no longer needed, or ask the operator to raise volumes.capacity. |
| 409 | `urn:funcd:problem:conflict` | A local volume does not fit in the namespace's spec.volumeBudget, with the namespace's other volumes. | Delete the namespace's volumes that are no longer needed, or ask an admin to raise its spec.volumeBudget. |
| 413 | `urn:funcd:problem:payload-too-large` | The body is larger than 1 MiB. | Send a smaller body. |
| 415 | `about:blank` | The Content-Type of the body is not JSON. | Send the body as application/json. |
| 422 | `about:blank` | The query holds a parameter that the operation does not take. | Send only the parameters that the operation lists. |
| 422 | `about:blank` | The dryRun parameter is neither true nor false. | Send dryRun=true, or leave it out. |
| 422 | `about:blank` | The namespace in the path is not a DNS-1123 label. | Use at most 63 lowercase letters, digits and hyphens, starting and ending with a letter or a digit. |
| 422 | `about:blank` | The body breaks the schema: a field that it does not know, of the wrong type or past its limits. | Correct the field at the location that the detail gives. |