---
updatedAt: 2025-06-09T23:18:06.000Z
agentTools:
  projectIndex: https://docs.usefomo.com/llms.txt
---

# Create a Template

Useful for building 3rd party Fomo integrations.

**Why do this?**

If you're implementing Fomo on your own site (or a client's), simply create and modify templates from the Fomo interface > Templates tab.

However, if you're building a 3rd party integration, such as one that requests a Fomo user's access token, you may prefer to build custom templates programatically, on behalf of mutual customers.

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "api-settings",
    "version": "1"
  },
  "servers": [
    {
      "url": "https://api.fomo.com/api/v1"
    }
  ],
  "security": [
    {}
  ],
  "paths": {
    "/applications/me/event_types": {
      "post": {
        "summary": "Create a Template",
        "description": "Useful for building 3rd party Fomo integrations.",
        "operationId": "create-a-template",
        "parameters": [
          {
            "name": "name",
            "in": "query",
            "description": "friendly name for user identification",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "message",
            "in": "query",
            "description": "Optional identifier, useful for preventing duplicates",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "markdown_enabled",
            "in": "query",
            "description": "Switch to enable markdown-flavored syntax for bold, italics, line breaks, etc",
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "image_url",
            "in": "query",
            "description": "optional fallback image (must link to a hosted image, ideally < 50kb)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "use_avatar",
            "in": "query",
            "description": "if set to true, an email_address parameter must be present from new Events",
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "use_ip_mapping",
            "in": "query",
            "description": "if set to true, this turns IP addresses (Event parameter) into city, state, country",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n    \"id\": 52,\n    \"event_type_tag\": \"new_lead\",\n    \"name\": \"New Lead\",\n    \"message\": \"{{ first_name }} in {{ city }} just downloaded our {{ title_with_link }} ebook {{ time_ago }}\",\n}"
                  }
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "HTTP/1.1 404 BadRequest\n{\n  \"error\": {\"message\":\"Url is not valid\"}\n}"
                  }
                }
              }
            }
          }
        },
        "deprecated": false,
        "x-readme": {
          "code-samples": [
            {
              "language": "curl",
              "code": "curl \"https://api.fomo.com/api/v1/applications/me/event_types\"\n        -H \"Content-Type: application/json\"\n        -H \"Authorization: Token {your_auth_token}\"\n        -d '{\"event_type\": {\"name\":\"New Lead\",\n               \"message\": \"{{ first_name }} in {{ city }} just downloaded our {{ title_with_link }} ebook {{ time_ago }}\", \"markdown_enabled\": true}}'\n        -X POST"
            }
          ],
          "samples-languages": [
            "curl"
          ]
        }
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": false,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true
}
```