Skip to main content
POST
/
api
/
v1
/
appointment-requests
Create a new appointment request
curl --request POST \
  --url https://{subdomain}.mihu.ai/api/v1/appointment-requests \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "schedule_uuid": "550e8400-e29b-41d4-a716-446655440000",
  "title": "Medical Consultation",
  "start_time": "2025-11-25 10:00:00",
  "contact_uuid": "660e8400-e29b-41d4-a716-446655440001",
  "contact_name": "John",
  "contact_surname": "Doe",
  "contact_email": "john.doe@email.com",
  "contact_phone": "+1-555-0100",
  "description": "Annual checkup",
  "end_time": "2025-11-25 10:30:00",
  "notes": "Patient prefers morning appointments"
}
'
import requests

url = "https://{subdomain}.mihu.ai/api/v1/appointment-requests"

payload = {
"schedule_uuid": "550e8400-e29b-41d4-a716-446655440000",
"title": "Medical Consultation",
"start_time": "2025-11-25 10:00:00",
"contact_uuid": "660e8400-e29b-41d4-a716-446655440001",
"contact_name": "John",
"contact_surname": "Doe",
"contact_email": "john.doe@email.com",
"contact_phone": "+1-555-0100",
"description": "Annual checkup",
"end_time": "2025-11-25 10:30:00",
"notes": "Patient prefers morning appointments"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
schedule_uuid: '550e8400-e29b-41d4-a716-446655440000',
title: 'Medical Consultation',
start_time: '2025-11-25 10:00:00',
contact_uuid: '660e8400-e29b-41d4-a716-446655440001',
contact_name: 'John',
contact_surname: 'Doe',
contact_email: 'john.doe@email.com',
contact_phone: '+1-555-0100',
description: 'Annual checkup',
end_time: '2025-11-25 10:30:00',
notes: 'Patient prefers morning appointments'
})
};

fetch('https://{subdomain}.mihu.ai/api/v1/appointment-requests', 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://{subdomain}.mihu.ai/api/v1/appointment-requests",
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([
'schedule_uuid' => '550e8400-e29b-41d4-a716-446655440000',
'title' => 'Medical Consultation',
'start_time' => '2025-11-25 10:00:00',
'contact_uuid' => '660e8400-e29b-41d4-a716-446655440001',
'contact_name' => 'John',
'contact_surname' => 'Doe',
'contact_email' => 'john.doe@email.com',
'contact_phone' => '+1-555-0100',
'description' => 'Annual checkup',
'end_time' => '2025-11-25 10:30:00',
'notes' => 'Patient prefers morning appointments'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://{subdomain}.mihu.ai/api/v1/appointment-requests"

payload := strings.NewReader("{\n \"schedule_uuid\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"title\": \"Medical Consultation\",\n \"start_time\": \"2025-11-25 10:00:00\",\n \"contact_uuid\": \"660e8400-e29b-41d4-a716-446655440001\",\n \"contact_name\": \"John\",\n \"contact_surname\": \"Doe\",\n \"contact_email\": \"john.doe@email.com\",\n \"contact_phone\": \"+1-555-0100\",\n \"description\": \"Annual checkup\",\n \"end_time\": \"2025-11-25 10:30:00\",\n \"notes\": \"Patient prefers morning appointments\"\n}")

req, _ := http.NewRequest("POST", url, payload)

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))

}
HttpResponse<String> response = Unirest.post("https://{subdomain}.mihu.ai/api/v1/appointment-requests")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"schedule_uuid\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"title\": \"Medical Consultation\",\n \"start_time\": \"2025-11-25 10:00:00\",\n \"contact_uuid\": \"660e8400-e29b-41d4-a716-446655440001\",\n \"contact_name\": \"John\",\n \"contact_surname\": \"Doe\",\n \"contact_email\": \"john.doe@email.com\",\n \"contact_phone\": \"+1-555-0100\",\n \"description\": \"Annual checkup\",\n \"end_time\": \"2025-11-25 10:30:00\",\n \"notes\": \"Patient prefers morning appointments\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://{subdomain}.mihu.ai/api/v1/appointment-requests")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"schedule_uuid\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"title\": \"Medical Consultation\",\n \"start_time\": \"2025-11-25 10:00:00\",\n \"contact_uuid\": \"660e8400-e29b-41d4-a716-446655440001\",\n \"contact_name\": \"John\",\n \"contact_surname\": \"Doe\",\n \"contact_email\": \"john.doe@email.com\",\n \"contact_phone\": \"+1-555-0100\",\n \"description\": \"Annual checkup\",\n \"end_time\": \"2025-11-25 10:30:00\",\n \"notes\": \"Patient prefers morning appointments\"\n}"

response = http.request(request)
puts response.read_body
{
  "success": true,
  "message": "Appointment request created successfully",
  "data": {
    "id": 1,
    "uuid": "550e8400-e29b-41d4-a716-446655440000",
    "title": "Medical Consultation",
    "status": "pending",
    "start_time": "2025-11-25T10:00:00.000000Z",
    "end_time": "2025-11-25T10:30:00.000000Z"
  }
}
{
"success": false,
"message": "Validation failed",
"data": {
"start_time": [
"Start time must be in the future"
]
}
}

Authorizations

Authorization
string
header
required

Use a Bearer token to access these API endpoints. Example: "Bearer {your-token}"

Body

application/json
schedule_uuid
string<uuid>
required

UUID of the schedule

Example:

"550e8400-e29b-41d4-a716-446655440000"

title
string
required

Appointment title

Example:

"Medical Consultation"

start_time
string<date-time>
required

Start time (must be in the future)

Example:

"2025-11-25 10:00:00"

contact_uuid
string<uuid>

UUID of existing contact (optional if contact details provided)

Example:

"660e8400-e29b-41d4-a716-446655440001"

contact_name
string

Contact name (required if contact_uuid not provided)

Example:

"John"

contact_surname
string

Contact surname (optional)

Example:

"Doe"

contact_email
string<email>

Contact email (required if contact_uuid not provided)

Example:

"john.doe@email.com"

contact_phone
string

Contact phone (optional)

Example:

"+1-555-0100"

description
string

Appointment description (optional)

Example:

"Annual checkup"

end_time
string<date-time>

End time (optional - if not provided, will use schedule's default duration from availability type)

Example:

"2025-11-25 10:30:00"

notes
string

Additional notes (optional)

Example:

"Patient prefers morning appointments"

Response

Appointment request created successfully

success
boolean

Indicates whether the request completed successfully. True for successful responses; false for documented error responses.

Example:

true

message
string

Human-readable response message. Safe to display in logs or simple client notifications; use structured fields for program logic.

Example:

"Appointment request created successfully"

data
object