---
title: "Create the edge worker metadata."
method: POST
path: "/_fabric/{fabric}/_api/function/metadata"
tags: ["Function"]
---

# Create the edge worker metadata.

`POST /_fabric/{fabric}/_api/function/metadata`

## Request

- The document declares no server URL.
- Auth: one of:
  - API key in header `Authorization`
  - HTTP bearer
- TypeScript: <https://skmtc.dev/macrometa/apis/macrometa-api-reference/docs/_fabric/:fabric/_api/function/metadata/post.ts> (a function with typed inputs; its response is checked against the schema)

Create the edge worker metadata.

## Path parameters

- `fabric` string, string, required

## Request body

- FunctionWorkerMetadata
  - `type` 'akamai' | 'macrometa', required: Type of the edge function.
  - `accessToken` string, required: Akamai access token.
  - `baseUri` string, required: Host name of the Akamai edge worker.
  - `clientSecret` string, required: Akamai client secret.
  - `clientToken` string, required: Akamai client token.
  - `resourceTierId` string, required: Resource tier identifier.
  - `groupId` string, required: Group identifier.
  - `hostName` string, required: Edge function hostname.

## Response `201`

Successfully created the edge worker metadata.

- SetFunctionMetadataExampleRc201
  - `code` integer: HTTP response code.
  - `error` boolean: Flag if there is an error in response. *False* for this response.
  - `result` boolean: Flag for if the metadata for edge function is set successfully.

## Other responses

- `400`: Failed due to missing or malformed data. Verify that all parameters are complete.
- `401`: Failed because you do not have administrator permissions.
- `403`: Failed to validate because you do not have access to the server.
- `404`: Failed to find specified fabric.

---

[API](https://skmtc.dev/macrometa/apis/macrometa-api-reference.md) - [All operations](https://skmtc.dev/macrometa/apis/macrometa-api-reference/llms.txt) - [OpenAPI document](https://skmtc.dev/macrometa/apis/macrometa-api-reference/revisions/2006b6d7f31d?raw)
