---
title: Eventing REST API
description: The Eventing REST API, available by default at port 8096, provides
  the methods available to work with and manipulate Couchbase Eventing
  Functions.
pubDate: 2026-08-17T09:53:44.266Z
antora:
  editUrl: https://github.com/couchbase/docs-server/edit/release/7.2/modules/eventing/pages/eventing-api.adoc
  xref: xref:7.2@server:eventing:eventing-api.adoc[]
---

[Consult the llms.txt file for a full list of contents](/llms.txt)
[View original HTML](/server/7.2/eventing/eventing-api.html)

# Eventing REST API

> The Eventing REST API, available by default at port 8096, provides the methods available to work with and manipulate Couchbase Eventing Functions. 

> [!NOTE]
> Changes to the Eventing Function definition files made outside of this REST API or the interactive UI are only supported for version 7.0 (and above) if the Eventing schemas located in <https://github.com/couchbase/eventing/tree/master/parser> are adhered to.

As of version 7.1 Eventing now supports full [Eventing Role-Based Access Control](eventing-rbac.md) (RBAC).

If the sample REST API shows two forms:

* The first format is for privileged Eventing functions with a "Function Scope" of **\*.\***; these functions can only be made or managed by users with the "Full Admin", "Eventing Full Admin" role. In addition this is the default "Function Scope" for all functions after an upgrade from a prior version. The creditionals for these examples will be "Administrator:password".
* The second format uses RBAC and you must pass the parameters **bucket=\[fs\_bucket\]&scope=\[fs\_scope\]** to specify the **bucket** and the **scope** of the "Function Scope" to the REST call. In addition, due to the use or **&** and **?** characters, you will need to quote your REST call on the command line. The creditionals for these examples will be "anyAuthedUser:password" (although "Administrator:password" can also use this form).

If the sample REST API shows just a single format, then the REST API call does not require the parameters **bucket=\[fs\_bucket\]&scope=\[fs\_scope\]** and the action is fully determined by the **username** and **password** credentials passed to the REST call.

__Table 1\. Eventing Functions API (basic activation/deactivation)__
| HTTP Method | **URI Path**                                                                                                                                                                                                                                                          | **Description**                                                                                                                                                                                                           |
| ----------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| POST        | _/api/v1/functions/\[sample\_name\]/deploy_                                                                                                                                                                                                                           | Deploys an undeployed Function. Starting with version 6.5.0, this is the preferred invocation. A deploy CURL example is provided for reference.                                                                           |
|             | Sample API: curl -X POST http://Administrator:password@192.168.1.5:8096/api/v1/functions/\[sample\_name\]/deploy curl -X POST 'http://anyAuthedUser:password@192.168.1.5:8096/api/v1/functions/\[sample\_name\]/deploy?bucket=\[fs\_bucket\]&scope=\[fs\_scope\]'     |                                                                                                                                                                                                                           |
| POST        | _/api/v1/functions/\[sample\_name\]/undeploy_                                                                                                                                                                                                                         | Undeploys a Function. Starting with version 6.5.0, this is the preferred invocation. An undeploy CURL example is provided for reference.                                                                                  |
|             | Sample API: curl -X POST http://Administrator:password@192.168.1.5:8096/api/v1/functions/\[sample\_name\]/undeploy curl -X POST 'http://anyAuthedUser:password@192.168.1.5:8096/api/v1/functions/\[sample\_name\]/undeploy?bucket=\[fs\_bucket\]&scope=\[fs\_scope\]' |                                                                                                                                                                                                                           |
| POST        | _/api/v1/functions/\[sample\_name\]/pause_                                                                                                                                                                                                                            | Pauses a Function and creates a DCP checkpoint such that on a subsequent resume no mutations will be lost. Starting with version 6.5.0, this is the preferred invocation. A pause CURL example is provided for reference. |
|             | Sample API: curl -X POST http://Administrator:password@192.168.1.5:8096/api/v1/functions/\[sample\_name\]/pause curl -X POST 'http://anyAuthedUser:password@192.168.1.5:8096/api/v1/functions/\[sample\_name\]/pause?bucket=\[fs\_bucket\]&scope=\[fs\_scope\]'       |                                                                                                                                                                                                                           |
| POST        | _/api/v1/functions/\[sample\_name\]/resume_                                                                                                                                                                                                                           | Resumes a paused function from its paused DCP checkpoint. Starting with version 6.5.0, this is the preferred invocation. A resume CURL example is provided for reference.                                                 |
|             | Sample API: curl -X POST http://Administrator:password@192.168.1.5:8096/api/v1/functions/\[sample\_name\]/resume curl -X POST 'http://anyAuthedUser:password@192.168.1.5:8096/api/v1/functions/\[sample\_name\]/resume?bucket=\[fs\_bucket\]&scope=\[fs\_scope\]'     |                                                                                                                                                                                                                           |

