Skip to main content

Create

Description#

Create a private template.

Request#

HTTP Method: POST

Query ParameterDescription
nameName of template.
descriptionTemplate description.
vendorVendor name.
productProduct name.
agent_typeAction Type. One of Email, Trigger, Event Transformation, IMAP, Webhook, HTTP Request, Send to Story
agent_optionsJSON object with action options.
Path ParameterDescription
N/A

curl -X POST \  https://<tenant-domain>/api/v1/admin/templates \  -H 'content-type: application/json' \  -H 'x-user-email: <email-address>' \  -H 'x-user-token: <api-token>' \  -d '{    "name": "Test API Name",    "description": "test",    "agent_type": "Event Transformation",    "vendor": "API",    "product": "API",    "agent_options": {        "mode": "extract",        "matchers": [            {                "path": "{{.text}}",                "regexp": "\\b[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,4}\\b",                "to": "email_addresses"            },            {                "path": "{{.text}}",                "regexp": "https?:\\/\\/[\\S]+",                "to": "urls"            }        ],        "message": "This is an optional message"    }  }  '

Response#

A successful request will return a JSON object containing a template ID.

Field description#

ParameterDescription
createAtRecord creation date time.
objectIDTemplate ID.

Sample response#

{  "createdAt": "2019-09-20T04:35:47.726Z",  "taskID": 6055531890,  "objectID": "120564890"}