Skip to content

Add a new event.

POST
/api/events

Authorizations

api_key
Type: API Key (header: X-CSRF-Token)

Request Body

JSON
{
"id": 1,
"regionId": 1,
"name": "Event Name",
"startDate": "2024-05-31T12:45:00Z",
"endDate": "2024-05-31T15:00:00Z",
"description": "Event Description",
"type": 1,
"address": {
"street": "string",
"city": "string",
"zipCode": "string"
},
"location": {
"lat": 52.5,
"lon": 13.4
},
"locationDetails": "string"
}

Responses

Success
Authorization
api_key
cURL
curl -X POST \
'http://localhost/api/events' \
 --data '{
  "id": 1,
  "regionId": 1,
  "name": "Event Name",
  "startDate": "2024-05-31T12:45:00Z",
  "endDate": "2024-05-31T15:00:00Z",
  "description": "Event Description",
  "type": 1,
  "address": {
    "street": "string",
    "city": "string",
    "zipCode": "string"
  },
  "location": {
    "lat": 52.5,
    "lon": 13.4
  },
  "locationDetails": "string"
}'

Samples

cURL
curl -X POST http://localhost/api/events
JavaScript
fetch("http://localhost/api/events", { method: "POST" })
  .then(response => response.json())
  .then(data => console.log(data));
PHP
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://localhost/api/events");
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
Python
import requests
response = requests.post("http://localhost/api/events")
print(response.json())