__Table 2\. Eventing Functions API (advanced)__
| HTTP Method | **URI Path**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       | **Description**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| POST        | _/api/v1/functions/\[function\_name\]_                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             | Import or create a single Function. The Function name in the body must match that on the URL. Function definition includes current settings. The POST data or POST data file must be a single JSON object or an array containing a single JSON object                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
|             | Sample API (from file): curl -X POST  -d @./\[sample\_name\].json http://Administrator:password@192.168.1.5:8096/api/v1/functions/\[sample\_name\] curl -X POST  -d @./\[sample\_name\].json 'http://anyAuthedUser:password@192.168.1.5:8096/api/v1/functions/\[sample\_name\]?bucket=\[fs\_bucket\]&scope=\[fs\_scope\]'                                                                                                                                                                                                                                                                                                                                                                                                                          |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| POST        | _/api/v1/functions/_                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               | Imports or creates multiple Functions. Function names must be unique. When multiple Functions have the same name, an error is reported. The POST data or POST data file must be either a single JSON object or an array containing a one or more JSON objects                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
|             | Sample API (from file): curl -X POST  -d @./\[array\_of\_functions\].json http://anyAuthedUser:password@192.168.1.5:8096/api/v1/functions                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| POST        | _/api/v1/import/_                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  | Imports multiple Functions. Function names must be unique. When multiple Functions have the same name, an error is reported. The POST data or POST data file must be either a single JSON object or an array containing a one or more JSON objects Note if any Function's language\_compatibility field is missing the value will be set to 6.0.0 (unlike the _/api/v1/functions_ above which will set the value to the highest version supported by the server).                                                                                                                                                                                                                                                                                                                                                                       |
|             | Sample API (from file): curl -X POST  -d @./\[array\_of\_functions\].json http://anyAuthedUser:password@192.168.1.5:8096/api/v1/import                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| GET         | _/api/v1/functions/\[sample\_name\]_                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               | View a definition of a Function. Provides a listing of a complete Function definition available in the cluster. The Function could be in any state: deployed, undeployed, or paused. If saved to a file the function definition can be imported into the cluster or a different cluster. However any changes to the function definition made to the file outside the UI are discouraged.                                                                                                                                                                                                                                                                                                                                                                                                                                                |
|             | Sample API (to standard out): curl -X GET http://Administrator:password@192.168.1.5:8096/api/v1/functions/\[sample\_name\] curl -X GET 'http://anyAuthedUser:password@192.168.1.5:8096/api/v1/functions/\[sample\_name\]?bucket=\[fs\_bucket\]&scope=\[fs\_scope\]'                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
|             | Sample API (to file): curl -X GET http://Administrator:password@192.168.1.5:8096/api/v1/functions/\[sample\_name\] -o \[sample\_name\].json curl -X GET 'http://anyAuthedUser:password@192.168.1.5:8096/api/v1/functions/\[sample\_name\]?bucket=\[fs\_bucket\]&scope=\[fs\_scope\]' -o \[sample\_name\].json                                                                                                                                                                                                                                                                                                                                                                                                                                      |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| GET         | _/api/v1/functions_                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                | View definitions of all Functions. Provides an array of definitions of all Functions available in the cluster. The Functions could be in any state: deployed, undeployed, or paused. If saved to a file the function definitions can be imported into the cluster or a different cluster. However any changes to the function definition made to the file outside the UI are discouraged. If this API is run as a non-Administrator the return set will be filtered via RBAC to just the "Function Scopes" the user has access too.                                                                                                                                                                                                                                                                                                     |
|             | Sample API (to standard out): curl -X GET http://anyAuthedUser:password@192.168.1.5:8096/api/v1/functions                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
|             | Sample API (to file): curl -X GET http://anyAuthedUser:password@192.168.1.5:8096/api/v1/functions -o array\_of\_functions.json                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| GET         | _/api/v1/export_                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   | This is a convenience method to export all function definitions. Exported functions are always set to undeployed state at the time of export, regardless of the state in the cluster at time of export. If saved to a file the function definitions can be imputed into the cluster or a different cluster. However any changes to the function definition made to the file outside the UI are discouraged. If this API is run as a non-Administrator the return set will be filtered via RBAC to just the "Function Scopes" the user has access too.                                                                                                                                                                                                                                                                                   |
|             | Sample API (to standard out): curl -X GET http://anyAuthedUser:password@192.168.1.5:8096/api/v1/export                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
|             | Sample API (to file): curl -X GET http://anyAuthedUser:password@192.168.1.5:8096/api/v1/export -o array\_of\_functions.json                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| DELETE      | _/api/v1/functions/\[function\_name\]_                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             | Deletes a specific Function from the cluster. WARNING: Use this API with caution as it is irreversible.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
|             | Sample API: curl -XDELETE http://Administrator:password@192.168.1.5:8096/api/v1/functions/\[sample\_name\] curl -XDELETE 'http://anyAuthedUser:password@192.168.1.5:8096/api/v1/functions/\[sample\_name\]?bucket=\[fs\_bucket\]&scope=\[fs\_scope\]'                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| DELETE      | _/api/v1/functions_                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                | Deletes multiple Functions (**as in all Functions**) from the cluster. WARNING: Use this API with caution as it is irreversible. If this API is run as a non-Administrator the deleted set will be filtered via RBAC to just the "Function Scopes" the user has access too.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
|             | Sample API: curl -XDELETE http://anyAuthedUser:password@192.168.1.5:8096/api/v1/functions                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| GET         | _/api/v1/functions/\[function\_name\]/settings_                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    | Export or return the full definition for one Eventing Function in the cluster. The definition can be subsequently imported. However any changes to the function definition made to the file outside the UI are discouraged.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
|             | Sample API (to standard out): curl -X GET http://Administrator:password@192.168.1.5:8096/api/v1/functions/\[sample\_name\]/settings curl -X GET 'http://anyAuthedUser:password@192.168.1.5:8096/api/v1/functions/\[sample\_name\]/settings?bucket=\[fs\_bucket\]&scope=\[fs\_scope\]'                                                                                                                                                                                                                                                                                                                                                                                                                                                              |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
|             | Sample API (to file): curl -X GET http://Administrator:password@192.168.1.5:8096/api/v1/functions/\[sample\_name\]/settings -o \[sample\_name\].json curl -X GET 'http://anyAuthedUser:password@192.168.1.5:8096/api/v1/functions/\[sample\_name\]/settings?bucket=\[fs\_bucket\]&scope=\[fs\_scope\]' -o \[sample\_name\].json                                                                                                                                                                                                                                                                                                                                                                                                                    |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| POST        | _/api/v1/functions/\[function\_name\]/settings_                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    | Updates an undeployed or paused function with the provided setting. Note settings can only be altered when the function is paused or undeployed, attempting to adjust a deployed function will result in an error. During an edit, settings provided are merged. Unspecified attributes retain their prior values. Note that you must always specify **deployment\_status** (deployed/undeployed) and **processing\_status** (paused/not-paused) when using this REST endpoint to update any option or set of options. The current values of **deployment\_status** and **processing\_status** can be queried via _api/v1/status_ or _api/v1/status/\[sample\_name\]_ By adjusting **deployment\_status** and **processing\_status** this command can also deploy or resume a function, however it cannot pause or undeploy a function. |
|             | Sample API (alter worker\_count): curl -X POST -d '{"deployment\_status":false,"processing\_status":false,"worker\_count":6}' http://Administrator:password@192.168.1.5:8096/api/v1/functions/\[sample\_name\]/settings curl -X POST -d '{"deployment\_status":false,"processing\_status":false,"worker\_count":6}' 'http://anyAuthedUser:password@192.168.1.5:8096/api/v1/functions/\[sample\_name\]/settings?bucket=\[fs\_bucket\]&scope=\[fs\_scope\]'                                                                                                                                                                                                                                                                                          |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
|             | Sample API (alter app\_log\_max\_files and app\_log\_max\_size) _this function is currently undeployed_: curl -X POST -d '{"deployment\_status":false,"processing\_status":false,"app\_log\_max\_files":5,"app\_log\_max\_size":10485760}' http://Administrator:password@192.168.1.5:8096/api/v1/functions/\[sample\_name\]/settings curl -X POST -d '{"deployment\_status":false,"processing\_status":false,"app\_log\_max\_files":5,"app\_log\_max\_size":10485760}' 'http://anyAuthedUser:password@192.168.1.5:8096/api/v1/functions/\[sample\_name\]/settings?bucket=\[fs\_bucket\]&scope=\[fs\_scope\]'                                                                                                                                       |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
|             | Sample API (alter timer\_context\_size) _this function is currently paused_: curl -X POST -d '{"deployment\_status":true,"processing\_status":false,"timer\_context\_size":2048}' http://Administrator:password@192.168.1.5:8096/api/v1/functions/\[sample\_name\]/settings curl -X POST -d '{"deployment\_status":true,"processing\_status":false,"timer\_context\_size":2048}' 'http://anyAuthedUser:password@192.168.1.5:8096/api/v1/functions/\[sample\_name\]/settings?bucket=\[fs\_bucket\]&scope=\[fs\_scope\]'                                                                                                                                                                                                                             |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
|             | Sample API (alter worker\_count AND resume) _this function is currently paused_: curl -X POST -d '{"deployment\_status":true,"processing\_status":true,"worker\_count":8}' http://Administrator:password@192.168.1.5:8096/api/v1/functions/\[sample\_name\]/settings curl -X POST -d '{"deployment\_status":true,"processing\_status":true,"worker\_count":8}' 'http://anyAuthedUser:password@192.168.1.5:8096/api/v1/functions/\[sample\_name\]/settings?bucket=\[fs\_bucket\]&scope=\[fs\_scope\]'                                                                                                                                                                                                                                               |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| GET         | _/api/v1/functions/\[function\_name\]/config_                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      | Export or return the configuration of the source keyspace and the eventing storage (metadata) keyspace for one Eventing Function in the cluster. The definition can be subsequently imported. However any changes to the function definition made to the file outside the UI are discouraged.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
|             | Sample API (to standard out): curl -X GET http://Administrator:password@192.168.1.5:8096/api/v1/functions/\[sample\_name\]/config curl -X GET 'http://anyAuthedUser:password@192.168.1.5:8096/api/v1/functions/\[sample\_name\]/config?bucket=\[fs\_bucket\]&scope=\[fs\_scope\]'                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
|             | Sample API (to file): curl -X GET http://Administrator:password@192.168.1.5:8096/api/v1/functions/\[sample\_name\]/config -o \[sample\_name\].json curl -X GET 'http://anyAuthedUser:password@192.168.1.5:8096/api/v1/functions/\[sample\_name\]/config?bucket=\[fs\_bucket\]&scope=\[fs\_scope\]' -o \[sample\_name\].json                                                                                                                                                                                                                                                                                                                                                                                                                        |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| POST        | _/api/v1/functions/\[function\_name\]/config_                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      | Import the configuration and alter the source keyspace and the eventing storage (metadata) keyspace for one Eventing Function in the cluster. You can only change these values if a function is in the undeployed state and the two keyspaces exist.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
|             | Sample API (alter source and eventing storage keyspaces): curl -X POST http://Administrator:password@192.168.1.5:8096/api/v1/functions/\[sample\_name\]/config -d '{ "source\_bucket": "bulk", "cust01": "orders", "source\_collection": "customer01", "metadata\_bucket": "rr100", "metadata\_scope": "eventing", "metadata\_collection": "metadata" }' curl -X POST 'http://anyAuthedUser:password@192.168.1.5:8096/api/v1/functions/\[sample\_name\]/config?bucket=\[fs\_bucket\]&scope=\[fs\_scope\]' -d '{ "source\_bucket": "bulk", "cust01": "orders", "source\_collection": "customer01", "metadata\_bucket": "rr100", "metadata\_scope": "eventing", "metadata\_collection": "metadata" }'                                                |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
|             | Sample API (alter source and eventing storage keyspaces from a file): curl -X POST http://Administrator:password@192.168.1.5:8096/api/v1/functions/\[sample\_name\]/config -d @./\[sample\_name\].json curl -X POST 'http://anyAuthedUser:password@192.168.1.5:8096/api/v1/functions/\[sample\_name\]/config?bucket=\[fs\_bucket\]&scope=\[fs\_scope\]' -d @./\[sample\_name\].json                                                                                                                                                                                                                                                                                                                                                                |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| GET         | _/api/v1/functions/\[function\_name\]/appcode_                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     | Export only the JavaScript code for one Eventing Function in the cluster. Note the JavaScript is not escaped (unlike /api/v1/functions/\[function\_name\]) and the code is runnable in other environments. The JavaScript code can be subsequently imported. However any changes to the function definition made to the file outside the UI are discouraged.                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
|             | Sample API (to standard out): curl -X GET http://Administrator:password@192.168.1.5:8096/api/v1/functions/\[sample\_name\]/appcode curl -X GET 'http://anyAuthedUser:password@192.168.1.5:8096/api/v1/functions/\[sample\_name\]/appcode?bucket=\[fs\_bucket\]&scope=\[fs\_scope\]'                                                                                                                                                                                                                                                                                                                                                                                                                                                                |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
|             | Sample API (to file): curl -X GET http://Administrator:password@192.168.1.5:8096/api/v1/functions/\[sample\_name\]/appcode -o \[sample\_name\].json curl -X GET 'http://anyAuthedUser:password@192.168.1.5:8096/api/v1/functions/\[sample\_name\]/appcode?bucket=\[fs\_bucket\]&scope=\[fs\_scope\]' -o \[sample\_name\].json                                                                                                                                                                                                                                                                                                                                                                                                                      |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| POST        | _/api/v1/functions/\[function\_name\]/appcode_                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     | Import only the JavaScript code for one Eventing Function in the cluster. Note the JavaScript supplied is not escaped (unlike /api/v1/functions/\[function\_name\]) and could come from other environments. It is highly recommended that you use the flag **\--data-binary** or **\--upload-file** when importing your JavaScript "appcode" fragments to avoid potential encoding issues due to string escaping.                                                                                                                                                                                                                                                                                                                                                                                                                       |
|             | Sample API (import and replace JavaScript): curl -X POST http://Administrator:password@192.168.1.5:8096/api/v1/functions/\[sample\_name\]/appcode --data-binary 'function OnUpdate(doc, meta) { log("id",meta.id); }' curl -X POST 'http://anyAuthedUser:password@192.168.1.5:8096/api/v1/functions/\[sample\_name\]/appcode?bucket=\[fs\_bucket\]&scope=\[fs\_scope\]' --data-binary 'function OnUpdate(doc, meta) { log("id",meta.id); }'                                                                                                                                                                                                                                                                                                        |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
|             | Sample API (import and replace JavaScript from a file, do not use **\-d**): curl -X POST http://Administrator:password@192.168.1.5:8096/api/v1/functions/\[sample\_name\]/import --data-binary @./\[sample\_name\].json curl -X POST 'http://anyAuthedUser:password@192.168.1.5:8096/api/v1/functions/\[sample\_name\]/import?bucket=\[fs\_bucket\]&scope=\[fs\_scope\]' --data-binary @./\[sample\_name\].json or curl -X GET http://Administrator:password@192.168.1.5:8096/api/v1/functions/\[sample\_name\]/import --upload-file ./\[sample\_name\].json curl -X GET 'http://anyAuthedUser:password@192.168.1.5:8096/api/v1/functions/\[sample\_name\]/import?bucket=\[fs\_bucket\]&scope=\[fs\_scope\]' --upload-file ./\[sample\_name\].json |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |

