Create a Booking
curl --request POST \
--url https://api.heyrafiki.space/v1/bookings \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"practitioner_id": "<string>",
"starts_at": "2023-11-07T05:31:56Z",
"ends_at": "2023-11-07T05:31:56Z"
}
'const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
practitioner_id: '<string>',
starts_at: '2023-11-07T05:31:56Z',
ends_at: '2023-11-07T05:31:56Z'
})
};
fetch('https://api.heyrafiki.space/v1/bookings', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.heyrafiki.space/v1/bookings"
payload = {
"practitioner_id": "<string>",
"starts_at": "2023-11-07T05:31:56Z",
"ends_at": "2023-11-07T05:31:56Z"
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.heyrafiki.space/v1/bookings"
payload := strings.NewReader("{\n \"practitioner_id\": \"<string>\",\n \"starts_at\": \"2023-11-07T05:31:56Z\",\n \"ends_at\": \"2023-11-07T05:31:56Z\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("Authorization", "Bearer <token>")
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))
}{
"id": "<string>",
"object": "booking",
"session_id": "<string>",
"practitioner_id": "<string>",
"starts_at": "2023-11-07T05:31:56Z",
"ends_at": "2023-11-07T05:31:56Z",
"timezone": "<string>",
"format": "online",
"status": "reserved",
"payment_source": "self_pay"
}{
"id": "<string>",
"object": "booking",
"session_id": "<string>",
"practitioner_id": "<string>",
"starts_at": "2023-11-07T05:31:56Z",
"ends_at": "2023-11-07T05:31:56Z",
"timezone": "<string>",
"format": "online",
"status": "reserved",
"payment_source": "self_pay"
}{
"error": {
"code": "<string>",
"message": "<string>",
"docs": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"docs": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"docs": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"docs": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"docs": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"docs": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"docs": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"docs": "<string>"
}
}Create a Booking
Creates one synthetic Booking and Session. Requires bookings:write.
POST
/
bookings
Create a Booking
curl --request POST \
--url https://api.heyrafiki.space/v1/bookings \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"practitioner_id": "<string>",
"starts_at": "2023-11-07T05:31:56Z",
"ends_at": "2023-11-07T05:31:56Z"
}
'const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
practitioner_id: '<string>',
starts_at: '2023-11-07T05:31:56Z',
ends_at: '2023-11-07T05:31:56Z'
})
};
fetch('https://api.heyrafiki.space/v1/bookings', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.heyrafiki.space/v1/bookings"
payload = {
"practitioner_id": "<string>",
"starts_at": "2023-11-07T05:31:56Z",
"ends_at": "2023-11-07T05:31:56Z"
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.heyrafiki.space/v1/bookings"
payload := strings.NewReader("{\n \"practitioner_id\": \"<string>\",\n \"starts_at\": \"2023-11-07T05:31:56Z\",\n \"ends_at\": \"2023-11-07T05:31:56Z\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("Authorization", "Bearer <token>")
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))
}{
"id": "<string>",
"object": "booking",
"session_id": "<string>",
"practitioner_id": "<string>",
"starts_at": "2023-11-07T05:31:56Z",
"ends_at": "2023-11-07T05:31:56Z",
"timezone": "<string>",
"format": "online",
"status": "reserved",
"payment_source": "self_pay"
}{
"id": "<string>",
"object": "booking",
"session_id": "<string>",
"practitioner_id": "<string>",
"starts_at": "2023-11-07T05:31:56Z",
"ends_at": "2023-11-07T05:31:56Z",
"timezone": "<string>",
"format": "online",
"status": "reserved",
"payment_source": "self_pay"
}{
"error": {
"code": "<string>",
"message": "<string>",
"docs": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"docs": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"docs": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"docs": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"docs": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"docs": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"docs": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"docs": "<string>"
}
}Authorizations
bearerAuthapiKeyAuth
A sandbox or production secret key.
Headers
A caller-owned key for safely retrying one write.
Required string length:
8 - 255Body
application/json
Response
The idempotent Booking was returned
Maximum string length:
100Pattern:
^bkg_[A-Za-z0-9_-]+$Allowed value:
"booking"Maximum string length:
100Pattern:
^ses_[A-Za-z0-9_-]+$Maximum string length:
100Pattern:
^prc_[A-Za-z0-9_-]+$Available options:
online, in_person, phone Available options:
reserved, confirmed, cancelled Available options:
self_pay, covered Last modified on August 10, 2026
Was this page helpful?

