--- title: "Put Action" slug: "compute-cloudfunctions-v2-putaction" tags: ["Cloud Functions"] updated: 2026-09-17T10:05:57Z published: 2026-09-17T10:05:57Z canonical: "api.ncloud-docs.com/compute-cloudfunctions-v2-putaction" --- > ## Documentation Index > Fetch the complete documentation index at: https://api.ncloud-docs.com/llms.txt > Use this file to discover all available pages before exploring further. # Put Action Available in Classic and VPC Create or edit a Cloud Functions action. ## Request This section describes the request format. The method and URI are as follows: | Method | URI | | --- | --- | | PUT | /ncf/api/v2/packages/{packageName}/actions/{actionName} | Note Singapore and Japan Regions are available only in the VPC environment. ### Request headers For information about the headers common to all Cloud Functions APIs, see [Cloud Functions request headers](/docs/en/compute-cloudfunctions#%EC%9A%94%EC%B2%AD%ED%97%A4%EB%8D%94). ### Request path parameters You can use the following path parameters with your request: | Field | Type | Required | Description | | --- | --- | --- | --- | | `packageName` | String | Required | Package name - Enter 1-50 characters, including English letters, numbers, and special characters "-" and "_". - It can't start with "-". - It can't be duplicated with other resource (package, action, trigger) names. - Enter the special character "-" for actions that are not part of a package. | | `actionName` | String | Required | Action name - Enter 1-50 characters, including English letters, numbers, and special characters "-" and "_". - It can't start with "-". - It can't be duplicated with other resource (package, action, trigger) names. | ### Request query parameters You can use the following query parameters with your request: | Field | Type | Required | Description | | --- | --- | --- | --- | | `platform` | String | Optional | Platform type - `vpc` (default) \| `classic` | | `type` | String | Optional | Action type - `basic` (default) \| `web` \| `sequence` \| `sequence-web` - It can't be changed to another type | ### Request body You can include the following data in the body of your request: #### Basic/web action The following describes basic/web actions. | Field | Type | Required | Description | | --- | --- | --- | --- | | `description` | String | Optional | Action description (byte) - 0-3000 | | `parameters` | Object | Optional | Default parameters of the action - JSON in the form of `{"key" : "value"}` - Priority of applying parameters when running actions - 1st priority: Runtime parameters passed at runtime - 2nd priority: Default parameters of connected triggers - 3rd priority: Default parameters in actions - 4th priority: Default parameters of included packages | | `limits.timeout` | Integer | Required | Maximum action execution time (milliseconds) - 500-300,000 - Force terminate the action on timeout. | | `limits.memory` | Integer | Required | Maximum memory size for the action (MB) - `128` \| `256` \| `512` \| `1024` | | `exec.kind` | String | Required | Action runtime - See [Cloud Functions runtime information](https://guide.ncloud-docs.com/docs/en/cloudfunctions-spec-runtime) for options. | | `exec.imageUri` | String | Conditional | User image path - Only applicable for custom image runtimes. - `{registryName}/{imageName}:{tag}` format. - If `tag` is not entered, the default is `latest`. | | `exec.binary` | Boolean | Required | Whether the action code file is binary - `true` \| `false` - `true`: Enter the Base64-encoded value from the action code file in `exec.code`. - `false`: Enter the action code in `exec.code`. | | `exec.code` | String | Required | Action source code - Source code: Enter the code verbatim. - File attachment: Enter the action code file binary data encoded in Base64. - Need to escape when typing code directly. - Java or .NET runtime only allows file binaries. - Java can only be registered as a compressed *.jar file. - .NET (dotnet) can only be uploaded as a *.zip file (compressed file). | | `exec.main` | String | Required | Execution function | | `vpc` | Array | Required | Information about the VPC to connect: [vpc](/docs/en/compute-cloudfunctions-v2-putaction#vpc) - Only applicable for the VPC platform | | `raw-http` | Boolean | Optional | Whether to use the HTTP origin - Supported only for the web action type | | `custom-options` | Boolean | Optional | Set the HTTP header options. - Supported only for the web action type. | #### `vpc` The following describes `vpc`. | Field | Type | Required | Description | | --- | --- | --- | --- | | `vpcNo` | Integer | Required | ID of the VPC to connect | | `subnetNo` | Integer | Required | ID of subnet to connect | #### Sequence/sequence-web action The following describes sequence/sequence-web actions. | Field | Type | Required | Description | | --- | --- | --- | --- | | `description` | String | Optional | Action description (byte) - 0-3000 | | `exec.kind` | String | Required | Action type - `sequence` (fixed value) | | `exec.components` | String[] | Required | List of actions to connect to the sequence action - `{packageName}/{actionName}` format - Run in list order - When connecting an action that is not part of a package, enter the special character "-" in `packageName` | ### Request example The request example is as follows: ``` curl -X PUT 'https://cloudfunctions.apigw.ntruss.com/ncf/api/v2/packages/{packageName}/actions/{actionName}' \ --header 'Content-Type: application/json' \ --header 'x-ncp-apigw-timestamp: {Timestamp}' \ --header 'x-ncp-iam-access-key: {Sub Account Access Key}' \ --header 'x-ncp-apigw-signature-v2: {API Gateway Signature}' --data '{ "description" : "My action", "parameters": { "name": "Cloud Functions", "place": "NCloud" }, "limits": { "timeout": 60000, "memory": 128 }, "exec": { "kind": "nodejs:16", "code": "function main(params) { \nlet name = params.name || \"World\";\nlet place = params.place || \"Naver\"; \n return {payload: \"abc\"};\n}", "binary": false, "main": "main" }, "vpc": [ { "vpcNo" : ******, "subnetNo" : ***** } ] }' ``` ## Response This section describes the response format. ### Response body The response body includes the following data: #### Common fields The following describes the common fields. | Field | Type | Required | Description | | --- | --- | --- | --- | | `content` | Object | - | Action creation and modification information | | `content.name` | String | - | Action name | | `content.resourceId` | String | - | Action's resource ID | | `content.path` | String | - | Action path | | `content.description` | String | - | Action description | | `content.type` | String | - | Action type | #### Basic/web action The following describes basic/web actions. | Field | Type | Required | Description | | --- | --- | --- | --- | | `content.parameters` | Object | - | Default parameters of the action | | `content.raw-http` | Boolean | - | Whether to use the HTTP origin - Supported only for the web action type | | `content.custom-options` | Boolean | - | Set the header options. - Supported only for the web action type | | `content.exec.binary` | Boolean | - | Whether the action code is file binary | | `content.exec.code` | String | - | Action source code or Base64-encoded code file binary | | `content.exec.imageUri` | String | - | User image path - It is displayed only if the runtime is custom image | | `content.exec.kind` | String | - | Action runtime | | `content.exec.main` | String | - | Execution function | | `content.limits.memory` | Integer | - | Size of memory allocated to the action container | | `content.limits.timeout` | Integer | - | Maximum time an action can run | | `content.vpc` | Array | - | Connected VPC information: [vpc](/docs/en/compute-cloudfunctions-v2-putaction#vpc) - It is displayed only if the platform is VPC. | #### `vpc` The following describes `vpc`. | Field | Type | Required | Description | | --- | --- | --- | --- | | `vpcNo` | Integer | - | ID of the connected VPC | | `subnetNo` | Integer | - | ID of the connected subnet | #### Sequence/web-sequence action The following describes sequence/sequence-web actions. | Field | Type | Required | Description | | --- | --- | --- | --- | | `content.exec.kind` | String | - | Action type - `sequence` (fixed value) | | `content.exec.components` | String[] | - | List of connected actions | ### Response status codes For information about the HTTP status codes common to all Cloud Functions APIs, see [Cloud Functions response status codes](/docs/en/compute-cloudfunctions#%EC%9D%91%EB%8B%B5%EC%83%81%ED%83%9C%EC%BD%94%EB%93%9C). ### Response example The response example is as follows: ``` { "content": { "description": "My action", "exec": { "binary": false, "code": "function main(params) { \nlet name = params.name || \"World\";\nlet place = params.place || \"Naver\"; \n return {payload: \"abc\"};\n}", "kind": "nodejs:16", "main": "main" }, "limits": { "memory": 128, "timeout": 60000 }, "name": "myaction", "parameters": { "name": "Cloud Functions", "place": "NCloud" }, "path": "***QK06kFG8C/mypackage", "resourceId": "*****", "type": "basic", "vpc": [ { "subnetNo": ******, "vpcNo": ***** } ] } } ```