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 | Type of action to create: Agents::EmailAgent Agents::EventTransformationAgent Agents::HTTPRequestAgent Agents::IMAPAgent Agents::TriggerAgent Agents::WebhookAgent Agents::SendToStoryAgent |
agent_options | JSON object with action options. |
curl -X POST \
https://<<META.tenant.domain>>/api/v1/admin/templates \
-H 'content-type: application/json' \
-H 'Authorization: Bearer <<CREDENTIAL.tines_api_key>>' \
-d '{
"name": "Test API Name",
"description": "test",
"agent_type": "Agents::EventTransformationAgent",
"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 the created private template.
Field description
Parameter | Description |
---|---|
id | Template ID. |
name | Template name. |
description | Template description. |
agent type | Type of action associated with the template. |
agent options | Action options. |
vendor | Vendor name. |
product | Product name. |
Sample response
{
"id": 472463921472463921,
"name": "Test API Name",
"description": "test",
"agent_type": "Agents::EventTransformationAgent",
"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"
},
"vendor": "API",
"product": "API"
}