# Create a new function

> Create a new function.

POST

/functions/

Creates a function and returns its ID and details.

#### Helpful resources

-   [Get started with functions](https://developer.rippling.com/documentation/rippling-platform/developer/functions/getting-started)
-   [Create and manage functions](https://developer.rippling.com/documentation/rest-api/guides/functions)

### Required Scopes

-   functions.read-write
    

### Request

-   application/json

**Body**

**name** string

The function name

**api\_name** string

The API name of the function

**description** string

The function description

**code\_draft** string

The current draft of code for the function. Null when the function comes from a managed package install.

**dependencies** object

The dependencies of the function. Null when the function comes from a managed package install.

**is\_async** boolean

Whether this function runs asynchronously

**listed\_in\_custom\_apps** boolean

Whether this request-function is listed in the Custom Apps grid and navigation. Defaults to false on creation; omitted updates preserve the current value. Listing does not grant access or change deployment behavior. Only supported for request functions. Setting this field on an event function returns a validation error.

**type** string

Function type at creation. Defaults to event and cannot be changed afterward.

**Possible values:** \[event,request\]

**source\_upload** object

Optional source ZIP checksum and size for request functions only. Create or update returns ephemeral source\_upload\_instructions; this input is not returned.

**sha256** string required

SHA-256 of the exact ZIP bytes, written as 64 lowercase hexadecimal characters.

**size\_bytes** integer required

Exact ZIP size in bytes, from 1 through 67108864 (64 MiB).

## Responses

-   200
-   400
-   401
-   403

Successful response

-   application/json

-   Schema
-   Example (from schema)

**Schema**

**\_\_meta** object

**redacted\_fields** object\[\]

Array \[

**name** string

The name for the redacted field

**reason** string

The reason for the redaction

\]

**id** string required

Identifier field

**created\_at** string required

Record creation date

**updated\_at** string required

Record update date

**name** string

The function name

**api\_name** string

The API name of the function

**description** string

The function description

**code\_draft** string

The current draft of code for the function. Null when the function comes from a managed package install.

**dependencies** object

The dependencies of the function. Null when the function comes from a managed package install.

**is\_async** boolean

Whether this function runs asynchronously

**listed\_in\_custom\_apps** boolean

Whether this request-function is listed in the Custom Apps grid and navigation. Defaults to false on creation; omitted updates preserve the current value. Listing does not grant access or change deployment behavior. Only supported for request functions. Setting this field on an event function returns a validation error.

**source\_upload\_instructions** object

Upload instructions returned only when source\_upload was requested on create or update.

**url** string required

Upload the ZIP directly to this URL, not through the Functions API.

**method** string required

HTTP method for the client-direct upload.

**Possible values:** \[POST\]

**fields** object required

Include every opaque signed field unchanged in the multipart/form-data POST, plus the ZIP file.

**property name\*** string

**expires\_at** string required

UTC expiration of the upload instructions, in RFC3339/ISO8601 format.

**archive** object required

Archive reference for a subsequent deployment after the upload succeeds.

**object\_key** string required

Tenant-scoped object key to use as the archive reference in the explicit deployment JSON.

**sha256** string required

SHA-256 of the ZIP bytes.

**size\_bytes** integer required

Exact ZIP size in bytes, returned as a JSON integer.

```json
{
  "__meta": {
    "redacted_fields": [
      {
        "name": "date_of_birth",
        "reason": "Insufficient entitlements"
      }
    ]
  },
  "id": "string",
  "created_at": "string",
  "updated_at": "string",
  "name": "string",
  "api_name": "string",
  "description": "string",
  "code_draft": "string",
  "dependencies": {},
  "is_async": false,
  "listed_in_custom_apps": false,
  "source_upload_instructions": {
    "url": "string",
    "method": "POST",
    "fields": {
      "property name": "string"
    },
    "expires_at": "string",
    "archive": {
      "object_key": "string",
      "sha256": "string",
      "size_bytes": 0
    }
  }
}
```

The request failed validation. The response body describes the error.

-   application/json

-   Schema
-   Example (from schema)

**Schema**

**detail** string

A human-readable explanation of why the request failed.

```json
{
  "detail": "string"
}
```

Authentication is required or the supplied credentials are invalid.

-   application/json

-   Schema
-   Example (from schema)

**Schema**

-   Matches one or more of these formats:
    
    1.  **Format 1**
        
        **ok** boolean required
        
        Whether the request succeeded. Always false for an authentication error.
        
        **Possible values:** \[false\]
        
        **error** string required
        
        A human-readable explanation of why authentication failed.
        
    2.  **Format 2**
        
        **detail** string required
        
        A human-readable explanation of the authentication error.
        

**Format 1**

```json
{
  "ok": false,
  "error": "Incorrect authentication credentials."
}
```

**Format 2**

```json
{
  "detail": "string"
}
```

The caller is not authorized to perform this action.

-   application/json

-   Schema
-   Example (from schema)

**Schema**

**detail** string

A human-readable explanation of why the request failed.

```json
{
  "detail": "string"
}
```

Source: https://developer.rippling.com/documentation/rest-api/reference/create-functions

> For the complete documentation index, see [llms.txt](https://developer.rippling.com/llms.txt). Public pages have a Markdown version at the same URL with .md added.
