Description

Create a template.

Request

HTTP Method: POST

Query Parameter Description
name Name of template.
description Template description.
vendor Vendor name.
product Product name.
agent_type Agent Type. One of Email, Trigger, Event Transformation, IMAP, Webhook, HTTP Request, Send to Story
agent_options JSON object with agent options.
Path Parameter Description
N/A  

curl -X POST \
  https://<tenant-name>.tines.io/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": "",
                "regexp": "\\b[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,4}\\b",
                "to": "email_addresses"
            },
            {
                "path": "",
                "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"
}