__Table 3\. Eventing Status API (advanced)__
| HTTP Method | **URI Path**                                                                                                                                                                                                                                         | **Description**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| GET         | _/api/v1/status_                                                                                                                                                                                                                                     | Returns a list (array) of all Eventing Functions showing their corresponding **composite\_status**. A Function's status can have one of the following values - _undeployed_, _deploying_, _deployed_, _undeploying_, _paused_, and '_pausing_. Note, there is no value of _resuming_ when resuming a paused Eventing Function the **composite\_status** will return _deploying_ until it reaches the _deployed_ state. If this API is run as a non-Administrator the return set will be filtered via RBAC to just the "Function Scopes" the user has access too. |
|             | Sample API (status): curl -X GET http://anyAuthedUser:password@192.168.1.5:8096/api/v1/status                                                                                                                                                        |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| GET         | _/api/v1/status/\[sample\_name\]_                                                                                                                                                                                                                    | Returns a specific Eventing Functions showing its corresponding **composite\_status**. It can have one of the following values - _undeployed_, _deploying_, _deployed_, _undeploying_, _paused_, and '_pausing_. Note, there is no value of _resuming_ when resuming a paused Eventing Function the **composite\_status** will return _deploying_ until it reaches the _deployed_ state.                                                                                                                                                                         |
|             | Sample API (status): curl -X GET http://Administrator:password@192.168.1.5:8096/api/v1/status/\[sample\_name\] curl -X GET 'http://anyAuthedUser:password@192.168.1.5:8096/api/v1/status/\[sample\_name\]?bucket=\[fs\_bucket\]&scope=\[fs\_scope\]' |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |

