# Create and manage functions

> Create and manage functions, deployments, and executions in Rippling using the Functions API.

Create and manage functions, deployments, and executions in Rippling using the Functions API.

## Overview

The Functions API allows you to create, manage, and update Rippling Functions. These are the same functions you can build by navigating to **Tools** > **Developer** > **Functions** in Rippling.

_Key terms:_

-   **Function**: TypeScript code written by you, but saved, deployed, versioned, and run in an isolated environment managed by Rippling. Functions are useful when you want to perform multiple actions to streamline a process, especially when you want to leverage data stored in your Rippling account.
-   **Function deployment**: The process of taking a function’s draft code and publishing it as a runnable version, making it active so it can be executed. Deployments also create version history and allow verification through status checks and logs.
-   **Function dev bundle**: A packaged version of a function’s code and dependencies, prepared for deployment so it can run reliably in Rippling’s managed execution environment.
-   **Function execution**: The act of running a deployed Rippling Function with specific inputs, typically triggered via API, automations, or the UI, and producing outputs and logs that can be monitored for debugging or auditing. Ensure that execution access to the function has been selected within the API token.

### Available endpoints

| Endpoint | Description |
| --- | --- |
| [GET List functions](https://developer.rippling.com/documentation/rest-api/reference/list-functions) | Lists functions. Use `api_name` as `function_api_name` on following API calls. |
| [POST Create a new function](https://developer.rippling.com/documentation/rest-api/reference/create-functions) | Creates a function. Keep the returned `api_name`. Set `is_async` when the function should run asynchronously. |
| [GET Retrieve a specific function](https://developer.rippling.com/documentation/rest-api/reference/get-functions) | Returns a function by `function_api_name`, including `code_draft`. |
| [PATCH Update a function](https://developer.rippling.com/documentation/rest-api/reference/update-functions) | Updates a function by `function_api_name`. Send `code_draft` to change the draft. |
| [POST Create a new function dev bundle](https://developer.rippling.com/documentation/rest-api/reference/create-functions-function-api-name-dev-bundles) | Packages code and dependencies for a function by `function_api_name`. Optional. |
| [GET List function deployments](https://developer.rippling.com/documentation/rest-api/reference/list-functions-function-api-name-deployments) | Lists deployments for a function. Use `id` as `deployment_id`. |
| [POST Create a new function deployment](https://developer.rippling.com/documentation/rest-api/reference/create-functions-function-api-name-deployments) | Deploys the current draft by `function_api_name`. Draft updates do not affect executions until this succeeds. Keep the returned `id`. |
| [GET Retrieve a specific function deployment](https://developer.rippling.com/documentation/rest-api/reference/get-functions-function-api-name-deployments) | Returns a deployment by `function_api_name` and `deployment_id`. Check `status`. |
| [GET List function deployment logs](https://developer.rippling.com/documentation/rest-api/reference/list-functions-function-api-name-deployments-deployment-id-logs) | Lists logs for a deployment by `deployment_id`. |
| [GET List function executions](https://developer.rippling.com/documentation/rest-api/reference/list-functions-function-api-name-executions) | Lists executions for a function. Use `id` as `execution_id`. |
| [POST Create a new function execution](https://developer.rippling.com/documentation/rest-api/reference/create-functions-function-api-name-executions) | Runs the deployed function by `function_api_name`. `inputs` is required. Keep the returned `id`. |
| [GET Retrieve a specific function execution](https://developer.rippling.com/documentation/rest-api/reference/get-functions-function-api-name-executions) | Returns an execution by `function_api_name` and `execution_id`, including status and outputs. |
| [GET List function execution logs](https://developer.rippling.com/documentation/rest-api/reference/list-functions-function-api-name-executions-execution-id-logs) | Lists logs for an execution by `execution_id`. |

### Suggested workflow

1.  [List functions](https://developer.rippling.com/documentation/rest-api/reference/list-functions) or [create a function](https://developer.rippling.com/documentation/rest-api/reference/create-functions). Keep the `api_name` and use it as `function_api_name`.
2.  [Retrieve the function](https://developer.rippling.com/documentation/rest-api/reference/get-functions), then [update it](https://developer.rippling.com/documentation/rest-api/reference/update-functions) to set `code_draft` and any dependencies.
3.  Optionally [create a dev bundle](https://developer.rippling.com/documentation/rest-api/reference/create-functions-function-api-name-dev-bundles) to package the code and dependencies.
4.  [Create a deployment](https://developer.rippling.com/documentation/rest-api/reference/create-functions-function-api-name-deployments). Keep the deployment `id`. [Retrieve the deployment](https://developer.rippling.com/documentation/rest-api/reference/get-functions-function-api-name-deployments) or [list deployment logs](https://developer.rippling.com/documentation/rest-api/reference/list-functions-function-api-name-deployments-deployment-id-logs) to confirm it succeeded.
5.  [Create an execution](https://developer.rippling.com/documentation/rest-api/reference/create-functions-function-api-name-executions) with `inputs`. The token needs execution access to that function.
6.  [List executions](https://developer.rippling.com/documentation/rest-api/reference/list-functions-function-api-name-executions), [retrieve one](https://developer.rippling.com/documentation/rest-api/reference/get-functions-function-api-name-executions), or [list execution logs](https://developer.rippling.com/documentation/rest-api/reference/list-functions-function-api-name-executions-execution-id-logs) using the `execution_id` from the run.

* * *

## Requirements

-   A Rippling Pro subscription or higher. To gain access, work with your company’s Technical Account Manager or Account Manager.
-   An API token with the following scopes:
    -   `functions.read` or `functions.read-write` to list and retrieve functions, deployments, and execution logs
    -   `functions.read-write` to create, update, and deploy functions, and to create a dev bundle
    -   `function-executions.read` or `function-executions.read-write` to list and retrieve executions
    -   `function-executions.write` or `function-executions.read-write` to create an execution

The API token also needs **execution access** to the function before it can call the execution endpoints.

* * *

## Fetch

### Function

Use [GET List functions](https://developer.rippling.com/documentation/rest-api/reference/list-functions) to return a paginated list of all functions.

_Request:_

```json
curl -L -X GET 'https://rest.ripplingapis.com/functions/'
-H 'Accept: application/json'
-H 'Authorization: Bearer REDACTED'
```

_Response:_

```json
{
  "results": [
    {
      "id": "67af9fdd968c13ed38b352f2",
      "created_at": "2025-02-14T19:56:13.972000+00:00",
      "updated_at": "2025-12-18T23:25:07.197000+00:00",
      "name": "Test",
      "api_name": "test",
      "description": "",
      "code_draft": "{\n    \"object_api_name\": \"pet__c\",\n    \"record_ids\": [\"<object_id>\", \"<object_id>\"],\n    \"current_user\": \"<object_id>\",\n    \"app_id\": \"<object_id>\",\n    \"list_view_id\": \"<object_id>\",\n    \"page_id\": \"<object_id>\",\n    \"button\": \"my_cool_button\",\n    \"url\": \"https://app.rippling.com/custom-apps/objects/rto_expectation__c?app=rto_hub\", \n    \"trigger_type\": \"list view\",\n}",
      "dependencies": {}
    },
  ],
  "next_link": null
}
```

### Function deployment

Use [GET List function deployments](https://developer.rippling.com/documentation/rest-api/reference/list-functions-function-api-name-deployments) to return a list of function deployments.

_Request:_

```json
curl -L -X GET 'https://rest.ripplingapis.com/functions/class_signup/deployments/'
-H 'Accept: application/json'
-H 'Authorization: Bearer REDACTED'
```

_Response:_

```json
{
  "results": [
    {
      "id": "69448d5753afce0ea1f75a6d",
      "external_id": "019b33c8-1d00-7d5a-b608-f22298835a75",
      "function_id": "67af9fdd968c13ed38b352f2",
      "function_api_name": "test",
      "function_version_id": "69448d57b9e08e2ab6012550",
      "function_version_human_friendly_id": 1,
      "code": "{\n    \"object_api_name\": \"pet__c\",\n    \"record_ids\": [\"<object_id>\", \"<object_id>\"],\n    \"current_user\": \"<object_id>\",\n    \"app_id\": \"<object_id>\",\n    \"list_view_id\": \"<object_id>\",\n    \"page_id\": \"<object_id>\",\n    \"button\": \"my_cool_button\",\n    \"url\": \"https://app.rippling.com/custom-apps/objects/rto_expectation__c?app=rto_hub\", \n    \"trigger_type\": \"list view\",\n}",
      "dependencies": {},
      "allowed_domains": null,
      "runtime": "lambda-deno",
      "options": {},
      "status": "failed",
      "created_at": "2025-12-18T23:25:11.296000+00:00",
      "updated_at": "2025-12-18T23:25:13.918000+00:00"
    }
  ]
}
```

| Response field | Description |
| --- | --- |
| `results` | Array of deployments. |
| `results[].id` | The ID of the deployment. Use this as `deployment_id`. |
| `results[].external_id` | The external ID of the deployment. |
| `results[].function_id` | The ID of the function that this deployment is associated with. |
| `results[].function_api_name` | The API name of the function that this deployment is associated with. |
| `results[].function_version_id` | The ID of the version that this deployment is associated with. |
| `results[].function_version_human_friendly_id` | The human friendly ID of the version that this deployment is associated with. |
| `results[].code` | The code for the deployment. |
| `results[].dependencies` | The dependencies of the deployment. |
| `results[].allowed_domains` | Domains that function runs from this deployment are allowed to access. |
| `results[].runtime` | The runtime for the deployment. |
| `results[].options` | Additional, runtime-specific options for the deployment. |
| `results[].io_contract` | Input and output JSON Schema contracts for the deployment. |
| `results[].status` | The status of the deployment. |
| `results[].created_at` | The creation date of the deployment. |
| `results[].updated_at` | The last updated date of the deployment. |

### Function executions

Use [GET List function executions](https://developer.rippling.com/documentation/rest-api/reference/list-functions-function-api-name-executions) to return a list of executions for a function.

_Request:_

```json
curl -L -X GET 'https://rest.ripplingapis.com/functions/class_signup/executions/'
-H 'Accept: application/json'
-H 'Authorization: Bearer REDACTED'
```

_Response:_

```json
{
  "results": [
    {
      "id": "exe_01JX8Y4T8N6P3Q2R1S9A0B",
      "created_at": "2026-03-17T18:22:31.104000+00:00",
      "updated_at": "2026-03-17T18:22:33.219000+00:00",
      "function_id": "67af9fdd968c13ed38b352f2",
      "inputs": {
        "record_id": "co_record_123",
        "current_user": "worker_456"
      },
      "outputs": {
        "statusCode": 200,
        "body": {
          "signup_created": true
        },
        "message": "You successfully signed up!"
      },
      "status": "SUCCEEDED",
      "started_at": "2026-03-17T18:22:31.401000+00:00",
      "finished_at": "2026-03-17T18:22:33.201000+00:00"
    },
    {
      "id": "exe_01JX8Y3WQ9H2M7N4C5V6B7",
      "created_at": "2026-03-17T18:10:02.511000+00:00",
      "updated_at": "2026-03-17T18:10:03.040000+00:00",
      "function_id": "67af9fdd968c13ed38b352f2",
      "inputs": {
        "record_id": ""
      },
      "outputs": {
        "statusCode": 400,
        "body": {},
        "message": "Missing required parameter: record_id"
      },
      "status": "FAILED",
      "started_at": "2026-03-17T18:10:02.700000+00:00",
      "finished_at": "2026-03-17T18:10:03.021000+00:00"
    }
  ],
  "next_link": null
}
```

| Response field | Description |
| --- | --- |
| `results` | Array of executions. |
| `results[].id` | Identifier field. Use this as `execution_id`. |
| `results[].created_at` | Record creation date. |
| `results[].updated_at` | Record update date. |
| `results[].function_id` | The ID of the function this execution belongs to. |
| `results[].inputs` | The inputs of the execution. |
| `results[].outputs` | The outputs of the execution. |
| `results[].status` | The status of the execution. |
| `results[].started_at` | The start time of the execution. |
| `results[].finished_at` | The end time of the execution. |
| `next_link` | A link to the next page of responses. |

* * *

## Create

### Function

Use [POST Create a new function](https://developer.rippling.com/documentation/rest-api/reference/create-functions) to create a new function.

_Request:_

```json
curl -L -X POST 'https://rest.ripplingapis.com/functions/'
-H 'Accept: application/json'
-H 'Content-Type: application/json'
-H 'Authorization: Bearer REDACTED'
```

_Request body:_

```json
{
  "name": "Class signup",
  "api_name": "class_signup",
  "description": "Signups for class."
}
```

| Request body field | Required | Description |
| --- | --- | --- |
| `name` | No | The function name. |
| `api_name` | No | The API name of the function. |
| `description` | No | The function description. |
| `code_draft` | No | The current draft of code for the function. |
| `dependencies` | No | The dependencies of the function. |
| `is_async` | No | Whether this function runs asynchronously. |

_Response:_

```json
{
  "id": "69b9c99cf4d92de324fcf913",
  "created_at": "2026-03-17T21:37:32.953000+00:00",
  "updated_at": "2026-03-17T21:37:32.953000+00:00",
  "name": "Class signup",
  "api_name":"class_signup",
  "description": "Signups for class.",
  "code_draft": "import RipplingSDK, {\n  FunctionContext,\n  FunctionEvent,\n  FunctionResponse,\n} from \"@rippling/rippling-sdk\";\nimport _ from \"lodash\";\n\nexport async function onRipplingEvent(\n  event: FunctionEvent,\n  context: FunctionContext\n) {\n  // Initialize an instance of the Rippling SDK\n  const ripplingSDK = new RipplingSDK({ bearerToken: \"<YOUR_BEARER_TOKEN>\" });\n  //\n  // As an alternative to hard-coding the API token, you can store it in the\n  // Settings Manager and retrieve it using something like\n  // 'String(context.settings[\"<YOUR_TOKEN_SYSTEM_NAME>\"])'.\n\n  // Process inputs (stored in event)\n\n  // Return function response\n  return new FunctionResponse({\n    body: {},\n    statusCode: 200,\n    headers: {},\n    message: \"\",\n  });\n}",
  "dependencies": {
    "@rippling/rippling-sdk": "^0.2.0-alpha.26",
    "lodash": "^4.17.21",
    "moment": "^2.30.1"
  }
}
```

### Function deployment

Use [POST Create a new function deployment](https://developer.rippling.com/documentation/rest-api/reference/create-functions-function-api-name-deployments) to create a new deployment for a function.

_Request:_

```json
curl -L -X POST 'https://rest.ripplingapis.com/functions/class_signup/deployments/'
-H 'Accept: application/json'
-H 'Content-Type: application/json'
-H 'Authorization: Bearer REDACTED'
```

_Request body:_

```json
{
  "code": "import RipplingSDK from \"@rippling/rippling-sdk\";\n\nexport async function onRipplingEvent(event, context) {\n  console.log(\"event\", JSON.stringify(event));\n  return {\n    statusCode: 200,\n    body: { ok: true },\n    headers: {},\n    message: \"Deployment test succeeded\"\n  };\n}\n",
  "dependencies": {
    "@rippling/rippling-sdk": "^0.2.0-alpha.25",
    "lodash": "^4.17.21"
  },
  "allowed_domains": [
    "api.rippling.com",
    "api.example.com"
  ],
  "runtime": "lambda-deno"
}
```

| Request body field | Required | Description |
| --- | --- | --- |
| `code` | No | The code for the deployment. |
| `dependencies` | No | The dependencies of the deployment. |
| `allowed_domains` | No | Domains that function runs from this deployment are allowed to access. |
| `runtime` | No | The runtime for the deployment. |
| `options` | No | Additional, runtime-specific options for the deployment. |
| `io_contract` | No | Input and output JSON Schema contracts for the deployment. |

_Response:_

```json
{
  "id": "69badf2e833b1ef6413d2fd1",
  "external_id": "019d01f7-cf86-74d3-9119-af1907149360",
  "function_id": "69b9d0b4a47bbbaf688c9a38",
  "function_api_name": "class_signup",
  "function_version_id": "69badf2e833b1ef6413d2fce",
  "function_version_human_friendly_id": 2,
  "code": "import RipplingSDK from \"@rippling/rippling-sdk\";\n\nexport async function onRipplingEvent(event, context) {\n  console.log(\"event\", JSON.stringify(event));\n  return {\n    statusCode: 200,\n    body: { ok: true },\n    headers: {},\n    message: \"Deployment test succeeded\"\n  };\n}\n",
  "dependencies": {
    "@rippling/rippling-sdk": "^0.2.0-alpha.25",
    "lodash": "^4.17.21"
  },
  "allowed_domains": null,
  "runtime": "lambda-deno",
  "options": {
    "allowed_domains": [
      "api.rippling.com",
      "api.example.com"
    ]
  },
  "status": "pending",
  "created_at": "2026-03-18T17:21:50.982000+00:00",
  "updated_at": "2026-03-18T17:21:50.982000+00:00"
}
```

### Function dev bundle

Use [POST Create a new function dev bundle](https://developer.rippling.com/documentation/rest-api/reference/create-functions-function-api-name-dev-bundles) to create a new function dev bundle.

_Request:_

```json
curl -L -X POST 'https://rest.ripplingapis.com/functions/class_signup/dev_bundles/'
-H 'Accept: application/json'
-H 'Content-Type: application/json'
-H 'Authorization: Bearer REDACTED'
```

_Request body:_

```json
{
}
```

_Response:_

```json
{
  "contents": "REDACTED"
}
```

### Function execution

Use [POST Create a new function execution](https://developer.rippling.com/documentation/rest-api/reference/create-functions-function-api-name-executions) to create a new execution for a function.

_Request:_

```json
curl -L -X POST 'https://rest.ripplingapis.com/functions/class_signup/executions/'
-H 'Accept: application/json'
-H 'Content-Type: application/json'
-H 'Authorization: Bearer REDACTED'
```

_Request body:_

```json
{
  "inputs": {
    "record_id": "co_record_123",
    "current_user": "worker_456",
    "trigger_type": "detail view"
  }
}
```

_Response:_

```json
{
  "id": "69bae9747d1c9c1c1ab4976d",
  "created_at": "2026-03-18T18:05:40.879000+00:00",
  "updated_at": "2026-03-18T18:05:42.293000+00:00",
  "function_id": "69b9d0b4a47bbbaf688c9a38",
  "inputs": {
    "record_id": "co_record_123",
    "current_user": "worker_456",
    "trigger_type": "detail view",
    "parameters": {}
  },
  "outputs": {
    "body": {
      "message": "Deployment test succeeded",
      "body": {
        "ok": true
      },
      "headers": {},
      "statusCode": 200
    },
    "code": 200
  },
  "status": "success",
  "started_at": "2026-03-18T18:05:40.878000+00:00",
  "finished_at": "2026-03-18T18:05:42.293000+00:00"
}
```

* * *

## Update

### Function

Use [PATCH Update a function](https://developer.rippling.com/documentation/rest-api/reference/update-functions) to update an existing function.

_Request:_

```json
curl -L -X PATCH 'https://rest.ripplingapis.com/functions/class_signup/'
-H 'Accept: application/json'
-H 'Content-Type: application/json'
-H 'Authorization: Bearer REDACTED'
```

_Request body:_

```json
{
  "name": "Class signup",  
   "description": "Signups for class."
 }
```

| Request body field | Required | Description |
| --- | --- | --- |
| `name` | No | The function name. |
| `description` | No | The function description. |
| `code_draft` | No | The current draft of code for the function. |
| `dependencies` | No | The dependencies of the function. |

_Response:_

```json
{
  "id": "69b9d0b4a47bbbaf688c9a38",
  "created_at": "2026-03-17T22:07:48.518000+00:00",
  "updated_at": "2026-03-17T22:07:48.519000+00:00",
  "name": "Class signup",
  "api_name": "class_signup",
  "description": "Signups for class.",
  "code_draft": "import RipplingSDK, {\n  FunctionContext,\n  FunctionEvent,\n  FunctionResponse,\n} from \"@rippling/rippling-sdk\";\nimport _ from \"lodash\";\n\nexport async function onRipplingEvent(\n  event: FunctionEvent,\n  context: FunctionContext\n) {\n  // Initialize an instance of the Rippling SDK\n  const ripplingSDK = new RipplingSDK({ bearerToken: \"<YOUR_BEARER_TOKEN>\" });\n  //\n  // As an alternative to hard-coding the API token, you can store it in the\n  // Settings Manager and retrieve it using something like\n  // 'String(context.settings[\"<YOUR_TOKEN_SYSTEM_NAME>\"])'.\n\n  // Process inputs (stored in event)\n\n  // Return function response\n  return new FunctionResponse({\n    body: {},\n    statusCode: 200,\n    headers: {},\n    message: \"\",\n  });\n}",
  "dependencies": {
    "@rippling/rippling-sdk": "^0.2.0-alpha.26",
    "lodash": "^4.17.21",
    "moment": "^2.30.1"
  },
  "is_async": false
}
```

* * *

## Use cases

### Automate employee onboarding tasks

When a new employee is hired, a company wants to automatically assign equipment, create accounts, and send a welcome message. Using the Functions API turns a multi-step manual HR/IT process into a single automated flow.

1.  **Create function:** Define an `employee_onboarding` function using [POST Create a new function](https://developer.rippling.com/documentation/rest-api/reference/create-functions).
2.  **Edit code:** Add logic to provision apps, assign devices, and send emails using [PATCH Update a function](https://developer.rippling.com/documentation/rest-api/reference/update-functions).
3.  **Create dev bundle (optional):** Package dependencies (e.g., SDK, utilities) using [POST Create a new function dev bundle](https://developer.rippling.com/documentation/rest-api/reference/create-functions-function-api-name-dev-bundles).
4.  **Deploy:** Make the onboarding logic live using [POST Create a new function deployment](https://developer.rippling.com/documentation/rest-api/reference/create-functions-function-api-name-deployments).
5.  **Execute:** Trigger [POST Create a new function execution](https://developer.rippling.com/documentation/rest-api/reference/create-functions-function-api-name-executions) when a new employee record is created. This can be done via a webhook, automation, polling job, etc.
6.  **Observe:** Check execution logs if provisioning fails or partially completes using [GET List function execution logs](https://developer.rippling.com/documentation/rest-api/reference/list-functions-function-api-name-executions-execution-id-logs).

### Sync data to an external system

When employee data changes in Rippling (such as title, department, or compensation), a company wants to automatically sync those updates to their external system. Using the Functions API endpoints keeps systems in sync automatically, reducing manual data entry and preventing inconsistencies across tools.

1.  **Create function:** Define a `sync_employee_data` function using [POST Create a new function](https://developer.rippling.com/documentation/rest-api/reference/create-functions).
2.  **Edit code:** Add logic to detect changes and call an external API (e.g., payroll/CRM) using [PATCH Update a function](https://developer.rippling.com/documentation/rest-api/reference/update-functions).
3.  **Create dev bundle (optional):** Package dependencies (e.g., SDK, HTTP client utilities) using [POST Create a new function dev bundle](https://developer.rippling.com/documentation/rest-api/reference/create-functions-function-api-name-dev-bundles).
4.  **Deploy:** Make the integration logic live using [POST Create a new function deployment](https://developer.rippling.com/documentation/rest-api/reference/create-functions-function-api-name-deployments).
5.  **Execute:** Trigger the function via a automation “Run Function” step when employee data is updated.
6.  **Observe:** Monitor execution logs to catch API failures or data mismatches using [GET List function execution logs](https://developer.rippling.com/documentation/rest-api/reference/list-functions-function-api-name-executions-execution-id-logs).

* * *

## FAQs

**401 Unauthorized error when calling GET List function executions.**

If you’re receiving a 401 Unauthorized error when calling any of the function execution endpoints, confirm that the execution has been selected in the API token. This can be done by editing the API token and confirming access on the **Specify execution access to functions** page.

**Why am I unable to access Rippling Functions in my account?**

A subscription of **Rippling Pro or higher** is needed to access the Functions tool in your Rippling account. For access, contact your company’s Technical Account Manager or Account Manager.

* * *

## See also

-   [Get started with the Developer API](https://developer.rippling.com/documentation/rest-api/guides/dev-getting-started)
-   [Getting started with functions](https://developer.rippling.com/documentation/rippling-platform/developer/functions/getting-started)
-   [Hello World example using functions](https://developer.rippling.com/documentation/rippling-platform/developer/functions/real-world-example)
-   [Overview of the Developer app](https://help.rippling.com/article?articleId=01SuVhaP5h6gA9jlyCkDrW#tools-available-in-the-developer-app)
-   [API tokens and permissions](https://developer.rippling.com/documentation/rest-api/essentials/api-tokens)

Source: https://developer.rippling.com/documentation/rest-api/guides/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.
