Typescript (SDK)
import { Crevio } from "@crevio/sdk";
const crevio = new Crevio({
apiKey: process.env["CREVIO_API_KEY"] ?? "",
});
async function run() {
const result = await crevio.eventTypes.create({
name: "Strategy Call",
});
console.log(result);
}
run();curl --request POST \
--url https://api.crevio.co/v1/event_types \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Strategy Call",
"duration_minutes": 30,
"buffer_before_minutes": 0,
"buffer_after_minutes": 0,
"min_notice_minutes": 240,
"booking_window_days": 60,
"max_per_day": 123,
"capacity": 1,
"location_type": "google_meet",
"location_details": "<string>",
"schedule_id": "<string>"
}
'import requests
url = "https://api.crevio.co/v1/event_types"
payload = {
"name": "Strategy Call",
"duration_minutes": 30,
"buffer_before_minutes": 0,
"buffer_after_minutes": 0,
"min_notice_minutes": 240,
"booking_window_days": 60,
"max_per_day": 123,
"capacity": 1,
"location_type": "google_meet",
"location_details": "<string>",
"schedule_id": "<string>"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Strategy Call',
duration_minutes: 30,
buffer_before_minutes: 0,
buffer_after_minutes: 0,
min_notice_minutes: 240,
booking_window_days: 60,
max_per_day: 123,
capacity: 1,
location_type: 'google_meet',
location_details: '<string>',
schedule_id: '<string>'
})
};
fetch('https://api.crevio.co/v1/event_types', 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.crevio.co/v1/event_types",
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' => 'Strategy Call',
'duration_minutes' => 30,
'buffer_before_minutes' => 0,
'buffer_after_minutes' => 0,
'min_notice_minutes' => 240,
'booking_window_days' => 60,
'max_per_day' => 123,
'capacity' => 1,
'location_type' => 'google_meet',
'location_details' => '<string>',
'schedule_id' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$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.crevio.co/v1/event_types"
payload := strings.NewReader("{\n \"name\": \"Strategy Call\",\n \"duration_minutes\": 30,\n \"buffer_before_minutes\": 0,\n \"buffer_after_minutes\": 0,\n \"min_notice_minutes\": 240,\n \"booking_window_days\": 60,\n \"max_per_day\": 123,\n \"capacity\": 1,\n \"location_type\": \"google_meet\",\n \"location_details\": \"<string>\",\n \"schedule_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<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.crevio.co/v1/event_types")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Strategy Call\",\n \"duration_minutes\": 30,\n \"buffer_before_minutes\": 0,\n \"buffer_after_minutes\": 0,\n \"min_notice_minutes\": 240,\n \"booking_window_days\": 60,\n \"max_per_day\": 123,\n \"capacity\": 1,\n \"location_type\": \"google_meet\",\n \"location_details\": \"<string>\",\n \"schedule_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.crevio.co/v1/event_types")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Strategy Call\",\n \"duration_minutes\": 30,\n \"buffer_before_minutes\": 0,\n \"buffer_after_minutes\": 0,\n \"min_notice_minutes\": 240,\n \"booking_window_days\": 60,\n \"max_per_day\": 123,\n \"capacity\": 1,\n \"location_type\": \"google_meet\",\n \"location_details\": \"<string>\",\n \"schedule_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"object": "<string>",
"id": "<string>",
"name": "<string>",
"slug": "<string>",
"duration_minutes": 123,
"buffer_before_minutes": 123,
"buffer_after_minutes": 123,
"min_notice_minutes": 123,
"booking_window_days": 123,
"max_per_day": 123,
"reminder_minutes": [
123
],
"location_details": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"form_id": "<string>",
"free": true,
"schedule_id": "<string>",
"product_id": "<string>",
"price_variants": [
{
"id": "<string>",
"object": "<string>",
"name": "<string>",
"amount": 123,
"interval_count": 123,
"installment_count": 123,
"setup_fee_amount": 123,
"trial_period_days": 123,
"revoke_after_days": 123,
"quantity_available": 123,
"archived": true,
"position": 123,
"hidden": true,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"currency": "<string>",
"discounted_from_amount": 123,
"minimum_amount": 123,
"maximum_amount": 123,
"preset_amount": 123,
"waitlist": true,
"purchase_url": "<string>",
"product": "<string>",
"benefits": [
"<string>"
]
}
],
"form": "<string>"
}{
"error": {
"type": "invalid_request_error",
"code": "bad_request",
"message": "The request was malformed or contained invalid parameters"
}
}{
"error": {
"type": "invalid_request_error",
"code": "authentication_required",
"message": "You did not provide an API key."
}
}{
"error": {
"type": "invalid_request_error",
"code": "forbidden",
"message": "You do not have permission to perform this action"
}
}{
"error": {
"type": "validation_error",
"code": "validation_failed",
"message": "Email is required",
"errors": {
"email": [
"can't be blank"
]
}
}
}{
"error": {
"type": "api_error",
"code": "internal_error",
"message": "An unexpected error occurred"
}
}Event types
Create an event type
Creates a bookable event type (a service customers can book, e.g. a 30-minute call).
POST
/
event_types
Typescript (SDK)
import { Crevio } from "@crevio/sdk";
const crevio = new Crevio({
apiKey: process.env["CREVIO_API_KEY"] ?? "",
});
async function run() {
const result = await crevio.eventTypes.create({
name: "Strategy Call",
});
console.log(result);
}
run();curl --request POST \
--url https://api.crevio.co/v1/event_types \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Strategy Call",
"duration_minutes": 30,
"buffer_before_minutes": 0,
"buffer_after_minutes": 0,
"min_notice_minutes": 240,
"booking_window_days": 60,
"max_per_day": 123,
"capacity": 1,
"location_type": "google_meet",
"location_details": "<string>",
"schedule_id": "<string>"
}
'import requests
url = "https://api.crevio.co/v1/event_types"
payload = {
"name": "Strategy Call",
"duration_minutes": 30,
"buffer_before_minutes": 0,
"buffer_after_minutes": 0,
"min_notice_minutes": 240,
"booking_window_days": 60,
"max_per_day": 123,
"capacity": 1,
"location_type": "google_meet",
"location_details": "<string>",
"schedule_id": "<string>"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Strategy Call',
duration_minutes: 30,
buffer_before_minutes: 0,
buffer_after_minutes: 0,
min_notice_minutes: 240,
booking_window_days: 60,
max_per_day: 123,
capacity: 1,
location_type: 'google_meet',
location_details: '<string>',
schedule_id: '<string>'
})
};
fetch('https://api.crevio.co/v1/event_types', 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.crevio.co/v1/event_types",
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' => 'Strategy Call',
'duration_minutes' => 30,
'buffer_before_minutes' => 0,
'buffer_after_minutes' => 0,
'min_notice_minutes' => 240,
'booking_window_days' => 60,
'max_per_day' => 123,
'capacity' => 1,
'location_type' => 'google_meet',
'location_details' => '<string>',
'schedule_id' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$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.crevio.co/v1/event_types"
payload := strings.NewReader("{\n \"name\": \"Strategy Call\",\n \"duration_minutes\": 30,\n \"buffer_before_minutes\": 0,\n \"buffer_after_minutes\": 0,\n \"min_notice_minutes\": 240,\n \"booking_window_days\": 60,\n \"max_per_day\": 123,\n \"capacity\": 1,\n \"location_type\": \"google_meet\",\n \"location_details\": \"<string>\",\n \"schedule_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<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.crevio.co/v1/event_types")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Strategy Call\",\n \"duration_minutes\": 30,\n \"buffer_before_minutes\": 0,\n \"buffer_after_minutes\": 0,\n \"min_notice_minutes\": 240,\n \"booking_window_days\": 60,\n \"max_per_day\": 123,\n \"capacity\": 1,\n \"location_type\": \"google_meet\",\n \"location_details\": \"<string>\",\n \"schedule_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.crevio.co/v1/event_types")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Strategy Call\",\n \"duration_minutes\": 30,\n \"buffer_before_minutes\": 0,\n \"buffer_after_minutes\": 0,\n \"min_notice_minutes\": 240,\n \"booking_window_days\": 60,\n \"max_per_day\": 123,\n \"capacity\": 1,\n \"location_type\": \"google_meet\",\n \"location_details\": \"<string>\",\n \"schedule_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"object": "<string>",
"id": "<string>",
"name": "<string>",
"slug": "<string>",
"duration_minutes": 123,
"buffer_before_minutes": 123,
"buffer_after_minutes": 123,
"min_notice_minutes": 123,
"booking_window_days": 123,
"max_per_day": 123,
"reminder_minutes": [
123
],
"location_details": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"form_id": "<string>",
"free": true,
"schedule_id": "<string>",
"product_id": "<string>",
"price_variants": [
{
"id": "<string>",
"object": "<string>",
"name": "<string>",
"amount": 123,
"interval_count": 123,
"installment_count": 123,
"setup_fee_amount": 123,
"trial_period_days": 123,
"revoke_after_days": 123,
"quantity_available": 123,
"archived": true,
"position": 123,
"hidden": true,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"currency": "<string>",
"discounted_from_amount": 123,
"minimum_amount": 123,
"maximum_amount": 123,
"preset_amount": 123,
"waitlist": true,
"purchase_url": "<string>",
"product": "<string>",
"benefits": [
"<string>"
]
}
],
"form": "<string>"
}{
"error": {
"type": "invalid_request_error",
"code": "bad_request",
"message": "The request was malformed or contained invalid parameters"
}
}{
"error": {
"type": "invalid_request_error",
"code": "authentication_required",
"message": "You did not provide an API key."
}
}{
"error": {
"type": "invalid_request_error",
"code": "forbidden",
"message": "You do not have permission to perform this action"
}
}{
"error": {
"type": "validation_error",
"code": "validation_failed",
"message": "Email is required",
"errors": {
"email": [
"can't be blank"
]
}
}
}{
"error": {
"type": "api_error",
"code": "internal_error",
"message": "An unexpected error occurred"
}
}Authorizations
API key in the format: Bearer {api_token}
Body
application/json
Required on create.
Example:
"Strategy Call"
Earliest a slot can be booked, in minutes from now.
How far into the future slots are offered.
Attendees per slot.
Available options:
google_meet, zoom, custom_link, physical, phone Address, dial-in, or meeting link (ignored for google_meet, which auto-generates a Meet link).
The availability schedule to use (sched_…).
Response
The created event type
Available options:
google_meet, zoom, custom_link, physical, phone Show child attributes
Show child attributes
ID by default, full object when expanded
Was this page helpful?
⌘I

