Skip to main content

Sample Requests

This guide provides practical examples of common API operations available in the Prospyr Postman collection.

Authentication Headers

All requests to the Prospyr API must include the following headers:

Authorization: Bearer YOUR_JWT_TOKEN
app: api
Content-Type: application/json

Example using curl:

curl -X POST https://prod.prospyrmedapi.com/v1/graphql \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-H "app: api" \
-d '{"query": "YOUR_GRAPHQL_QUERY", "variables": {}}'

Patient Operations

Search Patients

Search for patients by name, email, or other criteria:

query searchPatients($_ilike: String!, $limit: Int = 10) {
searchPatients(args: { search: $_ilike }, limit: $limit) {
id
firstName
lastName
email
phoneNumber
}
}

Get Patient by ID

Fetch a specific patient's information:

query GetPatientById($id: uuid!) {
patient_by_pk(id: $id) {
id
firstName
lastName
email
phoneNumber
}
}

Create External Patient

Create a new patient for external booking:

import { graphql } from '@/gql/gql';

export const CreateExternalPatientMutation = graphql(`
mutation CreateExternalPatient($input: CreateExternalPatientInput!) {
createExternalPatient(input: $input) {
patientId
message
success
}
}
`);

Appointment Operations

Check Availability

Check available time slots for appointments:

import { graphql } from '@/gql/gql';

export const CheckAvailabilityQuery = graphql(`
query CheckAvailability(
$locationId: uuid!
$serviceIds: [uuid]!
$time: String!
$providerId: uuid!
) {
checkAvailability(
locationId: $locationId
serviceIds: $serviceIds
time: $time
providerId: $providerId
) {
isAvailable
errors
__typename
}
}
`);

Get Available Time Slots for Multiple Services

Get available time slots for a provider/service/location scenario:

import { graphql } from '@/gql/gql';

export const MultipleServicesAvailabilityQuery = graphql(`
query GetAvailabilityForMultipleServices(
$locationId: uuid!
$serviceIds: [uuid]!
$day: String!
$numberOfDays: Int
$providerId: uuid
$isDayAvailableCheck: Boolean
$patientId: uuid
$isSpecificProviderCheck: Boolean
) {
getAvailabilityForMultipleServices: getAvailabilityForMultipleServicesV2(
locationId: $locationId
serviceIds: $serviceIds
day: $day
numberOfDays: $numberOfDays
providerId: $providerId
isDayAvailableCheck: $isDayAvailableCheck
patientId: $patientId
isSpecificProviderCheck: $isSpecificProviderCheck
) {
start
formattedDay
dateTime
providers {
id
firstName
lastName
profilePicture
serviceIds
__typename
}
__typename
}
}
`);

Book External Appointment

Book an appointment for external patients:

import { graphql } from '@/gql/gql';

export const BookExternalAppointmentMutation = graphql(`
mutation BookExternalAppointment($input: BookExternalAppointmentInput!) {
bookExternalAppointment(input: $input) {
appointmentId
}
}
`);

Get Appointment

Retrieve a specific appointment with full details:

query GetAppointment($id: uuid!) {
appointment_by_pk(id: $id) {
...AppointmentFields
}
}

Sample appointment fragment:

fragment AppointmentFields on appointment {
type
room {
id
name
}
disableConfirmationsReminders
color
services: appointmentServices {
id
appointmentId
serviceDurationMinutes
serviceId
serviceMinutesOverride
type
device {
id
name
deviceType {
id
value
}
}
provider {
id
firstName
lastName
}
service {
id
name
minutesToPerform
color

serviceCategory {
title
}
appointmentType {
name
color
}
}
}
internalAppointmentProviders {
provider {
id
firstName
lastName
}
}

location {
id
name
}
id
patientId
isDraft
locationId
timerange
note
patient {
id
firstName
lastName
}
provider {
id
firstName
lastName
}
status
}

Provider Operations

List Providers

Get a list of providers with optional filtering:

query ListProviders($locationId: uuid, $limit: Int = 20) {
provider(
where: {
locationProvider: {
locationId: { _eq: $locationId }
}
}
limit: $limit
) {
id
firstName
lastName
}
}

Get Provider by ID

Fetch a specific provider's information:

query GetProviderById($id: uuid!) {
provider_by_pk(id: $id) {
id
firstName
lastName
profilePicture
email
active
phoneNumber
address
title
stateLicense
upin
hourlyRate
canBeBookedOnline
canPerformGFE
dea
npi
degree
dob
addressId
scheduleBuffer
user {
id
firstName
lastName
}
degreeDesignation {
value
description
}
serviceProviders {
service {
id
name
serviceDeviceTypes {
deviceType {
value
}
}
}
serviceDurationOverride
}
locationProviders {
clinicianId
registrationStatus
location {
id
name
}
}
providerSchedules {
id
dayOfWeek
startTime
endTime
isActive
}

}
}

Service Operations

List Services

Get available services:

query ListServices($limit: Int = 20) {
service(limit: $limit) {
id
name
description
duration
price
}
}

Get Service by ID

Fetch a specific service's details:

query GetServiceById($id: uuid!) {
service_by_pk(id: $id) {
id
name
description
duration
price
isActive
serviceProvider {
provider {
id
firstName
lastName
}
}
}
}

Location Operations

List Locations

Get all active locations:

query ListLocations {
location(where: { isActive: { _eq: true } }) {
id
name

}
}

Get Location by ID

Fetch a specific location's information:

query GetLocationById($id: uuid!) {
location_by_pk(id: $id) {
id
name
}
}

Using with Postman

To use these examples in Postman:

  1. Fork the Prospyr Public API Collection
  2. Set your JWT token in the collection variables
  3. Each request is pre-configured with the correct headers and example variables
  4. Modify the variables as needed for your use case

Next Steps