Description
Create a private template.
Request
HTTP Method: POST
Query Parameter | Description |
---|---|
name | Name of template. |
description | Template description. |
vendor | Vendor name. |
product | Product name. |
agent_type | Action Type. One of Email , Trigger , Event Transformation , IMAP , Webhook , HTTP Request , Send to Story |
agent_options | JSON object with action options. |
Path Parameter | Description |
---|---|
N/A |
curl -X POST \
https://<<META.tenant.domain>>/api/v1/admin/templates \
-H 'content-type: application/json' \
-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
Parameter | Description |
---|---|
createAt | Record creation date time. |
objectID | Template ID. |
Sample response
{
"createdAt": "2019-09-20T04:35:47.726Z",
"taskID": 6055531890,
"objectID": "120564890"
}