Create Event.

POST /api/teams/{team}/events

Path parameters

  • team integer Required

    The ID of the team that events belong to.

application/json

Body Required

  • key string Required

    The key to use for the event. Must match the regex /[a-z0-9]+(?:_[a-z0-9]+)*$/i. Must not be greater than 255 characters.

  • description string

    The description of the event.

  • type string Required

    The type of event to create.

    Values are unique or count.

Responses

  • 200 application/json
    Hide response attribute Show response attribute object
    • data object
      Hide data attributes Show data attributes object
      • id string
      • type string
      • attributes object
        Hide attributes attributes Show attributes attributes object
        • id integer
        • team_id integer
        • key string
        • type string
        • description string
        • created object
          Hide created attributes Show created attributes object
          • human string
          • string string
        • updated object
          Hide updated attributes Show updated attributes object
          • human string
          • string string
  • 402 application/json
    Hide response attribute Show response attribute object
    • message string
  • 403 application/json
    Hide response attribute Show response attribute object
    • message string
  • 404 application/json
    Hide response attribute Show response attribute object
    • message string
  • 422 application/json
    Hide response attributes Show response attributes object
    • message string
    • errors object
      Hide errors attribute Show errors attribute object
      • key array[string]
POST /api/teams/{team}/events
curl \
 -X POST https://checkmango.com/api/teams/17/events \
 -H "Authorization: Bearer $ACCESS_TOKEN" \
 -H "Content-Type: application/json" \
 -d '{"key":"MY_NEW_EVENT","description":"Saepe cupiditate consequatur alias qui.","type":"count"}'
Request example
{
  "key": "MY_NEW_EVENT",
  "description": "Saepe cupiditate consequatur alias qui.",
  "type": "count"
}
Response examples (200)
{
  "data": {
    "id": "EUM_PLACEAT_MOLESTIAE_DEBITIS_INCIDUNT",
    "type": "events",
    "attributes": {
      "id": 19,
      "team_id": 45,
      "key": "EUM_PLACEAT_MOLESTIAE_DEBITIS_INCIDUNT",
      "type": "unique",
      "description": "Provident aut unde rerum pariatur enim ipsum. Enim autem dolores tempore quibusdam. Corporis officia facilis quia. Enim consequatur harum accusantium et numquam quasi.\n\nVero quae perferendis reiciendis. Et molestiae error dolores tenetur cum asperiores aut. Inventore quos fugiat dolorem.\n\nVoluptates porro ut non. Adipisci consectetur itaque dolore autem vel. Velit dolorum harum dolorem quis sed nulla error ut. Aperiam ea inventore in vel eos.",
      "created": {
        "human": "1 second ago",
        "string": "2024-04-08 10:42:02"
      },
      "updated": {
        "human": "1 second ago",
        "string": "2024-04-08 10:42:02"
      }
    },
    "links": {
      "self": {
        "href": "http://checkmango.com/api/teams/45/events/EUM_PLACEAT_MOLESTIAE_DEBITIS_INCIDUNT"
      }
    }
  }
}
Response examples (402)
{
  "message": "Subscription required."
}
Response examples (403)
{
  "message": "Unauthenticated."
}
Response examples (404)
{
  "message": "Not Found"
}
Response examples (422)
{
  "message": "The given data was invalid.",
  "errors": {
    "key": [
      "The key has already been taken."
    ]
  }
}