---
title: "Create Event Definition"
method: POST
path: "/peopleevents/2/definitions"
tags: ["customer-engagement", "people", "events"]
---

# Create Event Definition

`POST /peopleevents/2/definitions`

## Request

- Base URL: `https://api.infobip.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.infobip.com/peopleevents/2/definitions`
- Auth: one of:
  - HTTP basic
  - API key in header `Authorization`
  - API key in header `Authorization`
  - OAuth 2
    - Client credentials
    - Token URL: `https://api.infobip.com/auth/1/oauth2/token`

Create a new custom event definition either from scratch or from a template. When creating from scratch, specify a unique definition ID (alphanumeric only, max `36` characters), title, description, and up to `120` fields. When using a template, only provide the template ID and optional additional fields—the title, description, and default fields are inherited from the template. Supports various field types including `String`, `Boolean`, `DateTime`, `Numeric`, `Decimal`, and `List` (with nested object schema).

## Request body

- B3ed157de85ce51bb7c17933fb84ff4b3e9bcb9fb8576a5ae189b97589d5bd1cEventDefinitionCreateResource
  - `templateId` string, nullable: Template identifier. Used when the client wants to create a definition from a template. Must contain only alphanumeric characters `(a–z, A–Z, 0–9)`. Maximum length: `36` characters. Must be `null` if `definitionId` is provided.
  - `definitionId` string, nullable: Event definition identifier. Must contain only alphanumeric characters `(a–z, A–Z, 0–9)`. Maximum length: `36` characters. Must be `null` if `templateId` is provided. Cannot have a value from the list of predefined (standard) definitions.
  - `title` string, nullable: Event definition title. Required if `templateId` is `null`. Maximum length: `100` characters. Must be `null` if `templateId` is provided.
  - `description` string, nullable: Event definition description. Maximum length: `2000` characters if `templateId` is `null`. Must be `null` if `templateId` is provided.
  - `fields` B3ed157de85ce51bb7c17933fb84ff4b3e9bcb9fb8576a5ae189b97589d5bd1cEventFieldResource[], nullable: Event definition fields. The total number of fields cannot exceed `120`. Field names must be unique (case-insensitive). The number of fields of type `List` cannot exceed `1`.
    - `name` string, required: Field name. Must not exceed `128` characters. Must start with a lowercase letter `(a–z)` and can contain alphanumeric characters `(A–Z, a–z, 0–9)` and underscores `(_)`.
    - `type` 'String' | 'Boolean' | 'DateTime' | 'Numeric' | 'Decimal' | 'List', required: Field data type.
    - `schema` B3ed157de85ce51bb7c17933fb84ff4b3e9bcb9fb8576a5ae189b97589d5bd1cListItemResource
      - `type` 'Object', required: Schema type for List items.
      - `fields` B3ed157de85ce51bb7c17933fb84ff4b3e9bcb9fb8576a5ae189b97589d5bd1cListItemFieldResource[], required: Fields within the List item object. Must not be empty, must contain no more than `128` items, field names must be unique (case-insensitive).
        - `name` string, required: Field name within a List item. Must not exceed `128` characters. Must start with a lowercase letter `(a–z)` and can contain alphanumeric characters `(A–Z, a–z, 0–9)` and underscores `(_)`.
        - `type` 'String' | 'Boolean' | 'DateTime' | 'Numeric' | 'Decimal', required: Field data type within a List item.

## Response `201`

Successfully created

- B3ed157de85ce51bb7c17933fb84ff4b3e9bcb9fb8576a5ae189b97589d5bd1cEventDefinitionResource
  - `isInternalDefinition` boolean: Indicates whether this is a standard (internal) event definition provided by the system, or a custom (external) definition created by the user.
  - `category` 'external' | 'person' | 'channel' | 'product' | 'template': Event definition category.
  - `subcategory` 'sms' | 'email' | 'push' | 'whatsapp' | 'viber' | 'facebook' | 'moments' | 'forms' | 'conversations' | 'mobileapp' | 'voice' | 'line' | 'appleBC' | 'rcs' | 'mms' | 'viberBot' | 'inapp' | 'answers' | 'blocklist': Event definition subcategory.
  - `definitionId` string, nullable: Event definition identifier.
  - `title` string, nullable: Event definition title.
  - `description` string, nullable: Event definition description.
  - `fields` B3ed157de85ce51bb7c17933fb84ff4b3e9bcb9fb8576a5ae189b97589d5bd1cEventFieldResource[], nullable: Event definition fields describing the structure and data types of the event properties.
    - `name` string, required: Field name. Must not exceed `128` characters. Must start with a lowercase letter `(a–z)` and can contain alphanumeric characters `(A–Z, a–z, 0–9)` and underscores `(_)`.
    - `type` 'String' | 'Boolean' | 'DateTime' | 'Numeric' | 'Decimal' | 'List', required: Field data type.
    - `schema` B3ed157de85ce51bb7c17933fb84ff4b3e9bcb9fb8576a5ae189b97589d5bd1cListItemResource
      - `type` 'Object', required: Schema type for List items.
      - `fields` B3ed157de85ce51bb7c17933fb84ff4b3e9bcb9fb8576a5ae189b97589d5bd1cListItemFieldResource[], required: Fields within the List item object. Must not be empty, must contain no more than `128` items, field names must be unique (case-insensitive).
        - `name` string, required: Field name within a List item. Must not exceed `128` characters. Must start with a lowercase letter `(a–z)` and can contain alphanumeric characters `(A–Z, a–z, 0–9)` and underscores `(_)`.
        - `type` 'String' | 'Boolean' | 'DateTime' | 'Numeric' | 'Decimal', required: Field data type within a List item.

## Other responses

- `400`: Invalid resource representation
- `401`: Unauthorized
- `403`: Forbidden
- `409`: Conflict. Definition with such 'definitionId' has already existed.
- `500`: Internal Server Error

---

[API](https://skmtc.dev/infobip/apis/infobip-openapi-specification.md) - [All operations](https://skmtc.dev/infobip/apis/infobip-openapi-specification/llms.txt) - [OpenAPI document](https://skmtc.dev/infobip/apis/infobip-openapi-specification/revisions/9dcbbaf902de?raw)
