# Create template POST https://alsona.com/rest/accounts/account_cd855c2bb1cc72097238/templates Content-Type: application/json Create a template. For `*_workflows`, include a `workflow` object. **Request body fields:** - `group` (string, required) — Template group identifier (e.g. `account_workflows`). - `workflow` (object, required for workflow templates) — Contains `name`, `description`, and `body` (nodes + edges graph). - `body.nodes` (array) — Workflow action nodes (type: `start-node` | `action-node`). - `body.edges` (array) — Connections between nodes. - `name` (string, optional on update) — Template display name. Reference: https://api.hublinks.io/alsona-api/templates/create-template ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: collection version: 1.0.0 paths: /rest/accounts/account_cd855c2bb1cc72097238/templates: post: operationId: create-template summary: Create template description: >- Create a template. For `*_workflows`, include a `workflow` object. **Request body fields:** - `group` (string, required) — Template group identifier (e.g. `account_workflows`). - `workflow` (object, required for workflow templates) — Contains `name`, `description`, and `body` (nodes + edges graph). - `body.nodes` (array) — Workflow action nodes (type: `start-node` | `action-node`). - `body.edges` (array) — Connections between nodes. - `name` (string, optional on update) — Template display name. tags: - subpackage_templates parameters: - name: group in: query required: false schema: type: string - name: X-API-KEY in: header required: true schema: type: string responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/Templates_Create template_Response_200' '400': description: Bad Request content: application/json: schema: $ref: >- #/components/schemas/PostRestAccountsAccount_cd855c2bb1cc72097238TemplatesRequestBadRequestError '401': description: Unauthorized content: application/json: schema: $ref: >- #/components/schemas/PostRestAccountsAccount_cd855c2bb1cc72097238TemplatesRequestUnauthorizedError requestBody: content: application/json: schema: $ref: '#/components/schemas/Templates_Create template_Request' servers: - url: https://alsona.com components: schemas: RestAccountsAccountCd855C2Bb1Cc72097238TemplatesPostRequestBodyContentApplicationJsonSchemaWorkflowBodyEdgesItemsData: type: object properties: isPreviewMode: type: boolean required: - isPreviewMode title: >- RestAccountsAccountCd855C2Bb1Cc72097238TemplatesPostRequestBodyContentApplicationJsonSchemaWorkflowBodyEdgesItemsData RestAccountsAccountCd855C2Bb1Cc72097238TemplatesPostRequestBodyContentApplicationJsonSchemaWorkflowBodyEdgesItemsStyle: type: object properties: opacity: type: integer required: - opacity title: >- RestAccountsAccountCd855C2Bb1Cc72097238TemplatesPostRequestBodyContentApplicationJsonSchemaWorkflowBodyEdgesItemsStyle RestAccountsAccountCd855C2Bb1Cc72097238TemplatesPostRequestBodyContentApplicationJsonSchemaWorkflowBodyEdgesItems: type: object properties: id: type: string data: $ref: >- #/components/schemas/RestAccountsAccountCd855C2Bb1Cc72097238TemplatesPostRequestBodyContentApplicationJsonSchemaWorkflowBodyEdgesItemsData type: type: string style: $ref: >- #/components/schemas/RestAccountsAccountCd855C2Bb1Cc72097238TemplatesPostRequestBodyContentApplicationJsonSchemaWorkflowBodyEdgesItemsStyle source: type: string target: type: string selectable: type: boolean required: - id - data - type - style - source - target - selectable title: >- RestAccountsAccountCd855C2Bb1Cc72097238TemplatesPostRequestBodyContentApplicationJsonSchemaWorkflowBodyEdgesItems RestAccountsAccountCd855C2Bb1Cc72097238TemplatesPostRequestBodyContentApplicationJsonSchemaWorkflowBodyNodesItemsData: type: object properties: icon: type: string title: type: string isPreviewMode: type: boolean required: - icon - title - isPreviewMode title: >- RestAccountsAccountCd855C2Bb1Cc72097238TemplatesPostRequestBodyContentApplicationJsonSchemaWorkflowBodyNodesItemsData RestAccountsAccountCd855C2Bb1Cc72097238TemplatesPostRequestBodyContentApplicationJsonSchemaWorkflowBodyNodesItemsStyle: type: object properties: opacity: type: integer required: - opacity title: >- RestAccountsAccountCd855C2Bb1Cc72097238TemplatesPostRequestBodyContentApplicationJsonSchemaWorkflowBodyNodesItemsStyle RestAccountsAccountCd855C2Bb1Cc72097238TemplatesPostRequestBodyContentApplicationJsonSchemaWorkflowBodyNodesItemsMeasured: type: object properties: width: type: integer height: type: integer required: - width - height title: >- RestAccountsAccountCd855C2Bb1Cc72097238TemplatesPostRequestBodyContentApplicationJsonSchemaWorkflowBodyNodesItemsMeasured RestAccountsAccountCd855C2Bb1Cc72097238TemplatesPostRequestBodyContentApplicationJsonSchemaWorkflowBodyNodesItemsPosition: type: object properties: x: type: integer 'y': type: integer required: - x - 'y' title: >- RestAccountsAccountCd855C2Bb1Cc72097238TemplatesPostRequestBodyContentApplicationJsonSchemaWorkflowBodyNodesItemsPosition RestAccountsAccountCd855C2Bb1Cc72097238TemplatesPostRequestBodyContentApplicationJsonSchemaWorkflowBodyNodesItems: type: object properties: id: type: string data: $ref: >- #/components/schemas/RestAccountsAccountCd855C2Bb1Cc72097238TemplatesPostRequestBodyContentApplicationJsonSchemaWorkflowBodyNodesItemsData type: type: string style: $ref: >- #/components/schemas/RestAccountsAccountCd855C2Bb1Cc72097238TemplatesPostRequestBodyContentApplicationJsonSchemaWorkflowBodyNodesItemsStyle measured: $ref: >- #/components/schemas/RestAccountsAccountCd855C2Bb1Cc72097238TemplatesPostRequestBodyContentApplicationJsonSchemaWorkflowBodyNodesItemsMeasured position: $ref: >- #/components/schemas/RestAccountsAccountCd855C2Bb1Cc72097238TemplatesPostRequestBodyContentApplicationJsonSchemaWorkflowBodyNodesItemsPosition selected: type: boolean required: - id - data - type - style - measured - position - selected title: >- RestAccountsAccountCd855C2Bb1Cc72097238TemplatesPostRequestBodyContentApplicationJsonSchemaWorkflowBodyNodesItems RestAccountsAccountCd855C2Bb1Cc72097238TemplatesPostRequestBodyContentApplicationJsonSchemaWorkflowBody: type: object properties: edges: type: array items: $ref: >- #/components/schemas/RestAccountsAccountCd855C2Bb1Cc72097238TemplatesPostRequestBodyContentApplicationJsonSchemaWorkflowBodyEdgesItems nodes: type: array items: $ref: >- #/components/schemas/RestAccountsAccountCd855C2Bb1Cc72097238TemplatesPostRequestBodyContentApplicationJsonSchemaWorkflowBodyNodesItems required: - edges - nodes title: >- RestAccountsAccountCd855C2Bb1Cc72097238TemplatesPostRequestBodyContentApplicationJsonSchemaWorkflowBody RestAccountsAccountCd855C2Bb1Cc72097238TemplatesPostRequestBodyContentApplicationJsonSchemaWorkflow: type: object properties: body: $ref: >- #/components/schemas/RestAccountsAccountCd855C2Bb1Cc72097238TemplatesPostRequestBodyContentApplicationJsonSchemaWorkflowBody name: type: string description: type: string required: - body - name - description title: >- RestAccountsAccountCd855C2Bb1Cc72097238TemplatesPostRequestBodyContentApplicationJsonSchemaWorkflow Templates_Create template_Request: type: object properties: group: type: string workflow: $ref: >- #/components/schemas/RestAccountsAccountCd855C2Bb1Cc72097238TemplatesPostRequestBodyContentApplicationJsonSchemaWorkflow required: - group - workflow title: Templates_Create template_Request RestAccountsAccountCd855C2Bb1Cc72097238TemplatesPostResponsesContentApplicationJsonSchemaTemplateWorkflowBodyEdgesItemsData: type: object properties: isPreviewMode: type: boolean required: - isPreviewMode title: >- RestAccountsAccountCd855C2Bb1Cc72097238TemplatesPostResponsesContentApplicationJsonSchemaTemplateWorkflowBodyEdgesItemsData RestAccountsAccountCd855C2Bb1Cc72097238TemplatesPostResponsesContentApplicationJsonSchemaTemplateWorkflowBodyEdgesItemsStyle: type: object properties: opacity: type: integer required: - opacity title: >- RestAccountsAccountCd855C2Bb1Cc72097238TemplatesPostResponsesContentApplicationJsonSchemaTemplateWorkflowBodyEdgesItemsStyle RestAccountsAccountCd855C2Bb1Cc72097238TemplatesPostResponsesContentApplicationJsonSchemaTemplateWorkflowBodyEdgesItems: type: object properties: id: type: string data: $ref: >- #/components/schemas/RestAccountsAccountCd855C2Bb1Cc72097238TemplatesPostResponsesContentApplicationJsonSchemaTemplateWorkflowBodyEdgesItemsData type: type: string style: $ref: >- #/components/schemas/RestAccountsAccountCd855C2Bb1Cc72097238TemplatesPostResponsesContentApplicationJsonSchemaTemplateWorkflowBodyEdgesItemsStyle source: type: string target: type: string selectable: type: boolean required: - id - data - type - style - source - target - selectable title: >- RestAccountsAccountCd855C2Bb1Cc72097238TemplatesPostResponsesContentApplicationJsonSchemaTemplateWorkflowBodyEdgesItems RestAccountsAccountCd855C2Bb1Cc72097238TemplatesPostResponsesContentApplicationJsonSchemaTemplateWorkflowBodyNodesItemsData: type: object properties: icon: type: string title: type: string isPreviewMode: type: boolean required: - icon - title - isPreviewMode title: >- RestAccountsAccountCd855C2Bb1Cc72097238TemplatesPostResponsesContentApplicationJsonSchemaTemplateWorkflowBodyNodesItemsData RestAccountsAccountCd855C2Bb1Cc72097238TemplatesPostResponsesContentApplicationJsonSchemaTemplateWorkflowBodyNodesItemsStyle: type: object properties: opacity: type: integer required: - opacity title: >- RestAccountsAccountCd855C2Bb1Cc72097238TemplatesPostResponsesContentApplicationJsonSchemaTemplateWorkflowBodyNodesItemsStyle RestAccountsAccountCd855C2Bb1Cc72097238TemplatesPostResponsesContentApplicationJsonSchemaTemplateWorkflowBodyNodesItemsMeasured: type: object properties: width: type: integer height: type: integer required: - width - height title: >- RestAccountsAccountCd855C2Bb1Cc72097238TemplatesPostResponsesContentApplicationJsonSchemaTemplateWorkflowBodyNodesItemsMeasured RestAccountsAccountCd855C2Bb1Cc72097238TemplatesPostResponsesContentApplicationJsonSchemaTemplateWorkflowBodyNodesItemsPosition: type: object properties: x: type: integer 'y': type: integer required: - x - 'y' title: >- RestAccountsAccountCd855C2Bb1Cc72097238TemplatesPostResponsesContentApplicationJsonSchemaTemplateWorkflowBodyNodesItemsPosition RestAccountsAccountCd855C2Bb1Cc72097238TemplatesPostResponsesContentApplicationJsonSchemaTemplateWorkflowBodyNodesItems: type: object properties: id: type: string data: $ref: >- #/components/schemas/RestAccountsAccountCd855C2Bb1Cc72097238TemplatesPostResponsesContentApplicationJsonSchemaTemplateWorkflowBodyNodesItemsData type: type: string style: $ref: >- #/components/schemas/RestAccountsAccountCd855C2Bb1Cc72097238TemplatesPostResponsesContentApplicationJsonSchemaTemplateWorkflowBodyNodesItemsStyle measured: $ref: >- #/components/schemas/RestAccountsAccountCd855C2Bb1Cc72097238TemplatesPostResponsesContentApplicationJsonSchemaTemplateWorkflowBodyNodesItemsMeasured position: $ref: >- #/components/schemas/RestAccountsAccountCd855C2Bb1Cc72097238TemplatesPostResponsesContentApplicationJsonSchemaTemplateWorkflowBodyNodesItemsPosition selected: type: boolean required: - id - data - type - style - measured - position - selected title: >- RestAccountsAccountCd855C2Bb1Cc72097238TemplatesPostResponsesContentApplicationJsonSchemaTemplateWorkflowBodyNodesItems RestAccountsAccountCd855C2Bb1Cc72097238TemplatesPostResponsesContentApplicationJsonSchemaTemplateWorkflowBody: type: object properties: edges: type: array items: $ref: >- #/components/schemas/RestAccountsAccountCd855C2Bb1Cc72097238TemplatesPostResponsesContentApplicationJsonSchemaTemplateWorkflowBodyEdgesItems nodes: type: array items: $ref: >- #/components/schemas/RestAccountsAccountCd855C2Bb1Cc72097238TemplatesPostResponsesContentApplicationJsonSchemaTemplateWorkflowBodyNodesItems required: - edges - nodes title: >- RestAccountsAccountCd855C2Bb1Cc72097238TemplatesPostResponsesContentApplicationJsonSchemaTemplateWorkflowBody RestAccountsAccountCd855C2Bb1Cc72097238TemplatesPostResponsesContentApplicationJsonSchemaTemplateWorkflow: type: object properties: body: $ref: >- #/components/schemas/RestAccountsAccountCd855C2Bb1Cc72097238TemplatesPostResponsesContentApplicationJsonSchemaTemplateWorkflowBody name: type: string description: type: string required: - body - name - description title: >- RestAccountsAccountCd855C2Bb1Cc72097238TemplatesPostResponsesContentApplicationJsonSchemaTemplateWorkflow RestAccountsAccountCd855C2Bb1Cc72097238TemplatesPostResponsesContentApplicationJsonSchemaTemplate: type: object properties: group: type: string workflow: $ref: >- #/components/schemas/RestAccountsAccountCd855C2Bb1Cc72097238TemplatesPostResponsesContentApplicationJsonSchemaTemplateWorkflow account_id: type: string created_at: type: integer template_id: type: string required: - group - workflow - account_id - created_at - template_id title: >- RestAccountsAccountCd855C2Bb1Cc72097238TemplatesPostResponsesContentApplicationJsonSchemaTemplate Templates_Create template_Response_200: type: object properties: success: type: boolean template: $ref: >- #/components/schemas/RestAccountsAccountCd855C2Bb1Cc72097238TemplatesPostResponsesContentApplicationJsonSchemaTemplate ignored_keys: type: array items: type: string required: - success - template - ignored_keys title: Templates_Create template_Response_200 PostRestAccountsAccount_cd855c2bb1cc72097238TemplatesRequestBadRequestError: type: object properties: error: type: string message: type: string required: - error - message title: >- PostRestAccountsAccount_cd855c2bb1cc72097238TemplatesRequestBadRequestError PostRestAccountsAccount_cd855c2bb1cc72097238TemplatesRequestUnauthorizedError: type: object properties: error: type: string message: type: string required: - error - message title: >- PostRestAccountsAccount_cd855c2bb1cc72097238TemplatesRequestUnauthorizedError securitySchemes: apiKeyAuth: type: apiKey in: header name: X-API-KEY ``` ## SDK Code Examples ```python Templates_Create template_example import requests url = "https://alsona.com/rest/accounts/account_cd855c2bb1cc72097238/templates" querystring = {"group":"account_workflows"} payload = { "group": "account_workflows", "workflow": { "body": { "edges": [ { "id": "edge-6701c7f8-c0df716b6632", "data": { "isPreviewMode": False }, "type": "workflow", "style": { "opacity": 1 }, "source": "start-node", "target": "node-58f338b0-dd155247e1b2", "selectable": False }, { "id": "edge-f6e2a7c0-febf9b4ce4dd", "data": { "isPreviewMode": False }, "type": "workflow", "style": { "opacity": 1 }, "source": "node-58f338b0-dd155247e1b2", "target": "node-6826a837-aefd401b1cfe", "selectable": False }, { "id": "edge-41608b56-66f8a0405c97", "data": { "isPreviewMode": False }, "type": "workflow", "style": { "opacity": 1 }, "source": "node-6826a837-aefd401b1cfe", "target": "node-8a14ea89-be3a281b9686", "selectable": False }, { "id": "edge-1fdfafb4-b83436b59c39", "data": { "isPreviewMode": False }, "type": "workflow", "style": { "opacity": 1 }, "source": "node-8a14ea89-be3a281b9686", "target": "node-dbb52df8-87a460d9578e", "selectable": False } ], "nodes": [ { "id": "start-node", "data": { "icon": "FaRegPaperPlane", "title": "Once it begins...", "isPreviewMode": False }, "type": "start-node", "style": { "opacity": 1 }, "measured": { "width": 200, "height": 45 }, "position": { "x": 87, "y": 12 }, "selected": False }, { "id": "node-58f338b0-dd155247e1b2", "data": { "icon": "string", "title": "View profile", "isPreviewMode": False, "action": "ln_profile_view" }, "type": "action-node", "style": { "opacity": 1 }, "measured": { "width": 280, "height": 74 }, "position": { "x": 87, "y": 212 }, "selected": False }, { "id": "node-6826a837-aefd401b1cfe", "data": { "icon": "string", "title": "Follow profile", "isPreviewMode": False, "delay": 24, "action": "ln_profile_follow" }, "type": "action-node", "style": { "opacity": 1 }, "measured": { "width": 280, "height": 74 }, "position": { "x": 87, "y": 412 }, "selected": False }, { "id": "node-8a14ea89-be3a281b9686", "data": { "icon": "string", "title": "Like post", "isPreviewMode": False, "delay": 24, "action": "ln_profile_like_post", "variants": [ { "body": "", "name": "Variant A" } ] }, "type": "action-node", "style": { "opacity": 1 }, "measured": { "width": 280, "height": 74 }, "position": { "x": 87, "y": 612 }, "selected": True }, { "id": "node-dbb52df8-87a460d9578e", "data": { "icon": "string", "title": "View profile", "isPreviewMode": False, "delay": 24, "action": "ln_profile_view" }, "type": "action-node", "style": { "opacity": 1 }, "measured": { "width": 280, "height": 74 }, "position": { "x": 87, "y": 812 }, "selected": True } ] }, "name": "Profile Magnet Updated", "description": "Profile Magnet Updated" } } headers = { "X-API-KEY": "", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers, params=querystring) print(response.json()) ``` ```javascript Templates_Create template_example const url = 'https://alsona.com/rest/accounts/account_cd855c2bb1cc72097238/templates?group=account_workflows'; const options = { method: 'POST', headers: {'X-API-KEY': '', 'Content-Type': 'application/json'}, body: '{"group":"account_workflows","workflow":{"body":{"edges":[{"id":"edge-6701c7f8-c0df716b6632","data":{"isPreviewMode":false},"type":"workflow","style":{"opacity":1},"source":"start-node","target":"node-58f338b0-dd155247e1b2","selectable":false},{"id":"edge-f6e2a7c0-febf9b4ce4dd","data":{"isPreviewMode":false},"type":"workflow","style":{"opacity":1},"source":"node-58f338b0-dd155247e1b2","target":"node-6826a837-aefd401b1cfe","selectable":false},{"id":"edge-41608b56-66f8a0405c97","data":{"isPreviewMode":false},"type":"workflow","style":{"opacity":1},"source":"node-6826a837-aefd401b1cfe","target":"node-8a14ea89-be3a281b9686","selectable":false},{"id":"edge-1fdfafb4-b83436b59c39","data":{"isPreviewMode":false},"type":"workflow","style":{"opacity":1},"source":"node-8a14ea89-be3a281b9686","target":"node-dbb52df8-87a460d9578e","selectable":false}],"nodes":[{"id":"start-node","data":{"icon":"FaRegPaperPlane","title":"Once it begins...","isPreviewMode":false},"type":"start-node","style":{"opacity":1},"measured":{"width":200,"height":45},"position":{"x":87,"y":12},"selected":false},{"id":"node-58f338b0-dd155247e1b2","data":{"icon":"string","title":"View profile","isPreviewMode":false,"action":"ln_profile_view"},"type":"action-node","style":{"opacity":1},"measured":{"width":280,"height":74},"position":{"x":87,"y":212},"selected":false},{"id":"node-6826a837-aefd401b1cfe","data":{"icon":"string","title":"Follow profile","isPreviewMode":false,"delay":24,"action":"ln_profile_follow"},"type":"action-node","style":{"opacity":1},"measured":{"width":280,"height":74},"position":{"x":87,"y":412},"selected":false},{"id":"node-8a14ea89-be3a281b9686","data":{"icon":"string","title":"Like post","isPreviewMode":false,"delay":24,"action":"ln_profile_like_post","variants":[{"body":"","name":"Variant A"}]},"type":"action-node","style":{"opacity":1},"measured":{"width":280,"height":74},"position":{"x":87,"y":612},"selected":true},{"id":"node-dbb52df8-87a460d9578e","data":{"icon":"string","title":"View profile","isPreviewMode":false,"delay":24,"action":"ln_profile_view"},"type":"action-node","style":{"opacity":1},"measured":{"width":280,"height":74},"position":{"x":87,"y":812},"selected":true}]},"name":"Profile Magnet Updated","description":"Profile Magnet Updated"}}' }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go Templates_Create template_example package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://alsona.com/rest/accounts/account_cd855c2bb1cc72097238/templates?group=account_workflows" payload := strings.NewReader("{\n \"group\": \"account_workflows\",\n \"workflow\": {\n \"body\": {\n \"edges\": [\n {\n \"id\": \"edge-6701c7f8-c0df716b6632\",\n \"data\": {\n \"isPreviewMode\": false\n },\n \"type\": \"workflow\",\n \"style\": {\n \"opacity\": 1\n },\n \"source\": \"start-node\",\n \"target\": \"node-58f338b0-dd155247e1b2\",\n \"selectable\": false\n },\n {\n \"id\": \"edge-f6e2a7c0-febf9b4ce4dd\",\n \"data\": {\n \"isPreviewMode\": false\n },\n \"type\": \"workflow\",\n \"style\": {\n \"opacity\": 1\n },\n \"source\": \"node-58f338b0-dd155247e1b2\",\n \"target\": \"node-6826a837-aefd401b1cfe\",\n \"selectable\": false\n },\n {\n \"id\": \"edge-41608b56-66f8a0405c97\",\n \"data\": {\n \"isPreviewMode\": false\n },\n \"type\": \"workflow\",\n \"style\": {\n \"opacity\": 1\n },\n \"source\": \"node-6826a837-aefd401b1cfe\",\n \"target\": \"node-8a14ea89-be3a281b9686\",\n \"selectable\": false\n },\n {\n \"id\": \"edge-1fdfafb4-b83436b59c39\",\n \"data\": {\n \"isPreviewMode\": false\n },\n \"type\": \"workflow\",\n \"style\": {\n \"opacity\": 1\n },\n \"source\": \"node-8a14ea89-be3a281b9686\",\n \"target\": \"node-dbb52df8-87a460d9578e\",\n \"selectable\": false\n }\n ],\n \"nodes\": [\n {\n \"id\": \"start-node\",\n \"data\": {\n \"icon\": \"FaRegPaperPlane\",\n \"title\": \"Once it begins...\",\n \"isPreviewMode\": false\n },\n \"type\": \"start-node\",\n \"style\": {\n \"opacity\": 1\n },\n \"measured\": {\n \"width\": 200,\n \"height\": 45\n },\n \"position\": {\n \"x\": 87,\n \"y\": 12\n },\n \"selected\": false\n },\n {\n \"id\": \"node-58f338b0-dd155247e1b2\",\n \"data\": {\n \"icon\": \"string\",\n \"title\": \"View profile\",\n \"isPreviewMode\": false,\n \"action\": \"ln_profile_view\"\n },\n \"type\": \"action-node\",\n \"style\": {\n \"opacity\": 1\n },\n \"measured\": {\n \"width\": 280,\n \"height\": 74\n },\n \"position\": {\n \"x\": 87,\n \"y\": 212\n },\n \"selected\": false\n },\n {\n \"id\": \"node-6826a837-aefd401b1cfe\",\n \"data\": {\n \"icon\": \"string\",\n \"title\": \"Follow profile\",\n \"isPreviewMode\": false,\n \"delay\": 24,\n \"action\": \"ln_profile_follow\"\n },\n \"type\": \"action-node\",\n \"style\": {\n \"opacity\": 1\n },\n \"measured\": {\n \"width\": 280,\n \"height\": 74\n },\n \"position\": {\n \"x\": 87,\n \"y\": 412\n },\n \"selected\": false\n },\n {\n \"id\": \"node-8a14ea89-be3a281b9686\",\n \"data\": {\n \"icon\": \"string\",\n \"title\": \"Like post\",\n \"isPreviewMode\": false,\n \"delay\": 24,\n \"action\": \"ln_profile_like_post\",\n \"variants\": [\n {\n \"body\": \"\",\n \"name\": \"Variant A\"\n }\n ]\n },\n \"type\": \"action-node\",\n \"style\": {\n \"opacity\": 1\n },\n \"measured\": {\n \"width\": 280,\n \"height\": 74\n },\n \"position\": {\n \"x\": 87,\n \"y\": 612\n },\n \"selected\": true\n },\n {\n \"id\": \"node-dbb52df8-87a460d9578e\",\n \"data\": {\n \"icon\": \"string\",\n \"title\": \"View profile\",\n \"isPreviewMode\": false,\n \"delay\": 24,\n \"action\": \"ln_profile_view\"\n },\n \"type\": \"action-node\",\n \"style\": {\n \"opacity\": 1\n },\n \"measured\": {\n \"width\": 280,\n \"height\": 74\n },\n \"position\": {\n \"x\": 87,\n \"y\": 812\n },\n \"selected\": true\n }\n ]\n },\n \"name\": \"Profile Magnet Updated\",\n \"description\": \"Profile Magnet Updated\"\n }\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("X-API-KEY", "") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby Templates_Create template_example require 'uri' require 'net/http' url = URI("https://alsona.com/rest/accounts/account_cd855c2bb1cc72097238/templates?group=account_workflows") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["X-API-KEY"] = '' request["Content-Type"] = 'application/json' request.body = "{\n \"group\": \"account_workflows\",\n \"workflow\": {\n \"body\": {\n \"edges\": [\n {\n \"id\": \"edge-6701c7f8-c0df716b6632\",\n \"data\": {\n \"isPreviewMode\": false\n },\n \"type\": \"workflow\",\n \"style\": {\n \"opacity\": 1\n },\n \"source\": \"start-node\",\n \"target\": \"node-58f338b0-dd155247e1b2\",\n \"selectable\": false\n },\n {\n \"id\": \"edge-f6e2a7c0-febf9b4ce4dd\",\n \"data\": {\n \"isPreviewMode\": false\n },\n \"type\": \"workflow\",\n \"style\": {\n \"opacity\": 1\n },\n \"source\": \"node-58f338b0-dd155247e1b2\",\n \"target\": \"node-6826a837-aefd401b1cfe\",\n \"selectable\": false\n },\n {\n \"id\": \"edge-41608b56-66f8a0405c97\",\n \"data\": {\n \"isPreviewMode\": false\n },\n \"type\": \"workflow\",\n \"style\": {\n \"opacity\": 1\n },\n \"source\": \"node-6826a837-aefd401b1cfe\",\n \"target\": \"node-8a14ea89-be3a281b9686\",\n \"selectable\": false\n },\n {\n \"id\": \"edge-1fdfafb4-b83436b59c39\",\n \"data\": {\n \"isPreviewMode\": false\n },\n \"type\": \"workflow\",\n \"style\": {\n \"opacity\": 1\n },\n \"source\": \"node-8a14ea89-be3a281b9686\",\n \"target\": \"node-dbb52df8-87a460d9578e\",\n \"selectable\": false\n }\n ],\n \"nodes\": [\n {\n \"id\": \"start-node\",\n \"data\": {\n \"icon\": \"FaRegPaperPlane\",\n \"title\": \"Once it begins...\",\n \"isPreviewMode\": false\n },\n \"type\": \"start-node\",\n \"style\": {\n \"opacity\": 1\n },\n \"measured\": {\n \"width\": 200,\n \"height\": 45\n },\n \"position\": {\n \"x\": 87,\n \"y\": 12\n },\n \"selected\": false\n },\n {\n \"id\": \"node-58f338b0-dd155247e1b2\",\n \"data\": {\n \"icon\": \"string\",\n \"title\": \"View profile\",\n \"isPreviewMode\": false,\n \"action\": \"ln_profile_view\"\n },\n \"type\": \"action-node\",\n \"style\": {\n \"opacity\": 1\n },\n \"measured\": {\n \"width\": 280,\n \"height\": 74\n },\n \"position\": {\n \"x\": 87,\n \"y\": 212\n },\n \"selected\": false\n },\n {\n \"id\": \"node-6826a837-aefd401b1cfe\",\n \"data\": {\n \"icon\": \"string\",\n \"title\": \"Follow profile\",\n \"isPreviewMode\": false,\n \"delay\": 24,\n \"action\": \"ln_profile_follow\"\n },\n \"type\": \"action-node\",\n \"style\": {\n \"opacity\": 1\n },\n \"measured\": {\n \"width\": 280,\n \"height\": 74\n },\n \"position\": {\n \"x\": 87,\n \"y\": 412\n },\n \"selected\": false\n },\n {\n \"id\": \"node-8a14ea89-be3a281b9686\",\n \"data\": {\n \"icon\": \"string\",\n \"title\": \"Like post\",\n \"isPreviewMode\": false,\n \"delay\": 24,\n \"action\": \"ln_profile_like_post\",\n \"variants\": [\n {\n \"body\": \"\",\n \"name\": \"Variant A\"\n }\n ]\n },\n \"type\": \"action-node\",\n \"style\": {\n \"opacity\": 1\n },\n \"measured\": {\n \"width\": 280,\n \"height\": 74\n },\n \"position\": {\n \"x\": 87,\n \"y\": 612\n },\n \"selected\": true\n },\n {\n \"id\": \"node-dbb52df8-87a460d9578e\",\n \"data\": {\n \"icon\": \"string\",\n \"title\": \"View profile\",\n \"isPreviewMode\": false,\n \"delay\": 24,\n \"action\": \"ln_profile_view\"\n },\n \"type\": \"action-node\",\n \"style\": {\n \"opacity\": 1\n },\n \"measured\": {\n \"width\": 280,\n \"height\": 74\n },\n \"position\": {\n \"x\": 87,\n \"y\": 812\n },\n \"selected\": true\n }\n ]\n },\n \"name\": \"Profile Magnet Updated\",\n \"description\": \"Profile Magnet Updated\"\n }\n}" response = http.request(request) puts response.read_body ``` ```java Templates_Create template_example import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://alsona.com/rest/accounts/account_cd855c2bb1cc72097238/templates?group=account_workflows") .header("X-API-KEY", "") .header("Content-Type", "application/json") .body("{\n \"group\": \"account_workflows\",\n \"workflow\": {\n \"body\": {\n \"edges\": [\n {\n \"id\": \"edge-6701c7f8-c0df716b6632\",\n \"data\": {\n \"isPreviewMode\": false\n },\n \"type\": \"workflow\",\n \"style\": {\n \"opacity\": 1\n },\n \"source\": \"start-node\",\n \"target\": \"node-58f338b0-dd155247e1b2\",\n \"selectable\": false\n },\n {\n \"id\": \"edge-f6e2a7c0-febf9b4ce4dd\",\n \"data\": {\n \"isPreviewMode\": false\n },\n \"type\": \"workflow\",\n \"style\": {\n \"opacity\": 1\n },\n \"source\": \"node-58f338b0-dd155247e1b2\",\n \"target\": \"node-6826a837-aefd401b1cfe\",\n \"selectable\": false\n },\n {\n \"id\": \"edge-41608b56-66f8a0405c97\",\n \"data\": {\n \"isPreviewMode\": false\n },\n \"type\": \"workflow\",\n \"style\": {\n \"opacity\": 1\n },\n \"source\": \"node-6826a837-aefd401b1cfe\",\n \"target\": \"node-8a14ea89-be3a281b9686\",\n \"selectable\": false\n },\n {\n \"id\": \"edge-1fdfafb4-b83436b59c39\",\n \"data\": {\n \"isPreviewMode\": false\n },\n \"type\": \"workflow\",\n \"style\": {\n \"opacity\": 1\n },\n \"source\": \"node-8a14ea89-be3a281b9686\",\n \"target\": \"node-dbb52df8-87a460d9578e\",\n \"selectable\": false\n }\n ],\n \"nodes\": [\n {\n \"id\": \"start-node\",\n \"data\": {\n \"icon\": \"FaRegPaperPlane\",\n \"title\": \"Once it begins...\",\n \"isPreviewMode\": false\n },\n \"type\": \"start-node\",\n \"style\": {\n \"opacity\": 1\n },\n \"measured\": {\n \"width\": 200,\n \"height\": 45\n },\n \"position\": {\n \"x\": 87,\n \"y\": 12\n },\n \"selected\": false\n },\n {\n \"id\": \"node-58f338b0-dd155247e1b2\",\n \"data\": {\n \"icon\": \"string\",\n \"title\": \"View profile\",\n \"isPreviewMode\": false,\n \"action\": \"ln_profile_view\"\n },\n \"type\": \"action-node\",\n \"style\": {\n \"opacity\": 1\n },\n \"measured\": {\n \"width\": 280,\n \"height\": 74\n },\n \"position\": {\n \"x\": 87,\n \"y\": 212\n },\n \"selected\": false\n },\n {\n \"id\": \"node-6826a837-aefd401b1cfe\",\n \"data\": {\n \"icon\": \"string\",\n \"title\": \"Follow profile\",\n \"isPreviewMode\": false,\n \"delay\": 24,\n \"action\": \"ln_profile_follow\"\n },\n \"type\": \"action-node\",\n \"style\": {\n \"opacity\": 1\n },\n \"measured\": {\n \"width\": 280,\n \"height\": 74\n },\n \"position\": {\n \"x\": 87,\n \"y\": 412\n },\n \"selected\": false\n },\n {\n \"id\": \"node-8a14ea89-be3a281b9686\",\n \"data\": {\n \"icon\": \"string\",\n \"title\": \"Like post\",\n \"isPreviewMode\": false,\n \"delay\": 24,\n \"action\": \"ln_profile_like_post\",\n \"variants\": [\n {\n \"body\": \"\",\n \"name\": \"Variant A\"\n }\n ]\n },\n \"type\": \"action-node\",\n \"style\": {\n \"opacity\": 1\n },\n \"measured\": {\n \"width\": 280,\n \"height\": 74\n },\n \"position\": {\n \"x\": 87,\n \"y\": 612\n },\n \"selected\": true\n },\n {\n \"id\": \"node-dbb52df8-87a460d9578e\",\n \"data\": {\n \"icon\": \"string\",\n \"title\": \"View profile\",\n \"isPreviewMode\": false,\n \"delay\": 24,\n \"action\": \"ln_profile_view\"\n },\n \"type\": \"action-node\",\n \"style\": {\n \"opacity\": 1\n },\n \"measured\": {\n \"width\": 280,\n \"height\": 74\n },\n \"position\": {\n \"x\": 87,\n \"y\": 812\n },\n \"selected\": true\n }\n ]\n },\n \"name\": \"Profile Magnet Updated\",\n \"description\": \"Profile Magnet Updated\"\n }\n}") .asString(); ``` ```php Templates_Create template_example request('POST', 'https://alsona.com/rest/accounts/account_cd855c2bb1cc72097238/templates?group=account_workflows', [ 'body' => '{ "group": "account_workflows", "workflow": { "body": { "edges": [ { "id": "edge-6701c7f8-c0df716b6632", "data": { "isPreviewMode": false }, "type": "workflow", "style": { "opacity": 1 }, "source": "start-node", "target": "node-58f338b0-dd155247e1b2", "selectable": false }, { "id": "edge-f6e2a7c0-febf9b4ce4dd", "data": { "isPreviewMode": false }, "type": "workflow", "style": { "opacity": 1 }, "source": "node-58f338b0-dd155247e1b2", "target": "node-6826a837-aefd401b1cfe", "selectable": false }, { "id": "edge-41608b56-66f8a0405c97", "data": { "isPreviewMode": false }, "type": "workflow", "style": { "opacity": 1 }, "source": "node-6826a837-aefd401b1cfe", "target": "node-8a14ea89-be3a281b9686", "selectable": false }, { "id": "edge-1fdfafb4-b83436b59c39", "data": { "isPreviewMode": false }, "type": "workflow", "style": { "opacity": 1 }, "source": "node-8a14ea89-be3a281b9686", "target": "node-dbb52df8-87a460d9578e", "selectable": false } ], "nodes": [ { "id": "start-node", "data": { "icon": "FaRegPaperPlane", "title": "Once it begins...", "isPreviewMode": false }, "type": "start-node", "style": { "opacity": 1 }, "measured": { "width": 200, "height": 45 }, "position": { "x": 87, "y": 12 }, "selected": false }, { "id": "node-58f338b0-dd155247e1b2", "data": { "icon": "string", "title": "View profile", "isPreviewMode": false, "action": "ln_profile_view" }, "type": "action-node", "style": { "opacity": 1 }, "measured": { "width": 280, "height": 74 }, "position": { "x": 87, "y": 212 }, "selected": false }, { "id": "node-6826a837-aefd401b1cfe", "data": { "icon": "string", "title": "Follow profile", "isPreviewMode": false, "delay": 24, "action": "ln_profile_follow" }, "type": "action-node", "style": { "opacity": 1 }, "measured": { "width": 280, "height": 74 }, "position": { "x": 87, "y": 412 }, "selected": false }, { "id": "node-8a14ea89-be3a281b9686", "data": { "icon": "string", "title": "Like post", "isPreviewMode": false, "delay": 24, "action": "ln_profile_like_post", "variants": [ { "body": "", "name": "Variant A" } ] }, "type": "action-node", "style": { "opacity": 1 }, "measured": { "width": 280, "height": 74 }, "position": { "x": 87, "y": 612 }, "selected": true }, { "id": "node-dbb52df8-87a460d9578e", "data": { "icon": "string", "title": "View profile", "isPreviewMode": false, "delay": 24, "action": "ln_profile_view" }, "type": "action-node", "style": { "opacity": 1 }, "measured": { "width": 280, "height": 74 }, "position": { "x": 87, "y": 812 }, "selected": true } ] }, "name": "Profile Magnet Updated", "description": "Profile Magnet Updated" } }', 'headers' => [ 'Content-Type' => 'application/json', 'X-API-KEY' => '', ], ]); echo $response->getBody(); ``` ```csharp Templates_Create template_example using RestSharp; var client = new RestClient("https://alsona.com/rest/accounts/account_cd855c2bb1cc72097238/templates?group=account_workflows"); var request = new RestRequest(Method.POST); request.AddHeader("X-API-KEY", ""); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"group\": \"account_workflows\",\n \"workflow\": {\n \"body\": {\n \"edges\": [\n {\n \"id\": \"edge-6701c7f8-c0df716b6632\",\n \"data\": {\n \"isPreviewMode\": false\n },\n \"type\": \"workflow\",\n \"style\": {\n \"opacity\": 1\n },\n \"source\": \"start-node\",\n \"target\": \"node-58f338b0-dd155247e1b2\",\n \"selectable\": false\n },\n {\n \"id\": \"edge-f6e2a7c0-febf9b4ce4dd\",\n \"data\": {\n \"isPreviewMode\": false\n },\n \"type\": \"workflow\",\n \"style\": {\n \"opacity\": 1\n },\n \"source\": \"node-58f338b0-dd155247e1b2\",\n \"target\": \"node-6826a837-aefd401b1cfe\",\n \"selectable\": false\n },\n {\n \"id\": \"edge-41608b56-66f8a0405c97\",\n \"data\": {\n \"isPreviewMode\": false\n },\n \"type\": \"workflow\",\n \"style\": {\n \"opacity\": 1\n },\n \"source\": \"node-6826a837-aefd401b1cfe\",\n \"target\": \"node-8a14ea89-be3a281b9686\",\n \"selectable\": false\n },\n {\n \"id\": \"edge-1fdfafb4-b83436b59c39\",\n \"data\": {\n \"isPreviewMode\": false\n },\n \"type\": \"workflow\",\n \"style\": {\n \"opacity\": 1\n },\n \"source\": \"node-8a14ea89-be3a281b9686\",\n \"target\": \"node-dbb52df8-87a460d9578e\",\n \"selectable\": false\n }\n ],\n \"nodes\": [\n {\n \"id\": \"start-node\",\n \"data\": {\n \"icon\": \"FaRegPaperPlane\",\n \"title\": \"Once it begins...\",\n \"isPreviewMode\": false\n },\n \"type\": \"start-node\",\n \"style\": {\n \"opacity\": 1\n },\n \"measured\": {\n \"width\": 200,\n \"height\": 45\n },\n \"position\": {\n \"x\": 87,\n \"y\": 12\n },\n \"selected\": false\n },\n {\n \"id\": \"node-58f338b0-dd155247e1b2\",\n \"data\": {\n \"icon\": \"string\",\n \"title\": \"View profile\",\n \"isPreviewMode\": false,\n \"action\": \"ln_profile_view\"\n },\n \"type\": \"action-node\",\n \"style\": {\n \"opacity\": 1\n },\n \"measured\": {\n \"width\": 280,\n \"height\": 74\n },\n \"position\": {\n \"x\": 87,\n \"y\": 212\n },\n \"selected\": false\n },\n {\n \"id\": \"node-6826a837-aefd401b1cfe\",\n \"data\": {\n \"icon\": \"string\",\n \"title\": \"Follow profile\",\n \"isPreviewMode\": false,\n \"delay\": 24,\n \"action\": \"ln_profile_follow\"\n },\n \"type\": \"action-node\",\n \"style\": {\n \"opacity\": 1\n },\n \"measured\": {\n \"width\": 280,\n \"height\": 74\n },\n \"position\": {\n \"x\": 87,\n \"y\": 412\n },\n \"selected\": false\n },\n {\n \"id\": \"node-8a14ea89-be3a281b9686\",\n \"data\": {\n \"icon\": \"string\",\n \"title\": \"Like post\",\n \"isPreviewMode\": false,\n \"delay\": 24,\n \"action\": \"ln_profile_like_post\",\n \"variants\": [\n {\n \"body\": \"\",\n \"name\": \"Variant A\"\n }\n ]\n },\n \"type\": \"action-node\",\n \"style\": {\n \"opacity\": 1\n },\n \"measured\": {\n \"width\": 280,\n \"height\": 74\n },\n \"position\": {\n \"x\": 87,\n \"y\": 612\n },\n \"selected\": true\n },\n {\n \"id\": \"node-dbb52df8-87a460d9578e\",\n \"data\": {\n \"icon\": \"string\",\n \"title\": \"View profile\",\n \"isPreviewMode\": false,\n \"delay\": 24,\n \"action\": \"ln_profile_view\"\n },\n \"type\": \"action-node\",\n \"style\": {\n \"opacity\": 1\n },\n \"measured\": {\n \"width\": 280,\n \"height\": 74\n },\n \"position\": {\n \"x\": 87,\n \"y\": 812\n },\n \"selected\": true\n }\n ]\n },\n \"name\": \"Profile Magnet Updated\",\n \"description\": \"Profile Magnet Updated\"\n }\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift Templates_Create template_example import Foundation let headers = [ "X-API-KEY": "", "Content-Type": "application/json" ] let parameters = [ "group": "account_workflows", "workflow": [ "body": [ "edges": [ [ "id": "edge-6701c7f8-c0df716b6632", "data": ["isPreviewMode": false], "type": "workflow", "style": ["opacity": 1], "source": "start-node", "target": "node-58f338b0-dd155247e1b2", "selectable": false ], [ "id": "edge-f6e2a7c0-febf9b4ce4dd", "data": ["isPreviewMode": false], "type": "workflow", "style": ["opacity": 1], "source": "node-58f338b0-dd155247e1b2", "target": "node-6826a837-aefd401b1cfe", "selectable": false ], [ "id": "edge-41608b56-66f8a0405c97", "data": ["isPreviewMode": false], "type": "workflow", "style": ["opacity": 1], "source": "node-6826a837-aefd401b1cfe", "target": "node-8a14ea89-be3a281b9686", "selectable": false ], [ "id": "edge-1fdfafb4-b83436b59c39", "data": ["isPreviewMode": false], "type": "workflow", "style": ["opacity": 1], "source": "node-8a14ea89-be3a281b9686", "target": "node-dbb52df8-87a460d9578e", "selectable": false ] ], "nodes": [ [ "id": "start-node", "data": [ "icon": "FaRegPaperPlane", "title": "Once it begins...", "isPreviewMode": false ], "type": "start-node", "style": ["opacity": 1], "measured": [ "width": 200, "height": 45 ], "position": [ "x": 87, "y": 12 ], "selected": false ], [ "id": "node-58f338b0-dd155247e1b2", "data": [ "icon": "string", "title": "View profile", "isPreviewMode": false, "action": "ln_profile_view" ], "type": "action-node", "style": ["opacity": 1], "measured": [ "width": 280, "height": 74 ], "position": [ "x": 87, "y": 212 ], "selected": false ], [ "id": "node-6826a837-aefd401b1cfe", "data": [ "icon": "string", "title": "Follow profile", "isPreviewMode": false, "delay": 24, "action": "ln_profile_follow" ], "type": "action-node", "style": ["opacity": 1], "measured": [ "width": 280, "height": 74 ], "position": [ "x": 87, "y": 412 ], "selected": false ], [ "id": "node-8a14ea89-be3a281b9686", "data": [ "icon": "string", "title": "Like post", "isPreviewMode": false, "delay": 24, "action": "ln_profile_like_post", "variants": [ [ "body": "", "name": "Variant A" ] ] ], "type": "action-node", "style": ["opacity": 1], "measured": [ "width": 280, "height": 74 ], "position": [ "x": 87, "y": 612 ], "selected": true ], [ "id": "node-dbb52df8-87a460d9578e", "data": [ "icon": "string", "title": "View profile", "isPreviewMode": false, "delay": 24, "action": "ln_profile_view" ], "type": "action-node", "style": ["opacity": 1], "measured": [ "width": 280, "height": 74 ], "position": [ "x": 87, "y": 812 ], "selected": true ] ] ], "name": "Profile Magnet Updated", "description": "Profile Magnet Updated" ] ] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://alsona.com/rest/accounts/account_cd855c2bb1cc72097238/templates?group=account_workflows")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" request.allHTTPHeaderFields = headers request.httpBody = postData as Data let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ```