---
title: "Create a New Function"
method: POST
path: "/v1/functions"
tags: ["Functions"]
---

# Create a New Function

`POST /v1/functions`

You may create your own functions using this action. It takes a JSON object containing a function request. Once function is created, you can  assign it based on its ID to bucket's input and/or output.

## Request body

- FunctionRequest
  - `name` string
  - `payload` string — base64 encoded function payload
  - `driver` string — Driver name (Lua, WASI)

## Response `201`

Created

- Function
  - `id` string
  - `created` integer
  - `updated` integer
  - `name` string
  - `payload` string — base64 encoded function body
  - `payload_size` integer
  - `compression` string
  - `metadata` object

## Other responses

- `400` — Invalid function request supplied

---

[API](https://skmtc.dev/webhookrelay/apis/webhook-relay.md) · [All operations](https://skmtc.dev/webhookrelay/apis/webhook-relay/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/webhookrelay/webhook-relay/revisions/ce8fd4d3cf19/schema)
