Skip to content

API reference / RivetMSP

Appointments

GET /appointments Bearer token or API key

List ticket appointments (bare array)

Parameters

NameInTypeDescription
whenquerystring (past | today | future)
minequeryinteger (0 | 1)
client_idqueryinteger

Example request

curl "https://YOUR-HOST/api/v1/appointments" \
  -H "Authorization: Bearer $TOKEN"
import requests

response = requests.get(
    "https://YOUR-HOST/api/v1/appointments",
    headers={"Authorization": f"Bearer {TOKEN}"},
)
print(response.json())
const response = await fetch("https://YOUR-HOST/api/v1/appointments", {
  method: "GET",
  headers: { "Authorization": `Bearer ${TOKEN}` },
});
const data = await response.json();
$ch = curl_init("https://YOUR-HOST/api/v1/appointments");
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => "GET",
    CURLOPT_HTTPHEADER => ["Authorization: Bearer $token"],
]);
$data = json_decode(curl_exec($ch), true);

Responses

200Appointments

FieldTypeDescription
[]id integer
[]ticket_id integer
[]number integer
[]subject string
[]schedule string
[]schedule_end string
[]onsite boolean
[]notes string
[]priority string
[]status string
[]status_color string
[]client string
[]assigned_to string
Example response
json
[
    {
        "id": 1,
        "ticket_id": 1,
        "number": 1,
        "subject": "string",
        "schedule": "string",
        "schedule_end": "string",
        "onsite": true,
        "notes": "string",
        "priority": "string",
        "status": "string",
        "status_color": "string",
        "client": "string",
        "assigned_to": "string"
    }
]
POST /appointments Bearer token or API key

Create a ticket appointment (schedule entry)

Request body (application/json, required)

FieldTypeDescription
ticket_idrequired integer
schedule_startrequired string Y-m-d H:i:s
schedule_end string
onsite boolean
notes string

Example request

curl -X POST "https://YOUR-HOST/api/v1/appointments" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"ticket_id":1,"schedule_start":"string","schedule_end":"string","onsite":true,"notes":"string"}'
import requests

response = requests.post(
    "https://YOUR-HOST/api/v1/appointments",
    headers={"Authorization": f"Bearer {TOKEN}"},
    json={
        "ticket_id": 1,
        "schedule_start": "string",
        "schedule_end": "string",
        "onsite": True,
        "notes": "string"
    },
)
print(response.json())
const response = await fetch("https://YOUR-HOST/api/v1/appointments", {
  method: "POST",
  headers: { "Authorization": `Bearer ${TOKEN}`, "Content-Type": "application/json" },
  body: JSON.stringify({
      "ticket_id": 1,
      "schedule_start": "string",
      "schedule_end": "string",
      "onsite": true,
      "notes": "string"
  }),
});
const data = await response.json();
$ch = curl_init("https://YOUR-HOST/api/v1/appointments");
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => "POST",
    CURLOPT_HTTPHEADER => ["Authorization: Bearer $token", "Content-Type: application/json"],
    CURLOPT_POSTFIELDS => '{"ticket_id":1,"schedule_start":"string","schedule_end":"string","onsite":true,"notes":"string"}',
]);
$data = json_decode(curl_exec($ch), true);

Responses

201Appointment created

FieldTypeDescription
id integer
Example response
json
{
    "id": 1
}

400Bad request

FieldTypeDescription
error string

403Authenticated but not permitted

FieldTypeDescription
error string

404Resource not found

FieldTypeDescription
error string