__Table 4\. Eventing Log API (advanced)__
| HTTP Method | **URI Path**                                                                                                                                                                                                                                                                                                                                                                          | **Description**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| GET         | _/getAppLog?name=\[sample\_name\]_                                                                                                                                                                                                                                                                                                                                                    | Returns the most recent application log messages for a specific Eventing Function. This API by default accesses a single Eventing node but can access all Eventing nodes by setting the optional parameter **aggregate=true**. By default the amount of logging information returned is approximately 40960 bytes unless you specify the optional size parameter **size=#** where # is in bytes. Note when specifying the **size** parameter and fetching from more than one Eventing node only **size/#nodes** bytes are returned from each node. |
|             | Sample API (fetch recent Application log info from one Eventing node): curl -X GET http://Administrator:password@192.168.1.5:8096/getAppLog?name=\[sample\_name\] curl -X GET 'http://anyAuthedUser:password@192.168.1.5:8096/getAppLog?name=\[sample\_name\]&bucket=\[fs\_bucket\]&scope=\[fs\_scope\]'                                                                              |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
|             | Sample API (fetch recent Application log info from all Eventing nodes): curl -X GET http://Administrator:password@192.168.1.5:8096/getAppLog?name=\[sample\_name\]&aggregate=true curl -X GET 'http://anyAuthedUser:password@192.168.1.5:8096/getAppLog?name=\[sample\_name\]&aggregate=true&bucket=\[fs\_bucket\]&scope=\[fs\_scope\]'                                               |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
|             | Sample API (fetch recent Application log info from all Eventing nodes but limited to 2048 bytes): curl -X GET http://Administrator:password@192.168.1.5:8096/getAppLog?name=\[sample\_name\]&aggregate=true&size=2048 curl -X GET 'http://anyAuthedUser:password@192.168.1.5:8096/getAppLog?name=\[sample\_name\]&aggregate=true&size=2048&bucket=\[fs\_bucket\]&scope=\[fs\_scope\]' |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |

