Update

Description

Update a template.

Request

HTTP Method: PUT

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
template_id ID of the template.
curl -X PUT \
  http://<<META.tenant.domain>>/api/v1/admin/templates/<<template_id>> \
  -H 'content-type: application/json' \
  -H 'x-user-token: <api-token>'\
  -d '{
    "name": "Name+Update",
    "description": "test+Update",
    "agent_type": "Email",
    "vendor": "API+Update",
    "product": "AP+UpdateI",
    "agent_options": {
        "mode": "extract+Update",
        "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+Update"
    }
}'

Response

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

Field description

Parameter Description
updatedAt Record update date time.
objectID Template ID.

Sample response

{
  "updatedAt": "2019-09-20T04:29:55.571Z",
  "taskID": 6055522910,
  "objectID": "447785631"
}
Was this helpful?