Create Event

Create event within specified project.

Create Event

POST https://environment.monterosa.cloud/api/v2/events

Headers

Request Body

{
  "data": {
    "id": "18b17c20-5e84-4086-8da0-784f21622e16",
    "type": "events",
    "attributes": {
      "name": "Live Event",
      "duration": 3600,
      "start_at": 1458487800,
      "start_at_iso": "2016-03-20T15:30:00Z",
      "start_mode": "manual",
      "end_mode": "duration",
      "repeat": false,
      "settings": [
        {
          "key": "hold_prompt",
          "values": {
            "en": "We'll be back shortly",
            "de": "Wir sind gleich wieder da"
          }
        }
      ],
      "state": "future"
    },
    "links": {
      "self": "https://example.lvis.io/api/v2/events/18b17c20-5e84-4086-8da0-784f21622e16"
    },
    "relationships": {
      "elements": {
        "links": {
          "related": "https://example.lvis.io/api/v2/events/18b17c20-5e84-4086-8da0-784f21622e16/elements"
        }
      },
      "stats": {
        "data": {
          "id": "18b17c20-5e84-4086-8da0-784f21622e16",
          "type": "stats"
        }
      },
      "project": {
        "data": {
          "id": "850e644e-f1ea-444d-bae3-cf38badbe501",
          "type": "projects"
        }
      }
    }
  }
}

Example

// POST /api/v2/events
// Host: environment.monterosa.cloud
// Authorization: Bearer JmsmU5gZb6xNVUgQGoKcQLvQjRhKAUSb
// Content-Type: application/vnd.api+json

{
  "data": {
    "type": "events",
    "relationships": {
      "project": {
        "data": {
          "type": "projects",
          "id": "850e644e-f1ea-444d-bae3-cf38badbe501"
        }
      }
    },
    "attributes": {
      "name": "Live Event",
      "duration": 3600,
      "start_at": 1458487800,
      "start_mode": "manual",
      "end_mode": "scheduled",
      "repeat": false,
      "settings": [
        {
          "key": "hold_prompt",
          "values": {
            "en": "We will be back shortly",
            "de": "Wir sind gleich wieder da"
          }
        },
        {
          "key": "advert_code",
          "values": {
            "all" : "Advert code"
          }
        }
      ]
    }
  }
}

Create an event and start it

To start new event action must be set to start. Otherwise event will be started according to start_mode and start_at properties.

// POST /api/v2/events
// Host: environment.monterosa.cloud
// Authorization: Bearer JmsmU5gZb6xNVUgQGoKcQLvQjRhKAUSb
// Content-Type: application/vnd.api+json

{
  "data": {
    "type": "events",
    "relationships": {
      "project": {
        "data": {
          "type": "projects",
          "id": "f1b50562-edae-43e9-8f4f-4f8e6765ef91"
        }
      }
    },
    "attributes": {
      "name": "Event Name",
      "start_mode": "manual",
      "duration": 60,
      "action": "start",
      "start_at": 1458487800,
      "settings": []
    }
  }
}

Validation error message about an invalid attribute

// POST /api/v2/events
// Host: environment.monterosa.cloud
// Authorization: Bearer JmsmU5gZb6xNVUgQGoKcQLvQjRhKAUSb
// Content-Type: application/vnd.api+json

{
  "data": {
    "type": "events",
    "relationships": {
      "project": {
        "data": {
          "type": "projects",
          "id": "4c7ec57b-b03f-4c6c-b52c-ced4b3ef23c1"
        }
      }
    },
    "attributes": {
      "name": "Event Name",
      "start_mode": "manual",
      "duration": -1,
      "start_at": 1458487800,
      "settings": []
    }
  }
}