---
title: "Create Function"
method: POST
path: "/api/v1/functions"
tags: ["Function"]
---

# Create Function

`POST /api/v1/functions`

Invokes the c1.api.functions.v1.FunctionsService.CreateFunction method.

## Request body

- C1ApiFunctionsV1FunctionsServiceCreateFunctionRequest — The FunctionsServiceCreateFunctionRequest message.
  - `commitMessage` string — The commitMessage field.
  - `description` string — The description field.
  - `displayName` string — The displayName field.
  - `functionType` 'FUNCTION_TYPE_UNSPECIFIED' | 'FUNCTION_TYPE_ANY' — The functionType field.
  - `initialContent` object — The initialContent field.

## Response `200`

Successful response

- C1ApiFunctionsV1FunctionsServiceCreateFunctionResponse — The FunctionsServiceCreateFunctionResponse message.
  - `commit` C1ApiFunctionsV1FunctionCommit — FunctionCommit represents a single commit in a function's history
    - `author` string — The author field.
    - `createdAt` string, date-time
    - `functionId` string — The functionId field.
    - `id` string — The id field.
    - `message` string — The message field.
  - `function` C1ApiFunctionsV1Function — Function represents a customer-provided code extension in the API
    - `createdAt` string, date-time
    - `deletedAt` string, date-time
    - `description` string — The description field.
    - `displayName` string — The displayName field.
    - `functionType` 'FUNCTION_TYPE_UNSPECIFIED' | 'FUNCTION_TYPE_ANY' — The functionType field.
    - `head` string — The head field.
    - `id` string — The id field.
    - `isDraft` boolean — The isDraft field.
    - `outboundNetworkAllowlist` string[], nullable — The outboundNetworkAllowlist field.
    - `publishedCommitId` string — The publishedCommitId field.
    - `scopedRoleIds` string[], nullable — Scoped role IDs define the permissions granted to this function when calling ConductorOne APIs. These are role IDs (not service roles) that get resolved to their service roles at authentication time. Currently only the "Read-Only Administrator" role (system:viewer) is supported. The role ID can be obtained from the roles API.
    - `secret` object — The secret field.
    - `updatedAt` string, date-time

## Changes

- **2026-02-05** `417c5bf9b0a2` — 1 warning, 2 info
  - removed the optional property `function/encryptedValues` from the response with the `200` status
  - added the optional property `function/scopedRoleIds` to the response with the `200` status
  - added the optional property `function/secret` to the response with the `200` status
- **2025-12-05** `db31ee81cba5` — 2 info
  - added the optional property `function/encryptedValues` to the response with the `200` status
  - added the optional property `function/outboundNetworkAllowlist` to the response with the `200` status
- **2025-08-20** `182cb087dfa4` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/conductorone/apis/c1-api/changes/api/v1/functions/post.md)

---

[API](https://skmtc.dev/conductorone/apis/c1-api.md) · [All operations](https://skmtc.dev/conductorone/apis/c1-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/conductorone/c1-api/revisions/7fa698b04b81/schema)