__Table 5\. Eventing List API (advanced)__
| HTTP Method | **URI Path**                                                                                                                                | **Description**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| ----------- | ------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| GET         | _/api/v1/list/functions_                                                                                                                    | Returns a list (array) of the names of all Eventing Functions in the cluster. The returned list can also be filtered by the following: **deployed** status _true_ or _false_ (in this case paused is considered deployed), **source\_bucket** filter by the bucket with the listen to keyspace, and **function\_type** _notsbm_ or _sbm_ (the later if the functions that modifies its own listen to keyspace). If this API is run as a non-Administrator the return set will be filtered via RBAC to just the "Function Scopes" the user has access too. |
|             | Sample API (list): curl -X GET http://anyAuthedUser:password@192.168.1.5:8096/api/v1/list/functions                                         |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| GET         | _/api/v1/list/functions/query?deployed=true_                                                                                                | Returns a list (array) of the names of all deployed (or paused) Eventing Functions in the cluster. Note, if we had specified _deployed=false_ we would get all undeployed functions. If this API is run as a non-Administrator the return set will be filtered via RBAC to just the "Function Scopes" the user has access too.                                                                                                                                                                                                                            |
|             | Sample API (status): curl -X GET http://anyAuthedUser:password@192.168.1.5:8096/api/v1/list/functions/query?deployed=true                   |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| GET         | _/api/v1/list/functions/query?source\_bucket=\[bucket\_name\]_                                                                              | Returns a list (array) of the names of Eventing Functions in the cluster that have a source keyspace under a particular bucket. If this API is run as a non-Administrator the return set will be filtered via RBAC to just the "Function Scopes" the user has access too.                                                                                                                                                                                                                                                                                 |
|             | Sample API (status): curl -X GET http://anyAuthedUser:password@192.168.1.5:8096/api/v1/list/functions/query?source\_bucket=\[bucket\_name\] |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| GET         | _/api/v1/list/functions/query?function\_type=sbm_                                                                                           | Returns a list (array) of the names of Eventing Functions in the cluster that modify their own a source keyspace. If this API is run as a non-Administrator the return set will be filtered via RBAC to just the "Function Scopes" the user has access too.                                                                                                                                                                                                                                                                                               |
|             | Sample API (status): curl -X GET http://anyAuthedUser:password@192.168.1.5:8096/api/v1/list/functions/query?function\_type=sbm              |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| GET         | _/api/v1/list/functions/query?function\_type=notsbm_                                                                                        | Returns a list (array) of the names of Eventing Functions in the cluster that **do not** modify their own a source keyspace. If this API is run as a non-Administrator the return set will be filtered via RBAC to just the "Function Scopes" the user has access too.                                                                                                                                                                                                                                                                                    |
|             | Sample API (status): curl -X GET http://anyAuthedUser:password@192.168.1.5:8096/api/v1/list/functions/query?function\_type=notsbm           |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |

