Events
Create Event
Creates a new event.
POST
/
events
Create Event
curl --request POST \
--url https://api.roostedhr.com/api/1_12/events \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"name": "<string>",
"date": "2023-12-25",
"location": {
"location_id": "<string>",
"name": "<string>",
"address": "<string>",
"city": "<string>",
"zip": "<string>",
"saved": "<string>"
},
"client_id": "<string>",
"admin_comments": "<string>",
"comments": "<string>",
"custom_fields": [
{
"id": "<string>",
"value": "<string>"
}
],
"areas": [
"<string>"
]
}
'import requests
url = "https://api.roostedhr.com/api/1_12/events"
payload = {
"name": "<string>",
"date": "2023-12-25",
"location": {
"location_id": "<string>",
"name": "<string>",
"address": "<string>",
"city": "<string>",
"zip": "<string>",
"saved": "<string>"
},
"client_id": "<string>",
"admin_comments": "<string>",
"comments": "<string>",
"custom_fields": [
{
"id": "<string>",
"value": "<string>"
}
],
"areas": ["<string>"]
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
date: '2023-12-25',
location: {
location_id: '<string>',
name: '<string>',
address: '<string>',
city: '<string>',
zip: '<string>',
saved: '<string>'
},
client_id: '<string>',
admin_comments: '<string>',
comments: '<string>',
custom_fields: [{id: '<string>', value: '<string>'}],
areas: ['<string>']
})
};
fetch('https://api.roostedhr.com/api/1_12/events', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.roostedhr.com/api/1_12/events",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'date' => '2023-12-25',
'location' => [
'location_id' => '<string>',
'name' => '<string>',
'address' => '<string>',
'city' => '<string>',
'zip' => '<string>',
'saved' => '<string>'
],
'client_id' => '<string>',
'admin_comments' => '<string>',
'comments' => '<string>',
'custom_fields' => [
[
'id' => '<string>',
'value' => '<string>'
]
],
'areas' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.roostedhr.com/api/1_12/events"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"date\": \"2023-12-25\",\n \"location\": {\n \"location_id\": \"<string>\",\n \"name\": \"<string>\",\n \"address\": \"<string>\",\n \"city\": \"<string>\",\n \"zip\": \"<string>\",\n \"saved\": \"<string>\"\n },\n \"client_id\": \"<string>\",\n \"admin_comments\": \"<string>\",\n \"comments\": \"<string>\",\n \"custom_fields\": [\n {\n \"id\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"areas\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-KEY", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.roostedhr.com/api/1_12/events")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"date\": \"2023-12-25\",\n \"location\": {\n \"location_id\": \"<string>\",\n \"name\": \"<string>\",\n \"address\": \"<string>\",\n \"city\": \"<string>\",\n \"zip\": \"<string>\",\n \"saved\": \"<string>\"\n },\n \"client_id\": \"<string>\",\n \"admin_comments\": \"<string>\",\n \"comments\": \"<string>\",\n \"custom_fields\": [\n {\n \"id\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"areas\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.roostedhr.com/api/1_12/events")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"date\": \"2023-12-25\",\n \"location\": {\n \"location_id\": \"<string>\",\n \"name\": \"<string>\",\n \"address\": \"<string>\",\n \"city\": \"<string>\",\n \"zip\": \"<string>\",\n \"saved\": \"<string>\"\n },\n \"client_id\": \"<string>\",\n \"admin_comments\": \"<string>\",\n \"comments\": \"<string>\",\n \"custom_fields\": [\n {\n \"id\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"areas\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body123Location
Provide the event location via thelocation object. To link an existing saved location, pass location_id. To create an inline location, provide name, address, city, and zip — set saved to "1" to save it for reuse.
Custom fields
Send custom fields as an array of{ field_id, value } objects, where field_id is the custom field’s ID.
Areas
Assign areas to the event by passing an array of area IDs in theareas field. Invalid IDs return a 400 error.
The
client_id field is optional. When provided, it links the event to an existing client record.Authorizations
Body
application/json
Show child attributes
Show child attributes
Pattern:
^[A-Za-z0-9]+Maximum string length:
65535Maximum string length:
65535Show child attributes
Show child attributes
Area IDs to assign to the event. Invalid IDs return 400.
Response
Created
Created event ID
⌘I
Create Event
curl --request POST \
--url https://api.roostedhr.com/api/1_12/events \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"name": "<string>",
"date": "2023-12-25",
"location": {
"location_id": "<string>",
"name": "<string>",
"address": "<string>",
"city": "<string>",
"zip": "<string>",
"saved": "<string>"
},
"client_id": "<string>",
"admin_comments": "<string>",
"comments": "<string>",
"custom_fields": [
{
"id": "<string>",
"value": "<string>"
}
],
"areas": [
"<string>"
]
}
'import requests
url = "https://api.roostedhr.com/api/1_12/events"
payload = {
"name": "<string>",
"date": "2023-12-25",
"location": {
"location_id": "<string>",
"name": "<string>",
"address": "<string>",
"city": "<string>",
"zip": "<string>",
"saved": "<string>"
},
"client_id": "<string>",
"admin_comments": "<string>",
"comments": "<string>",
"custom_fields": [
{
"id": "<string>",
"value": "<string>"
}
],
"areas": ["<string>"]
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
date: '2023-12-25',
location: {
location_id: '<string>',
name: '<string>',
address: '<string>',
city: '<string>',
zip: '<string>',
saved: '<string>'
},
client_id: '<string>',
admin_comments: '<string>',
comments: '<string>',
custom_fields: [{id: '<string>', value: '<string>'}],
areas: ['<string>']
})
};
fetch('https://api.roostedhr.com/api/1_12/events', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.roostedhr.com/api/1_12/events",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'date' => '2023-12-25',
'location' => [
'location_id' => '<string>',
'name' => '<string>',
'address' => '<string>',
'city' => '<string>',
'zip' => '<string>',
'saved' => '<string>'
],
'client_id' => '<string>',
'admin_comments' => '<string>',
'comments' => '<string>',
'custom_fields' => [
[
'id' => '<string>',
'value' => '<string>'
]
],
'areas' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.roostedhr.com/api/1_12/events"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"date\": \"2023-12-25\",\n \"location\": {\n \"location_id\": \"<string>\",\n \"name\": \"<string>\",\n \"address\": \"<string>\",\n \"city\": \"<string>\",\n \"zip\": \"<string>\",\n \"saved\": \"<string>\"\n },\n \"client_id\": \"<string>\",\n \"admin_comments\": \"<string>\",\n \"comments\": \"<string>\",\n \"custom_fields\": [\n {\n \"id\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"areas\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-KEY", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.roostedhr.com/api/1_12/events")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"date\": \"2023-12-25\",\n \"location\": {\n \"location_id\": \"<string>\",\n \"name\": \"<string>\",\n \"address\": \"<string>\",\n \"city\": \"<string>\",\n \"zip\": \"<string>\",\n \"saved\": \"<string>\"\n },\n \"client_id\": \"<string>\",\n \"admin_comments\": \"<string>\",\n \"comments\": \"<string>\",\n \"custom_fields\": [\n {\n \"id\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"areas\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.roostedhr.com/api/1_12/events")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"date\": \"2023-12-25\",\n \"location\": {\n \"location_id\": \"<string>\",\n \"name\": \"<string>\",\n \"address\": \"<string>\",\n \"city\": \"<string>\",\n \"zip\": \"<string>\",\n \"saved\": \"<string>\"\n },\n \"client_id\": \"<string>\",\n \"admin_comments\": \"<string>\",\n \"comments\": \"<string>\",\n \"custom_fields\": [\n {\n \"id\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"areas\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body123