Functions

Copy a Function

Creates a copy of an existing function with a new name. The copied function will have all the same configuration, schema, and settings as the source function, but with a new name and optionally new display name and tags. The function can optionally be copied to a different environment within the same account.

POST
/v2/functions/copy
x-api-key<token>

Authenticate using API Key in request header

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

curl -X POST "https://api.bem.ai/v2/functions/copy" \  -H "Content-Type: application/json" \  -d '{    "sourceFunctionName": "invoice-processor",    "targetFunctionName": "invoice-processor-dev",    "targetEnvironment": "production",    "targetDisplayName": "Invoice Processor (Production)"  }'
{
  "functionID": "string",
  "functionName": "string",
  "versionNum": 0,
  "usedInWorkflows": [
    {
      "workflowID": "string",
      "workflowName": "string",
      "currentVersionNum": 0,
      "usedInWorkflowVersionNums": [
        0
      ]
    }
  ],
  "displayName": "string",
  "tags": [
    "string"
  ],
  "audit": {
    "functionCreatedBy": {
      "userActionID": "string",
      "userID": "string",
      "userEmail": "string",
      "apiKeyName": "string",
      "emailAddress": "string",
      "createdAt": "2019-08-24T14:15:22Z"
    },
    "functionLastUpdatedBy": {
      "userActionID": "string",
      "userID": "string",
      "userEmail": "string",
      "apiKeyName": "string",
      "emailAddress": "string",
      "createdAt": "2019-08-24T14:15:22Z"
    },
    "versionCreatedBy": {
      "userActionID": "string",
      "userID": "string",
      "userEmail": "string",
      "apiKeyName": "string",
      "emailAddress": "string",
      "createdAt": "2019-08-24T14:15:22Z"
    }
  },
  "type": "transform",
  "outputSchemaName": "string",
  "outputSchema": {},
  "emailAddress": "string",
  "tabularChunkingEnabled": true
}
{
  "message": "string",
  "code": 0,
  "details": {}
}