__Table 6\. Eventing Global Config API (advanced)__
| HTTP Method | **URI Path**                                                                                                                                                                                                                                                                                                                                                                                                                                                              | **Description**                                                                                                                                                                                                                                                        |
| ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| GET         | _/api/v1/config_                                                                                                                                                                                                                                                                                                                                                                                                                                                          | List global configuration. The response shows all global Eventing settings. There are currently just two settings: **enable\_debugger** (default value of false) and **ram\_quota** (default value of 256 MB). Both of these settings can also be adjusted via the UI. |
|             | Sample API: curl -X GET http://Administrator:password@192.168.1.5:8096/api/v1/config                                                                                                                                                                                                                                                                                                                                                                                      |                                                                                                                                                                                                                                                                        |
| POST        | _/api/v1/config_                                                                                                                                                                                                                                                                                                                                                                                                                                                          | Modify global configuration. During an edit, settings provided are merged. Unspecified attributes retain their prior values. The response indicates whether the Eventing service must be restarted for the new changes to take effect.                                 |
|             | Sample API (alter ram\_quota): curl -X POST -d '{"ram\_quota": 512}' http://Administrator:password@192.168.1.5:8096/api/v1/config                                                                                                                                                                                                                                                                                                                                         |                                                                                                                                                                                                                                                                        |
|             | Sample API (alter enable\_debugger): curl -X POST -d '{"enable\_debugger": true}' http://Administrator:password@192.168.1.5:8096/api/v1/config                                                                                                                                                                                                                                                                                                                            |                                                                                                                                                                                                                                                                        |
|             | Sample API (allow interbucket recursion): Note, setting the value of "allow\_interbucket\_recursion" to true is highly discouraged unless you have an advanced use case and follow strict non-production coding and verification. This will disable the safety checks that prevent running basic infinite recursive Eventing Functions curl -X POST -u Administrator:password http://192.168.1.5:8091/\_p/event/api/v1/config -d '{"allow\_interbucket\_recursion":true}' |                                                                                                                                                                                                                                                                        |
|             | Sample API (disallow interbucket recursion): This is the default setting of which applies some sanity checks to disable running basic infinite recursive Eventing Functions. curl -X POST -u Administrator:password http://192.168.1.5:8091/\_p/event/api/v1/config -d '{"allow\_interbucket\_recursion":false}'                                                                                                                                                          |                                                                                                                                                                                                                                                                        |

__Table 7\. Eventing Statistics API__
| HTTP Method | **URI Path**                                                                                                                                                                                                                                                              | **Description**                                                                                                                                                                                                                                                                                                                             |
| ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| GET         | _/api/v1/stats?type=full_                                                                                                                                                                                                                                                 | Retrieve all statistics for the node. This will return the full statistics set inclusive of events processing, events remaining, execution, failure, latency, worker PIDs and sequence processed. If this API is run as a non-Administrator the return set will be filtered via RBAC to just the "Function Scopes" the user has access too. |
|             | Omitting the parameter type=full will exclude dcp\_event\_backlog\_per\_vb, doc\_timer\_debug\_stats, latency\_stats, plasma\_stats, and seqs\_processed from the response.                                                                                               |                                                                                                                                                                                                                                                                                                                                             |
|             | Sample API (basic): curl -X GET http://anyAuthedUser:password@192.168.1.5:8096/api/v1/stats                                                                                                                                                                               |                                                                                                                                                                                                                                                                                                                                             |
|             | Sample API (full): curl -X GET http://anyAuthedUser:password@192.168.1.5:8096/api/v1/stats?type=full                                                                                                                                                                      |                                                                                                                                                                                                                                                                                                                                             |
| GET         | _/getExecutionStats?name=\[function\_name\]_                                                                                                                                                                                                                              | Retrieve only execution statistics. This will return the subset of statistics for the node.                                                                                                                                                                                                                                                 |
|             | Sample API: curl -X GET http://Administrator:password@192.168.1.5:8096/getExecutionStats?name=\[function\_name\] curl -X GET 'http://anyAuthedUser:password@192.168.1.5:8096/getExecutionStats?name=\[function\_name\]&bucket=\[fs\_bucket\]&scope=\[fs\_scope\]'         |                                                                                                                                                                                                                                                                                                                                             |
| GET         | _/getLatencyStats?name=\[function\_name\]_                                                                                                                                                                                                                                | Retrieve only latency statistics. This will return the subset of statistics for the node.                                                                                                                                                                                                                                                   |
|             | Sample API: curl -X GET http://Administrator:password@192.168.1.5:8096/getLatencyStats?name=\[function\_name\] curl -X GET 'http://anyAuthedUser:password@192.168.1.5:8096/getLatencyStats?name=\[function\_name\]&bucket=\[fs\_bucket\]&scope=\[fs\_scope\]'             |                                                                                                                                                                                                                                                                                                                                             |
| GET         | _/getFailureStats?name=\[function\_name\]_                                                                                                                                                                                                                                | Retrieve only failure statistics. This will return the subset of statistics for the node.                                                                                                                                                                                                                                                   |
|             | Sample API: curl -X GET http://Administrator:password@192.168.1.5:8096/getFailureStats?name=\[function\_name\] curl -X GET 'http://anyAuthedUser:password@192.168.1.5:8096/getFailureStats?name=\[function\_name\]&bucket=\[fs\_bucket\]&scope=\[fs\_scope\]'             |                                                                                                                                                                                                                                                                                                                                             |
| GET         | _/resetStatsCounters?name=\[function\_name\]_                                                                                                                                                                                                                             | Resets statistics for the provided Eventing Function.                                                                                                                                                                                                                                                                                       |
|             | Sample API: curl -X GET http://Administrator:password@192.168.1.5:8096/resetStatsCounters?appName=\[function\_name\] curl -X GET 'http://anyAuthedUser:password@192.168.1.5:8096/resetStatsCounters?appName=\[function\_name\]&bucket=\[fs\_bucket\]&scope=\[fs\_scope\]' |                                                                                                                                                                                                                                                                                                                                             |

__Table 8\. Eventing Functions API (**deprecated activation/deactivation**)__
| HTTP Method | **URI Path**                                                                                                                                                                                                                                                                                                                                                                                    | **Description**                                                                                                                                                                                                                      |
| ----------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| POST        | _/api/v1/functions/\[function\_name\]/settings_                                                                                                                                                                                                                                                                                                                                                 | Deploys an undeployed Function or resumes a paused function from its paused DCP checkpoint. Deprecated, see (basic activation/deactivation) for preferred invocation. A deploy/resume CURL example is provided for reference.        |
|             | Sample API: curl -X POST -d '{"deployment\_status":true,"processing\_status":true}' http://Administrator:password@192.168.1.5:8096/api/v1/functions/\[sample\_name\]/settings curl -X POST -d '{"deployment\_status":true,"processing\_status":true}' 'http://anyAuthedUser:password@192.168.1.5:8096/api/v1/functions/\[sample\_name\]/settings?bucket=\[fs\_bucket\]&scope=\[fs\_scope\]'     |                                                                                                                                                                                                                                      |
| POST        | _/api/v1/functions/\[function\_name\]/settings_                                                                                                                                                                                                                                                                                                                                                 | Undeploys a Function. Deprecated, see (basic activation/deactivation) for preferred invocation. An undeploy CURL example is provided for reference.                                                                                  |
|             | Sample API: curl -X POST -d '{"deployment\_status":false,"processing\_status":false}' http://Administrator:password@192.168.1.5:8096/api/v1/functions/\[sample\_name\]/settings curl -X POST -d '{"deployment\_status":false,"processing\_status":false}' 'http://anyAuthedUser:password@192.168.1.5:8096/api/v1/functions/\[sample\_name\]/settings?bucket=\[fs\_bucket\]&scope=\[fs\_scope\]' |                                                                                                                                                                                                                                      |
| POST        | _/api/v1/functions/\[function\_name\]/settings_                                                                                                                                                                                                                                                                                                                                                 | Pauses a Function and creates a DCP checkpoint such that on a subsequent resume no mutations will be lost. Deprecated, see (basic activation/deactivation) for preferred invocation. A pause CURL example is provided for reference. |
|             | Sample API: curl -X POST -d '{"deployment\_status":true,"processing\_status":false}' http://Administrator:password@192.168.1.5:8096/api/v1/functions/\[sample\_name\]/settings curl -X POST -d '{"deployment\_status":true,"processing\_status":false}' 'http://anyAuthedUser:password@192.168.1.5:8096/api/v1/functions/\[sample\_name\]/settings?bucket=\[fs\_bucket\]&scope=\[fs\_scope\]'   |                                                                                                                                                                                                                                      |