HTTP Shell JavaScript Java PHP Go Python Ruby

Getlabs API v1.0

Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.

By integrating the Getlabs API, you can bridge the gap between virtual and in-person healthcare, connecting physician-led telemedicine with in-person care from medical professionals. This enables healthcare providers to extend care to the home unlocking high-quality healthcare for more patients at a fraction of the cost.

With a single API call, we enable our partners to provide end-to-end care for their patients and extend their capabilities to treat new conditions & modalities. What if you could treat primary care remotely? Now you can.

Pick and choose the types of diagnostics you need. Your patients select a convenient time and place. The Getlabs API takes care of everything else.

Maintenance Mode: In the event that the Getlabs API is under maintenance a 503 Service Unavailable will be returned with a matching maintenance mode header (maintenance-mode) set to true. Under normal operation the header defaults false.

Authentication

All of the API endpoints are secured with Bearer Tokens. You must pass your token with any endpoint request. To do so include the following header in your request replacing the token with one that you've obtained from the /oauth/token endpoint.

Authorization: Bearer c2FkZnNld3J0Z2Zlcndnd2Z3ZXNndGVydGZ3ZXJmZXd0Z2V3Z3dlNGdmM3dmM3c=

Obtaining a Bearer token

In order to make API requests you will need to obtain an access token. Token requests must send a signed JWT. The JWT must be signed (using HS512 algorithm) with the provided getlabs API token/secret. See OAuth section below for more details.

NOTE: the JWT provided with the token request is valid for a period of 24hrs after first use. The JWT will need to be regenerated after that time. It is recommended to regenerate a signed JWT for each token request.

OAuth

token

Code samples

POST /v1/oauth/token HTTP/1.1

Accept: application/json

# You can also use wget
curl -X POST /v1/oauth/token \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'


const headers = {
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}'
};

fetch('/v1/oauth/token',
{
  method: 'POST',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

URL obj = new URL("/v1/oauth/token");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/json',
    'Authorization' => 'Bearer {access-token}',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('POST','/v1/oauth/token', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "Authorization": []string{"Bearer {access-token}"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "/v1/oauth/token", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.post('/v1/oauth/token', headers = headers)

print(r.json())

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.post '/v1/oauth/token',
  params: {
  }, headers: headers

p JSON.parse(result)

POST /v1/oauth/token

This endpoint is required to get an access token to access the external api as well as refresh your expired access token

In order to make api requests you will need to get an access token. Token requests must send a JWT with an Authorization header as Bearer token. The JWT must be signed (using HS512 algorithm) with the provided getlabs api token/secret.

The token payload must contain:

{
   aud: string; // getlabs oauth/token endpoint https://api.getlabs.com/oauth/token
   sub: string; // your getlabs provided client id
   exp: number; // unix timestamp when this jwt bearer token expires
   iat: number; // unix timestamp when this jwt bearer token was issued at
}

Refresh Token: Expired access_token(s) can also be refreshed by using this endpoint, resulting in a fresh access_token and refresh_token.

An Authorization header with your expired access_token is required. As well as the refresh_token as a query param.

Parameters

Name In Type Required Description
grant_type query string false optional, at this point only 'refresh_token' is valid
refresh_token query string false Your existing refresh token

Example responses

201 Response

{
  "access_token": "string",
  "refresh_token": "string",
  "token_type": "string",
  "expires": 0
}

Responses

Status Meaning Description Schema
201 Created Access and refresh token details. OauthToken

Availability

list

Code samples

GET /v1/availability?from=2021-01-01&days=5&street=200%20W.%20Washington%20Street&city=Phoenix&state=AZ&zipCode=85003 HTTP/1.1

Accept: application/json

# You can also use wget
curl -X GET /v1/availability?from=2021-01-01&days=5&street=200%20W.%20Washington%20Street&city=Phoenix&state=AZ&zipCode=85003 \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'


const headers = {
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}'
};

fetch('/v1/availability?from=2021-01-01&days=5&street=200%20W.%20Washington%20Street&city=Phoenix&state=AZ&zipCode=85003',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

URL obj = new URL("/v1/availability?from=2021-01-01&days=5&street=200%20W.%20Washington%20Street&city=Phoenix&state=AZ&zipCode=85003");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/json',
    'Authorization' => 'Bearer {access-token}',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','/v1/availability', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "Authorization": []string{"Bearer {access-token}"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "/v1/availability", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.get('/v1/availability', params={
  'from': '2021-01-01',  'days': '5',  'street': '200 W. Washington Street',  'city': 'Phoenix',  'state': 'AZ',  'zipCode': '85003'
}, headers = headers)

print(r.json())

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.get '/v1/availability',
  params: {
  'from' => 'string(date)',
'days' => 'number',
'street' => 'string',
'city' => 'string',
'state' => 'string',
'zipCode' => 'string'
}, headers: headers

p JSON.parse(result)

GET /v1/availability

Returns a list of appointment slots grouped by day. Available slots will have a booking key, this key is required when using the appointment endpoint to book an appointment.

Parameters

Name In Type Required Description
from query string(date) true The first date to query appointment availability in the YYYY-MM-DD format
days query number true The number of days to return appointment availability for
street query string true The street address for the appointment
unit query string false The unit number for the appointment
city query string true The city for the appointment
state query string true The 2 character state code for the appointment
zipCode query string true The 5 digit zip code for the appointment

Example responses

200 Response

{
  "serviceable": true,
  "data": [
    {
      "date": "2021-07-01",
      "slots": [
        {
          "key": "yGDknWzB74gP8zpET+HrI3jQVyq4ss/ENX38C1eJSR3D7zCHGloM0URG8V2y1nltsTgvED2q/ZcyJZzfZcWc021/Hg1TWICUkDXl627QDdytvUGsEcy9dqpxtqNLmkCtBRcQHnbgaSIR9E7gZ/5fj6NfTwnRH1coitxlOUCsrm9x76l80saizu9M3L5UqafNB7MtbkcCtfB4h9nubzUXahEbXPq0wFvbt/2VQl7311Vgro9XC3k/CbeBMtiQXhSMqslRop44NJO7Rp6qHEjsrZOJVfcKd3ASuYFEspBi+J+ddRilOS4p06Ai8nhrIx3pbLXoRm4aSqNaLCx5lbldLeh08ozRBt3oBGZDzwxdsYzu8iBgxMMGbH/AUpuR+7Lh9YE=",
          "start": "2021-07-01T12:00:00.000Z",
          "end": "2021-07-01T13:00:00.000Z",
          "expiresAt": "2021-06-22T12:00:00.000Z",
          "price": "2900",
          "priority": true,
          "available": 3
        }
      ]
    }
  ],
  "tz": "America/Phoenix"
}

Responses

Status Meaning Description Schema
200 OK The available appointment timeslots grouped by day AvailabilityResponse
400 Bad Request Invalid request data BadRequest

Appointment

create

Code samples

POST /v1/appointment HTTP/1.1

Content-Type: application/json
Accept: application/json

# You can also use wget
curl -X POST /v1/appointment \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

const inputBody = '{
  "key": "SFG8HHp01ZNwi+/prwl2CmKSlZZHByJLjf27E5l+f7I+suxFY0QYkTWtxJ4xr5n/IsMm2LTrUADDHRGuzo6F/abaLdGMvHxvf7CSwQxlit7pel3SK0c8HwxllGG3UWq21GV1x/SkvITGDAUUAwFHZ/urGzhgKf4DQkKiZctPVFRvfGq1ash4ZV7HfdbBviswl5w6ORSmYwwae6zQx+//h83DcfO7xIMbjamoJDfoDUS0v5ZftVeN3KjjBdCd4nunBy6YTsEnlVQaJqTa4uSwu++ddZ6/ZTw5nEIgSQjhQL9uJd9YgC3ir4oyw0reI9NsHgp5vdO1TIVSodfMUv8NYB23v3mWKyeI21xehM32wAUs/u0JkXBGrWrUNM+Q2PaP3hZQJrh3DQ==",
  "patientId": "460a6d87-689c-4661-a526-a52450bbe2d7",
  "labOrderDetails": [
    {
      "contactName": "Jane Doe",
      "contactPhone": "6025554567",
      "labOrderFileIds": [
        "9b45fe45-79ed-40aa-9bc3-f358a7c6e6d1"
      ]
    }
  ],
  "paymentMethod": "pm_1DkAUlB70neqlGn3zQESm7pl",
  "behalfOf": {
    "firstName": "string",
    "lastName": "string",
    "email": "string",
    "phoneNumber": "string",
    "isLegalGuardian": true,
    "shouldNotify": true
  },
  "parkingInstruction": "Park on street."
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}'
};

fetch('/v1/appointment',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

URL obj = new URL("/v1/appointment");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

<?php

require 'vendor/autoload.php';

$headers = array(
    'Content-Type' => 'application/json',
    'Accept' => 'application/json',
    'Authorization' => 'Bearer {access-token}',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('POST','/v1/appointment', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
        "Authorization": []string{"Bearer {access-token}"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "/v1/appointment", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.post('/v1/appointment', headers = headers)

print(r.json())

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.post '/v1/appointment',
  params: {
  }, headers: headers

p JSON.parse(result)

POST /v1/appointment

Creates a new appointment. There are a couple prerequisite requirements before creating an appointment:

  1. Retrieve a patient ID from the patient endpoint.
  2. Retrieve a booking key from the availability endpoint. The time and location of the appointment is retrieved from this key.
  3. (optional) Upload any required lab order files to the lab order endpoint and use those file IDs when creating the appointment.

Body parameter

{
  "key": "SFG8HHp01ZNwi+/prwl2CmKSlZZHByJLjf27E5l+f7I+suxFY0QYkTWtxJ4xr5n/IsMm2LTrUADDHRGuzo6F/abaLdGMvHxvf7CSwQxlit7pel3SK0c8HwxllGG3UWq21GV1x/SkvITGDAUUAwFHZ/urGzhgKf4DQkKiZctPVFRvfGq1ash4ZV7HfdbBviswl5w6ORSmYwwae6zQx+//h83DcfO7xIMbjamoJDfoDUS0v5ZftVeN3KjjBdCd4nunBy6YTsEnlVQaJqTa4uSwu++ddZ6/ZTw5nEIgSQjhQL9uJd9YgC3ir4oyw0reI9NsHgp5vdO1TIVSodfMUv8NYB23v3mWKyeI21xehM32wAUs/u0JkXBGrWrUNM+Q2PaP3hZQJrh3DQ==",
  "patientId": "460a6d87-689c-4661-a526-a52450bbe2d7",
  "labOrderDetails": [
    {
      "contactName": "Jane Doe",
      "contactPhone": "6025554567",
      "labOrderFileIds": [
        "9b45fe45-79ed-40aa-9bc3-f358a7c6e6d1"
      ]
    }
  ],
  "paymentMethod": "pm_1DkAUlB70neqlGn3zQESm7pl",
  "behalfOf": {
    "firstName": "string",
    "lastName": "string",
    "email": "string",
    "phoneNumber": "string",
    "isLegalGuardian": true,
    "shouldNotify": true
  },
  "parkingInstruction": "Park on street."
}

Parameters

Name In Type Required Description
body body AppointmentBook true none

Example responses

201 Response

{
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "identifier": "PWDYA7",
  "status": "pending",
  "patient": {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "email": "user@example.com",
    "phoneNumber": "6025554567",
    "firstName": "Jane",
    "lastName": "Doe",
    "dob": "1977-07-08",
    "birthSex": "female",
    "guardian": {
      "name": "Jane Doe",
      "relationship": "Mother"
    },
    "insurance": {
      "front": {
        "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
        "name": "lab-order.pdf",
        "purpose": "lab-order",
        "size": 13264
      },
      "rear": {
        "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
        "name": "lab-order.pdf",
        "purpose": "lab-order",
        "size": 13264
      }
    }
  },
  "labOrderDetails": [
    {
      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
      "contactName": "Jane Doe",
      "contactPhone": "6025554567",
      "labOrderFiles": [
        {
          "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
          "name": "lab-order.pdf",
          "purpose": "lab-order",
          "size": 13264
        }
      ]
    }
  ],
  "startAt": "2021-07-01T12:00:00.000Z",
  "endAt": "2021-07-01T13:00:00.000Z",
  "address": {
    "street": "200 W. Washington Street",
    "unit": "Suite 205",
    "city": "Phoenix",
    "state": "AZ",
    "zipCode": "85003"
  },
  "isRefundable": true,
  "isRebookable": true,
  "cancellationReason": {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "name": "Scheduled time no longer works",
    "isRefundable": true
  },
  "cancellationNote": "string",
  "behalfOf": {
    "firstName": "string",
    "lastName": "string",
    "email": "string",
    "phoneNumber": "string",
    "isLegalGuardian": true,
    "shouldNotify": true
  },
  "parkingInstruction": "Park on street."
}

Responses

Status Meaning Description Schema
201 Created The newly created appointment Appointment
400 Bad Request Invalid request data BadRequest

read

Code samples

GET /v1/appointment/{id} HTTP/1.1

Accept: application/json

# You can also use wget
curl -X GET /v1/appointment/{id} \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'


const headers = {
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}'
};

fetch('/v1/appointment/{id}',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

URL obj = new URL("/v1/appointment/{id}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/json',
    'Authorization' => 'Bearer {access-token}',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','/v1/appointment/{id}', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "Authorization": []string{"Bearer {access-token}"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "/v1/appointment/{id}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.get('/v1/appointment/{id}', headers = headers)

print(r.json())

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.get '/v1/appointment/{id}',
  params: {
  }, headers: headers

p JSON.parse(result)

GET /v1/appointment/{id}

Fetches an existing appointment

Parameters

Name In Type Required Description
id path string(uuid) true The appointment ID

Example responses

200 Response

{
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "identifier": "PWDYA7",
  "status": "pending",
  "patient": {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "email": "user@example.com",
    "phoneNumber": "6025554567",
    "firstName": "Jane",
    "lastName": "Doe",
    "dob": "1977-07-08",
    "birthSex": "female",
    "guardian": {
      "name": "Jane Doe",
      "relationship": "Mother"
    },
    "insurance": {
      "front": {
        "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
        "name": "lab-order.pdf",
        "purpose": "lab-order",
        "size": 13264
      },
      "rear": {
        "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
        "name": "lab-order.pdf",
        "purpose": "lab-order",
        "size": 13264
      }
    }
  },
  "labOrderDetails": [
    {
      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
      "contactName": "Jane Doe",
      "contactPhone": "6025554567",
      "labOrderFiles": [
        {
          "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
          "name": "lab-order.pdf",
          "purpose": "lab-order",
          "size": 13264
        }
      ]
    }
  ],
  "startAt": "2021-07-01T12:00:00.000Z",
  "endAt": "2021-07-01T13:00:00.000Z",
  "address": {
    "street": "200 W. Washington Street",
    "unit": "Suite 205",
    "city": "Phoenix",
    "state": "AZ",
    "zipCode": "85003"
  },
  "isRefundable": true,
  "isRebookable": true,
  "cancellationReason": {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "name": "Scheduled time no longer works",
    "isRefundable": true
  },
  "cancellationNote": "string",
  "behalfOf": {
    "firstName": "string",
    "lastName": "string",
    "email": "string",
    "phoneNumber": "string",
    "isLegalGuardian": true,
    "shouldNotify": true
  },
  "parkingInstruction": "Park on street."
}

Responses

Status Meaning Description Schema
200 OK The existing appointment Appointment
404 Not Found The appointment does not exist NotFound

rebook

Code samples

PATCH /v1/appointment/{id}/rebook HTTP/1.1

Content-Type: application/json
Accept: application/json

# You can also use wget
curl -X PATCH /v1/appointment/{id}/rebook \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

const inputBody = '{
  "key": "SFG8HHp01ZNwi+/prwl2CmKSlZZHByJLjf27E5l+f7I+suxFY0QYkTWtxJ4xr5n/IsMm2LTrUADDHRGuzo6F/abaLdGMvHxvf7CSwQxlit7pel3SK0c8HwxllGG3UWq21GV1x/SkvITGDAUUAwFHZ/urGzhgKf4DQkKiZctPVFRvfGq1ash4ZV7HfdbBviswl5w6ORSmYwwae6zQx+//h83DcfO7xIMbjamoJDfoDUS0v5ZftVeN3KjjBdCd4nunBy6YTsEnlVQaJqTa4uSwu++ddZ6/ZTw5nEIgSQjhQL9uJd9YgC3ir4oyw0reI9NsHgp5vdO1TIVSodfMUv8NYB23v3mWKyeI21xehM32wAUs/u0JkXBGrWrUNM+Q2PaP3hZQJrh3DQ=="
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}'
};

fetch('/v1/appointment/{id}/rebook',
{
  method: 'PATCH',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

URL obj = new URL("/v1/appointment/{id}/rebook");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PATCH");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

<?php

require 'vendor/autoload.php';

$headers = array(
    'Content-Type' => 'application/json',
    'Accept' => 'application/json',
    'Authorization' => 'Bearer {access-token}',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('PATCH','/v1/appointment/{id}/rebook', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
        "Authorization": []string{"Bearer {access-token}"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("PATCH", "/v1/appointment/{id}/rebook", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.patch('/v1/appointment/{id}/rebook', headers = headers)

print(r.json())

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.patch '/v1/appointment/{id}/rebook',
  params: {
  }, headers: headers

p JSON.parse(result)

PATCH /v1/appointment/{id}/rebook

Change the time or address of an existing appointment. A new booking key must first be retrieved from the availability endpoint.

Body parameter

{
  "key": "SFG8HHp01ZNwi+/prwl2CmKSlZZHByJLjf27E5l+f7I+suxFY0QYkTWtxJ4xr5n/IsMm2LTrUADDHRGuzo6F/abaLdGMvHxvf7CSwQxlit7pel3SK0c8HwxllGG3UWq21GV1x/SkvITGDAUUAwFHZ/urGzhgKf4DQkKiZctPVFRvfGq1ash4ZV7HfdbBviswl5w6ORSmYwwae6zQx+//h83DcfO7xIMbjamoJDfoDUS0v5ZftVeN3KjjBdCd4nunBy6YTsEnlVQaJqTa4uSwu++ddZ6/ZTw5nEIgSQjhQL9uJd9YgC3ir4oyw0reI9NsHgp5vdO1TIVSodfMUv8NYB23v3mWKyeI21xehM32wAUs/u0JkXBGrWrUNM+Q2PaP3hZQJrh3DQ=="
}

Parameters

Name In Type Required Description
id path string(uuid) true The appointment ID
body body AppointmentBookingKey true none

Example responses

200 Response

{
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "identifier": "PWDYA7",
  "status": "pending",
  "patient": {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "email": "user@example.com",
    "phoneNumber": "6025554567",
    "firstName": "Jane",
    "lastName": "Doe",
    "dob": "1977-07-08",
    "birthSex": "female",
    "guardian": {
      "name": "Jane Doe",
      "relationship": "Mother"
    },
    "insurance": {
      "front": {
        "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
        "name": "lab-order.pdf",
        "purpose": "lab-order",
        "size": 13264
      },
      "rear": {
        "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
        "name": "lab-order.pdf",
        "purpose": "lab-order",
        "size": 13264
      }
    }
  },
  "labOrderDetails": [
    {
      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
      "contactName": "Jane Doe",
      "contactPhone": "6025554567",
      "labOrderFiles": [
        {
          "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
          "name": "lab-order.pdf",
          "purpose": "lab-order",
          "size": 13264
        }
      ]
    }
  ],
  "startAt": "2021-07-01T12:00:00.000Z",
  "endAt": "2021-07-01T13:00:00.000Z",
  "address": {
    "street": "200 W. Washington Street",
    "unit": "Suite 205",
    "city": "Phoenix",
    "state": "AZ",
    "zipCode": "85003"
  },
  "isRefundable": true,
  "isRebookable": true,
  "cancellationReason": {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "name": "Scheduled time no longer works",
    "isRefundable": true
  },
  "cancellationNote": "string",
  "behalfOf": {
    "firstName": "string",
    "lastName": "string",
    "email": "string",
    "phoneNumber": "string",
    "isLegalGuardian": true,
    "shouldNotify": true
  },
  "parkingInstruction": "Park on street."
}

Responses

Status Meaning Description Schema
200 OK The modified appointment Appointment
400 Bad Request Invalid request data BadRequest
404 Not Found The appointment does not exist NotFound

cancel

Code samples

PATCH /v1/appointment/{id}/cancel HTTP/1.1

Content-Type: application/json
Accept: application/json

# You can also use wget
curl -X PATCH /v1/appointment/{id}/cancel \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

const inputBody = '{
  "cancellationReasonId": "bbe18b64-79e3-4309-b8ed-556d65f0d00a",
  "note": "Circumstances caused the patient to be unable to make it"
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}'
};

fetch('/v1/appointment/{id}/cancel',
{
  method: 'PATCH',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

URL obj = new URL("/v1/appointment/{id}/cancel");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PATCH");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

<?php

require 'vendor/autoload.php';

$headers = array(
    'Content-Type' => 'application/json',
    'Accept' => 'application/json',
    'Authorization' => 'Bearer {access-token}',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('PATCH','/v1/appointment/{id}/cancel', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
        "Authorization": []string{"Bearer {access-token}"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("PATCH", "/v1/appointment/{id}/cancel", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.patch('/v1/appointment/{id}/cancel', headers = headers)

print(r.json())

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.patch '/v1/appointment/{id}/cancel',
  params: {
  }, headers: headers

p JSON.parse(result)

PATCH /v1/appointment/{id}/cancel

Cancels an existing appointment. A cancellation reason ID from the cancellation-reason endpoint is required. If the reason is "Other" then a note explaining the reason is also required.

Body parameter

{
  "cancellationReasonId": "bbe18b64-79e3-4309-b8ed-556d65f0d00a",
  "note": "Circumstances caused the patient to be unable to make it"
}

Parameters

Name In Type Required Description
id path string(uuid) true The appointment ID
body body AppointmentCancel true none

Example responses

200 Response

{
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "identifier": "PWDYA7",
  "status": "pending",
  "patient": {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "email": "user@example.com",
    "phoneNumber": "6025554567",
    "firstName": "Jane",
    "lastName": "Doe",
    "dob": "1977-07-08",
    "birthSex": "female",
    "guardian": {
      "name": "Jane Doe",
      "relationship": "Mother"
    },
    "insurance": {
      "front": {
        "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
        "name": "lab-order.pdf",
        "purpose": "lab-order",
        "size": 13264
      },
      "rear": {
        "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
        "name": "lab-order.pdf",
        "purpose": "lab-order",
        "size": 13264
      }
    }
  },
  "labOrderDetails": [
    {
      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
      "contactName": "Jane Doe",
      "contactPhone": "6025554567",
      "labOrderFiles": [
        {
          "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
          "name": "lab-order.pdf",
          "purpose": "lab-order",
          "size": 13264
        }
      ]
    }
  ],
  "startAt": "2021-07-01T12:00:00.000Z",
  "endAt": "2021-07-01T13:00:00.000Z",
  "address": {
    "street": "200 W. Washington Street",
    "unit": "Suite 205",
    "city": "Phoenix",
    "state": "AZ",
    "zipCode": "85003"
  },
  "isRefundable": true,
  "isRebookable": true,
  "cancellationReason": {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "name": "Scheduled time no longer works",
    "isRefundable": true
  },
  "cancellationNote": "string",
  "behalfOf": {
    "firstName": "string",
    "lastName": "string",
    "email": "string",
    "phoneNumber": "string",
    "isLegalGuardian": true,
    "shouldNotify": true
  },
  "parkingInstruction": "Park on street."
}

Responses

Status Meaning Description Schema
200 OK The cancelled appointment Appointment
400 Bad Request Invalid request data BadRequest
404 Not Found The appointment does not exist NotFound

Lab Order Details

create

Code samples

POST /v1/appointment/{appointmentId}/lab-order-details HTTP/1.1

Content-Type: application/json
Accept: application/json

# You can also use wget
curl -X POST /v1/appointment/{appointmentId}/lab-order-details \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

const inputBody = '{
  "contactName": "Jane Doe",
  "contactPhone": "6025554567",
  "labOrderFileIds": [
    "9b45fe45-79ed-40aa-9bc3-f358a7c6e6d1"
  ]
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}'
};

fetch('/v1/appointment/{appointmentId}/lab-order-details',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

URL obj = new URL("/v1/appointment/{appointmentId}/lab-order-details");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

<?php

require 'vendor/autoload.php';

$headers = array(
    'Content-Type' => 'application/json',
    'Accept' => 'application/json',
    'Authorization' => 'Bearer {access-token}',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('POST','/v1/appointment/{appointmentId}/lab-order-details', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
        "Authorization": []string{"Bearer {access-token}"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "/v1/appointment/{appointmentId}/lab-order-details", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.post('/v1/appointment/{appointmentId}/lab-order-details', headers = headers)

print(r.json())

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.post '/v1/appointment/{appointmentId}/lab-order-details',
  params: {
  }, headers: headers

p JSON.parse(result)

POST /v1/appointment/{appointmentId}/lab-order-details

Adds lab order details to an existing appointment. Only appointments with a status of "pending" can be modified.

Body parameter

{
  "contactName": "Jane Doe",
  "contactPhone": "6025554567",
  "labOrderFileIds": [
    "9b45fe45-79ed-40aa-9bc3-f358a7c6e6d1"
  ]
}

Parameters

Name In Type Required Description
appointmentId path string(uuid) true The appointment ID
body body LabOrderDetails true The new lab order details

Example responses

200 Response

{
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "identifier": "PWDYA7",
  "status": "pending",
  "patient": {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "email": "user@example.com",
    "phoneNumber": "6025554567",
    "firstName": "Jane",
    "lastName": "Doe",
    "dob": "1977-07-08",
    "birthSex": "female",
    "guardian": {
      "name": "Jane Doe",
      "relationship": "Mother"
    },
    "insurance": {
      "front": {
        "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
        "name": "lab-order.pdf",
        "purpose": "lab-order",
        "size": 13264
      },
      "rear": {
        "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
        "name": "lab-order.pdf",
        "purpose": "lab-order",
        "size": 13264
      }
    }
  },
  "labOrderDetails": [
    {
      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
      "contactName": "Jane Doe",
      "contactPhone": "6025554567",
      "labOrderFiles": [
        {
          "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
          "name": "lab-order.pdf",
          "purpose": "lab-order",
          "size": 13264
        }
      ]
    }
  ],
  "startAt": "2021-07-01T12:00:00.000Z",
  "endAt": "2021-07-01T13:00:00.000Z",
  "address": {
    "street": "200 W. Washington Street",
    "unit": "Suite 205",
    "city": "Phoenix",
    "state": "AZ",
    "zipCode": "85003"
  },
  "isRefundable": true,
  "isRebookable": true,
  "cancellationReason": {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "name": "Scheduled time no longer works",
    "isRefundable": true
  },
  "cancellationNote": "string",
  "behalfOf": {
    "firstName": "string",
    "lastName": "string",
    "email": "string",
    "phoneNumber": "string",
    "isLegalGuardian": true,
    "shouldNotify": true
  },
  "parkingInstruction": "Park on street."
}

Responses

Status Meaning Description Schema
200 OK The updated appointment Appointment
400 Bad Request Invalid request data BadRequest
404 Not Found The appointment does not exist NotFound

delete

Code samples

DELETE /v1/appointment/{appointmentId}/lab-order-details/{id} HTTP/1.1

Accept: application/json

# You can also use wget
curl -X DELETE /v1/appointment/{appointmentId}/lab-order-details/{id} \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'


const headers = {
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}'
};

fetch('/v1/appointment/{appointmentId}/lab-order-details/{id}',
{
  method: 'DELETE',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

URL obj = new URL("/v1/appointment/{appointmentId}/lab-order-details/{id}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("DELETE");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/json',
    'Authorization' => 'Bearer {access-token}',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('DELETE','/v1/appointment/{appointmentId}/lab-order-details/{id}', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "Authorization": []string{"Bearer {access-token}"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("DELETE", "/v1/appointment/{appointmentId}/lab-order-details/{id}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.delete('/v1/appointment/{appointmentId}/lab-order-details/{id}', headers = headers)

print(r.json())

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.delete '/v1/appointment/{appointmentId}/lab-order-details/{id}',
  params: {
  }, headers: headers

p JSON.parse(result)

DELETE /v1/appointment/{appointmentId}/lab-order-details/{id}

Remove lab order details from an existing appointment. Each appointment requires at least one lab order, if the last one needs to be deleted add a new one first. Only appointments with a status of "pending" can be modified.

Parameters

Name In Type Required Description
id path string(uuid) true The lab order details ID to be deleted
appointmentId path string(uuid) true The appointment ID

Example responses

200 Response

{
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "identifier": "PWDYA7",
  "status": "pending",
  "patient": {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "email": "user@example.com",
    "phoneNumber": "6025554567",
    "firstName": "Jane",
    "lastName": "Doe",
    "dob": "1977-07-08",
    "birthSex": "female",
    "guardian": {
      "name": "Jane Doe",
      "relationship": "Mother"
    },
    "insurance": {
      "front": {
        "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
        "name": "lab-order.pdf",
        "purpose": "lab-order",
        "size": 13264
      },
      "rear": {
        "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
        "name": "lab-order.pdf",
        "purpose": "lab-order",
        "size": 13264
      }
    }
  },
  "labOrderDetails": [
    {
      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
      "contactName": "Jane Doe",
      "contactPhone": "6025554567",
      "labOrderFiles": [
        {
          "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
          "name": "lab-order.pdf",
          "purpose": "lab-order",
          "size": 13264
        }
      ]
    }
  ],
  "startAt": "2021-07-01T12:00:00.000Z",
  "endAt": "2021-07-01T13:00:00.000Z",
  "address": {
    "street": "200 W. Washington Street",
    "unit": "Suite 205",
    "city": "Phoenix",
    "state": "AZ",
    "zipCode": "85003"
  },
  "isRefundable": true,
  "isRebookable": true,
  "cancellationReason": {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "name": "Scheduled time no longer works",
    "isRefundable": true
  },
  "cancellationNote": "string",
  "behalfOf": {
    "firstName": "string",
    "lastName": "string",
    "email": "string",
    "phoneNumber": "string",
    "isLegalGuardian": true,
    "shouldNotify": true
  },
  "parkingInstruction": "Park on street."
}

Responses

Status Meaning Description Schema
200 OK The updated appointment Appointment
400 Bad Request Invalid request data BadRequest
404 Not Found The appointment or lab order details does not exist NotFound

Patient

create

Code samples

POST /v1/patient HTTP/1.1

Content-Type: application/json
Accept: application/json

# You can also use wget
curl -X POST /v1/patient \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

const inputBody = '{
  "email": "user@example.com",
  "phoneNumber": "6025554567",
  "firstName": "Jane",
  "lastName": "Doe",
  "dob": "1977-07-08",
  "birthSex": "female",
  "guardian": {
    "name": "Jane Doe",
    "relationship": "Mother"
  },
  "insurance": {
    "frontId": "9b45fe45-79ed-40aa-9bc3-f358a7c6e6d1",
    "rearId": "9b45fe45-79ed-40aa-9bc3-f358a7c6e6d1"
  }
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}'
};

fetch('/v1/patient',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

URL obj = new URL("/v1/patient");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

<?php

require 'vendor/autoload.php';

$headers = array(
    'Content-Type' => 'application/json',
    'Accept' => 'application/json',
    'Authorization' => 'Bearer {access-token}',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('POST','/v1/patient', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
        "Authorization": []string{"Bearer {access-token}"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "/v1/patient", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.post('/v1/patient', headers = headers)

print(r.json())

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.post '/v1/patient',
  params: {
  }, headers: headers

p JSON.parse(result)

POST /v1/patient

Returns either an existing patient that matches the passed information or creates a new patient.

The patient's email, date of birth and birth sex are used to look up the patient. If the patient's email address already exists but the date of birth or birth sex does not match our records then a bad request error is returned.

If the phone number provided already exists on another patient's profile a bad request error is returned.

Body parameter

{
  "email": "user@example.com",
  "phoneNumber": "6025554567",
  "firstName": "Jane",
  "lastName": "Doe",
  "dob": "1977-07-08",
  "birthSex": "female",
  "guardian": {
    "name": "Jane Doe",
    "relationship": "Mother"
  },
  "insurance": {
    "frontId": "9b45fe45-79ed-40aa-9bc3-f358a7c6e6d1",
    "rearId": "9b45fe45-79ed-40aa-9bc3-f358a7c6e6d1"
  }
}

Parameters

Name In Type Required Description
body body Patient true none

Example responses

201 Response

{
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "email": "user@example.com",
  "phoneNumber": "6025554567",
  "firstName": "Jane",
  "lastName": "Doe",
  "dob": "1977-07-08",
  "birthSex": "female",
  "guardian": {
    "name": "Jane Doe",
    "relationship": "Mother"
  },
  "insurance": {
    "front": {
      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
      "name": "lab-order.pdf",
      "purpose": "lab-order",
      "size": 13264
    },
    "rear": {
      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
      "name": "lab-order.pdf",
      "purpose": "lab-order",
      "size": 13264
    }
  }
}

Responses

Status Meaning Description Schema
201 Created The requested patient Patient
400 Bad Request Invalid request data BadRequest

read

Code samples

GET /v1/patient/{id} HTTP/1.1

Accept: application/json

# You can also use wget
curl -X GET /v1/patient/{id} \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'


const headers = {
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}'
};

fetch('/v1/patient/{id}',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

URL obj = new URL("/v1/patient/{id}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/json',
    'Authorization' => 'Bearer {access-token}',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','/v1/patient/{id}', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "Authorization": []string{"Bearer {access-token}"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "/v1/patient/{id}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.get('/v1/patient/{id}', headers = headers)

print(r.json())

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.get '/v1/patient/{id}',
  params: {
  }, headers: headers

p JSON.parse(result)

GET /v1/patient/{id}

Fetches an existing patient

Parameters

Name In Type Required Description
id path string(uuid) true The patient ID

Example responses

200 Response

{
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "email": "user@example.com",
  "phoneNumber": "6025554567",
  "firstName": "Jane",
  "lastName": "Doe",
  "dob": "1977-07-08",
  "birthSex": "female",
  "guardian": {
    "name": "Jane Doe",
    "relationship": "Mother"
  },
  "insurance": {
    "front": {
      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
      "name": "lab-order.pdf",
      "purpose": "lab-order",
      "size": 13264
    },
    "rear": {
      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
      "name": "lab-order.pdf",
      "purpose": "lab-order",
      "size": 13264
    }
  }
}

Responses

Status Meaning Description Schema
200 OK The patient's details Patient
404 Not Found The patient does not exist NotFound

update

Code samples

PATCH /v1/patient/{id} HTTP/1.1

Content-Type: application/json
Accept: application/json

# You can also use wget
curl -X PATCH /v1/patient/{id} \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

const inputBody = '{
  "guardian": {
    "name": "Jane Doe",
    "relationship": "Mother"
  },
  "insurance": {
    "frontId": "9b45fe45-79ed-40aa-9bc3-f358a7c6e6d1",
    "rearId": "9b45fe45-79ed-40aa-9bc3-f358a7c6e6d1"
  }
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}'
};

fetch('/v1/patient/{id}',
{
  method: 'PATCH',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

URL obj = new URL("/v1/patient/{id}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PATCH");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

<?php

require 'vendor/autoload.php';

$headers = array(
    'Content-Type' => 'application/json',
    'Accept' => 'application/json',
    'Authorization' => 'Bearer {access-token}',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('PATCH','/v1/patient/{id}', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
        "Authorization": []string{"Bearer {access-token}"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("PATCH", "/v1/patient/{id}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.patch('/v1/patient/{id}', headers = headers)

print(r.json())

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.patch '/v1/patient/{id}',
  params: {
  }, headers: headers

p JSON.parse(result)

PATCH /v1/patient/{id}

Updates an existing patient's details

Body parameter

{
  "guardian": {
    "name": "Jane Doe",
    "relationship": "Mother"
  },
  "insurance": {
    "frontId": "9b45fe45-79ed-40aa-9bc3-f358a7c6e6d1",
    "rearId": "9b45fe45-79ed-40aa-9bc3-f358a7c6e6d1"
  }
}

Parameters

Name In Type Required Description
id path string(uuid) true The patient ID
body body PatientUpdate true none

Example responses

200 Response

{
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "email": "user@example.com",
  "phoneNumber": "6025554567",
  "firstName": "Jane",
  "lastName": "Doe",
  "dob": "1977-07-08",
  "birthSex": "female",
  "guardian": {
    "name": "Jane Doe",
    "relationship": "Mother"
  },
  "insurance": {
    "front": {
      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
      "name": "lab-order.pdf",
      "purpose": "lab-order",
      "size": 13264
    },
    "rear": {
      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
      "name": "lab-order.pdf",
      "purpose": "lab-order",
      "size": 13264
    }
  }
}

Responses

Status Meaning Description Schema
200 OK The patient's details Patient
404 Not Found The patient does not exist NotFound

File

create

Code samples

POST /v1/file HTTP/1.1

Content-Type: application/json
Accept: application/json

# You can also use wget
curl -X POST /v1/file \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

const inputBody = '{
  "name": "lab-order.pdf",
  "purpose": "lab-order",
  "data": "string"
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}'
};

fetch('/v1/file',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

URL obj = new URL("/v1/file");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

<?php

require 'vendor/autoload.php';

$headers = array(
    'Content-Type' => 'application/json',
    'Accept' => 'application/json',
    'Authorization' => 'Bearer {access-token}',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('POST','/v1/file', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
        "Authorization": []string{"Bearer {access-token}"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "/v1/file", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.post('/v1/file', headers = headers)

print(r.json())

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.post '/v1/file',
  params: {
  }, headers: headers

p JSON.parse(result)

POST /v1/file

Uploads a Base64 encoded file. If attaching a lab order file to an appointment it is first uploaded to this endpoint and the ID is used when creating the appointment. File types accepted are png, jpeg and pdf.

Body parameter

{
  "name": "lab-order.pdf",
  "purpose": "lab-order",
  "data": "string"
}

Parameters

Name In Type Required Description
body body File true none

Example responses

201 Response

{
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "name": "lab-order.pdf",
  "purpose": "lab-order",
  "size": 13264
}

Responses

Status Meaning Description Schema
201 Created The newly created file File
400 Bad Request Invalid request data BadRequest

Cancellation Reasons

list

Code samples

GET /v1/cancellation-reason HTTP/1.1

Accept: application/json

# You can also use wget
curl -X GET /v1/cancellation-reason \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'


const headers = {
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}'
};

fetch('/v1/cancellation-reason',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

URL obj = new URL("/v1/cancellation-reason");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/json',
    'Authorization' => 'Bearer {access-token}',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','/v1/cancellation-reason', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "Authorization": []string{"Bearer {access-token}"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "/v1/cancellation-reason", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.get('/v1/cancellation-reason', headers = headers)

print(r.json())

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.get '/v1/cancellation-reason',
  params: {
  }, headers: headers

p JSON.parse(result)

GET /v1/cancellation-reason

Returns a list of reasons an appointment can be cancelled. A cancellation reason ID is needed to cancel an appointment

Example responses

200 Response

[
  {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "name": "Scheduled time no longer works",
    "isRefundable": true
  }
]

Responses

Status Meaning Description Schema
200 OK An array of all the cancellation reasons Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
anonymous [CancellationReason] false none none
» id string(uuid) true read-only The ID of the cancellation reason
» name string true read-only What the cancellation reason is used for
» isRefundable boolean true read-only If true the patient is entitled to a refund after cancelling the appointment

Service Area

read

Code samples

GET /v1/service-area/zip-code/{zipCode} HTTP/1.1

Accept: application/json

# You can also use wget
curl -X GET /v1/service-area/zip-code/{zipCode} \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'


const headers = {
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}'
};

fetch('/v1/service-area/zip-code/{zipCode}',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

URL obj = new URL("/v1/service-area/zip-code/{zipCode}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/json',
    'Authorization' => 'Bearer {access-token}',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('GET','/v1/service-area/zip-code/{zipCode}', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "Authorization": []string{"Bearer {access-token}"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "/v1/service-area/zip-code/{zipCode}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.get('/v1/service-area/zip-code/{zipCode}', headers = headers)

print(r.json())

require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.get '/v1/service-area/zip-code/{zipCode}',
  params: {
  }, headers: headers

p JSON.parse(result)

GET /v1/service-area/zip-code/{zipCode}

Fetches a service area for a given zip code. It can be used to determine if Getlabs is able to book appointments for a given zip code.

Parameters

Name In Type Required Description
zipCode path string true The 5 digit zip code for the service area

Example responses

200 Response

{
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "city": "Phoenix",
  "county": "Maricopa County",
  "state": "AZ",
  "zipCode": "85003",
  "timezone": "America/Phoenix",
  "startDate": "2021-01-01T07:00:00.000Z",
  "endDate": "2022-01-01T07:00:00.000Z",
  "isActive": true
}

Responses

Status Meaning Description Schema
200 OK The service area details ServiceArea
404 Not Found No service area exists for the given zip code NotFound

Payment

create setup intent

Code samples

POST /v1/payment/setup HTTP/1.1

Content-Type: application/json
Accept: application/json

# You can also use wget
curl -X POST /v1/payment/setup \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

const inputBody = '{
  "patientId": "460a6d87-689c-4661-a526-a52450bbe2d7"
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}'
};

fetch('/v1/payment/setup',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

URL obj = new URL("/v1/payment/setup");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

<?php

require 'vendor/autoload.php';

$headers = array(
    'Content-Type' => 'application/json',
    'Accept' => 'application/json',
    'Authorization' => 'Bearer {access-token}',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('POST','/v1/payment/setup', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
        "Authorization": []string{"Bearer {access-token}"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "/v1/payment/setup", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.post('/v1/payment/setup', headers = headers)

print(r.json())

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.post '/v1/payment/setup',
  params: {
  }, headers: headers

p JSON.parse(result)

POST /v1/payment/setup

Creates a setup intent with Stripe. This is needed to collect a patient's credit card details using Stripe's client API. This endpoint is only used by partners who have opted for their patients to directly pay for the appointment.

Body parameter

{
  "patientId": "460a6d87-689c-4661-a526-a52450bbe2d7"
}

Parameters

Name In Type Required Description
body body PaymentCreateSetup true none

Example responses

201 Response

{
  "clientSecret": "seti_1Jv3iKB60neqlRn35yPUsJN6_secret_KaEA3x316GYgEyYZUgdiUo2K1cwoDbw"
}

Responses

Status Meaning Description Schema
201 Created The created Stripe setup intent PaymentSetup
400 Bad Request Invalid request data BadRequest

Schemas

Address

{
  "street": "200 W. Washington Street",
  "unit": "Suite 205",
  "city": "Phoenix",
  "state": "AZ",
  "zipCode": "85003"
}

Properties

Name Type Required Restrictions Description
street string true none Street address
unit string¦null false none Unit number
city string true none City
state string true none 2 character state code
zipCode string true none 5 digit zip code for the appointment

Appointment

{
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "identifier": "PWDYA7",
  "status": "pending",
  "patient": {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "email": "user@example.com",
    "phoneNumber": "6025554567",
    "firstName": "Jane",
    "lastName": "Doe",
    "dob": "1977-07-08",
    "birthSex": "female",
    "guardian": {
      "name": "Jane Doe",
      "relationship": "Mother"
    },
    "insurance": {
      "front": {
        "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
        "name": "lab-order.pdf",
        "purpose": "lab-order",
        "data": "string",
        "size": 13264
      },
      "rear": {
        "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
        "name": "lab-order.pdf",
        "purpose": "lab-order",
        "data": "string",
        "size": 13264
      },
      "frontId": "9b45fe45-79ed-40aa-9bc3-f358a7c6e6d1",
      "rearId": "9b45fe45-79ed-40aa-9bc3-f358a7c6e6d1"
    }
  },
  "labOrderDetails": [
    {
      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
      "contactName": "Jane Doe",
      "contactPhone": "6025554567",
      "labOrderFiles": [
        {
          "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
          "name": "lab-order.pdf",
          "purpose": "lab-order",
          "data": "string",
          "size": 13264
        }
      ],
      "labOrderFileIds": [
        "9b45fe45-79ed-40aa-9bc3-f358a7c6e6d1"
      ]
    }
  ],
  "startAt": "2021-07-01T12:00:00.000Z",
  "endAt": "2021-07-01T13:00:00.000Z",
  "address": {
    "street": "200 W. Washington Street",
    "unit": "Suite 205",
    "city": "Phoenix",
    "state": "AZ",
    "zipCode": "85003"
  },
  "isRefundable": true,
  "isRebookable": true,
  "cancellationReason": {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "name": "Scheduled time no longer works",
    "isRefundable": true
  },
  "cancellationNote": "string",
  "behalfOf": {
    "firstName": "string",
    "lastName": "string",
    "email": "string",
    "phoneNumber": "string",
    "isLegalGuardian": true,
    "shouldNotify": true
  },
  "parkingInstruction": "Park on street."
}

Properties

Name Type Required Restrictions Description
id string(uuid) true read-only none
identifier string true read-only A short identifier to reference the appointment
status string true read-only The current status of the appointment
patient Patient true none Patient details for the appointment
labOrderDetails [LabOrderDetails] true none Lab order details for the appointment
startAt string(date-time) true none Appointment start time
endAt string(date-time) true none Appointment end time
address Address true none Address where the appointment will take place
isRefundable boolean true read-only True if cancelling the appointment will result in a refund
isRebookable boolean true read-only True if the start time of the appointment can be changed
cancellationReason CancellationReason¦null false read-only The reason the appointment was cancelled
cancellationNote string¦null false read-only Any extra information as to why the appointment was cancelled
behalfOf BehalfOf¦null false none Details of the person booking on behalf of the patient.
parkingInstruction string¦null false none Instructions for parking.

Enumerated Values

Property Value
status pending
status confirmed
status in-progress
status completed
status cancelled

AppointmentBook

{
  "key": "SFG8HHp01ZNwi+/prwl2CmKSlZZHByJLjf27E5l+f7I+suxFY0QYkTWtxJ4xr5n/IsMm2LTrUADDHRGuzo6F/abaLdGMvHxvf7CSwQxlit7pel3SK0c8HwxllGG3UWq21GV1x/SkvITGDAUUAwFHZ/urGzhgKf4DQkKiZctPVFRvfGq1ash4ZV7HfdbBviswl5w6ORSmYwwae6zQx+//h83DcfO7xIMbjamoJDfoDUS0v5ZftVeN3KjjBdCd4nunBy6YTsEnlVQaJqTa4uSwu++ddZ6/ZTw5nEIgSQjhQL9uJd9YgC3ir4oyw0reI9NsHgp5vdO1TIVSodfMUv8NYB23v3mWKyeI21xehM32wAUs/u0JkXBGrWrUNM+Q2PaP3hZQJrh3DQ==",
  "patientId": "460a6d87-689c-4661-a526-a52450bbe2d7",
  "labOrderDetails": [
    {
      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
      "contactName": "Jane Doe",
      "contactPhone": "6025554567",
      "labOrderFiles": [
        {
          "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
          "name": "lab-order.pdf",
          "purpose": "lab-order",
          "data": "string",
          "size": 13264
        }
      ],
      "labOrderFileIds": [
        "9b45fe45-79ed-40aa-9bc3-f358a7c6e6d1"
      ]
    }
  ],
  "paymentMethod": "pm_1DkAUlB70neqlGn3zQESm7pl",
  "behalfOf": {
    "firstName": "string",
    "lastName": "string",
    "email": "string",
    "phoneNumber": "string",
    "isLegalGuardian": true,
    "shouldNotify": true
  },
  "parkingInstruction": "Park on street."
}

Properties

Name Type Required Restrictions Description
key string true none The booking key retrieved from the availability endpoint. A key is valid for 60 minutes after generation, to book an appointment after that a new key is needed.
patientId string(uuid) true none The patient's ID as retrieved from the /patient endpoint
labOrderDetails [LabOrderDetails] true none An array of LabOrderDetails objects. If the key being used is for a priority appointment then labOrderFileIds must be provided for at least one LabOrderDetail.
paymentMethod string false none The Stripe payment method ID fetched using the Stripe client API. This is only required if your account is setup to bill patients directly.
behalfOf BehalfOf false none Details of the person booking on behalf of the patient
parkingInstruction string false none Instructions for parking.

AppointmentBookingKey

{
  "key": "SFG8HHp01ZNwi+/prwl2CmKSlZZHByJLjf27E5l+f7I+suxFY0QYkTWtxJ4xr5n/IsMm2LTrUADDHRGuzo6F/abaLdGMvHxvf7CSwQxlit7pel3SK0c8HwxllGG3UWq21GV1x/SkvITGDAUUAwFHZ/urGzhgKf4DQkKiZctPVFRvfGq1ash4ZV7HfdbBviswl5w6ORSmYwwae6zQx+//h83DcfO7xIMbjamoJDfoDUS0v5ZftVeN3KjjBdCd4nunBy6YTsEnlVQaJqTa4uSwu++ddZ6/ZTw5nEIgSQjhQL9uJd9YgC3ir4oyw0reI9NsHgp5vdO1TIVSodfMUv8NYB23v3mWKyeI21xehM32wAUs/u0JkXBGrWrUNM+Q2PaP3hZQJrh3DQ=="
}

Properties

Name Type Required Restrictions Description
key string true none The booking key retrieved from the availability endpoint. A key is valid for 60 minutes after generation, to book an appointment after that a new key is needed.

AppointmentCancel

{
  "cancellationReasonId": "bbe18b64-79e3-4309-b8ed-556d65f0d00a",
  "note": "Circumstances caused the patient to be unable to make it"
}

Properties

Name Type Required Restrictions Description
cancellationReasonId string(uuid) true none The ID of the cancellation reason as retrieved from the cancellation-reason endpoint
note string false none Extra information as to why the appointment is being cancelled, this is required if the cancellation reason is "other"

AvailabilityResponse

{
  "serviceable": true,
  "data": [
    {
      "date": "2021-07-01",
      "slots": [
        {
          "key": "yGDknWzB74gP8zpET+HrI3jQVyq4ss/ENX38C1eJSR3D7zCHGloM0URG8V2y1nltsTgvED2q/ZcyJZzfZcWc021/Hg1TWICUkDXl627QDdytvUGsEcy9dqpxtqNLmkCtBRcQHnbgaSIR9E7gZ/5fj6NfTwnRH1coitxlOUCsrm9x76l80saizu9M3L5UqafNB7MtbkcCtfB4h9nubzUXahEbXPq0wFvbt/2VQl7311Vgro9XC3k/CbeBMtiQXhSMqslRop44NJO7Rp6qHEjsrZOJVfcKd3ASuYFEspBi+J+ddRilOS4p06Ai8nhrIx3pbLXoRm4aSqNaLCx5lbldLeh08ozRBt3oBGZDzwxdsYzu8iBgxMMGbH/AUpuR+7Lh9YE=",
          "start": "2021-07-01T12:00:00.000Z",
          "end": "2021-07-01T13:00:00.000Z",
          "expiresAt": "2021-06-22T12:00:00.000Z",
          "price": "2900",
          "priority": true,
          "available": 3
        }
      ]
    }
  ],
  "tz": "America/Phoenix"
}

Properties

Name Type Required Restrictions Description
serviceable boolean true none If the address is serviceable by Getlabs this will be true otherwise false
data [DaySlots] true none An array containing all the dates requested
tz string false none The timezone where the appointment will take place

BadRequest

{
  "statusCode": 400,
  "message": [
    {
      "property": "email",
      "constraints": {
        "isNotEmpty": "property should not be empty"
      },
      "children": [
        {}
      ]
    }
  ],
  "error": "Bad Request"
}

Properties

Name Type Required Restrictions Description
statusCode number true read-only The http status code
message [ValidationError] true read-only An array containing all ValidationErrors for the request
error string true read-only A string describing the type of error

Enumerated Values

Property Value
statusCode 400
error Bad Request

BehalfOf

{
  "firstName": "string",
  "lastName": "string",
  "email": "string",
  "phoneNumber": "string",
  "isLegalGuardian": true,
  "shouldNotify": true
}

Properties

Name Type Required Restrictions Description
firstName string false none First name of the person booking on behalf of
lastName string false none Last name of the person booking on behalf of
email string false none Email of the person booking on behalf of
phoneNumber string false none Phone number of the person booking on behalf of
isLegalGuardian boolean false none Are you the the patient's parent, legal guardian, or caretaker
shouldNotify boolean false none Should we notify you of the patient's appointment status?

CancellationReason

{
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "name": "Scheduled time no longer works",
  "isRefundable": true
}

Properties

Name Type Required Restrictions Description
id string(uuid) true read-only The ID of the cancellation reason
name string true read-only What the cancellation reason is used for
isRefundable boolean true read-only If true the patient is entitled to a refund after cancelling the appointment

DaySlots

{
  "date": "2021-07-01",
  "slots": [
    {
      "key": "yGDknWzB74gP8zpET+HrI3jQVyq4ss/ENX38C1eJSR3D7zCHGloM0URG8V2y1nltsTgvED2q/ZcyJZzfZcWc021/Hg1TWICUkDXl627QDdytvUGsEcy9dqpxtqNLmkCtBRcQHnbgaSIR9E7gZ/5fj6NfTwnRH1coitxlOUCsrm9x76l80saizu9M3L5UqafNB7MtbkcCtfB4h9nubzUXahEbXPq0wFvbt/2VQl7311Vgro9XC3k/CbeBMtiQXhSMqslRop44NJO7Rp6qHEjsrZOJVfcKd3ASuYFEspBi+J+ddRilOS4p06Ai8nhrIx3pbLXoRm4aSqNaLCx5lbldLeh08ozRBt3oBGZDzwxdsYzu8iBgxMMGbH/AUpuR+7Lh9YE=",
      "start": "2021-07-01T12:00:00.000Z",
      "end": "2021-07-01T13:00:00.000Z",
      "expiresAt": "2021-06-22T12:00:00.000Z",
      "price": "2900",
      "priority": true,
      "available": 3
    }
  ]
}

Properties

Name Type Required Restrictions Description
date string(date) true none The date the appointment slots are for
slots [Timeslot] true none none

File

{
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "name": "lab-order.pdf",
  "purpose": "lab-order",
  "data": "string",
  "size": 13264
}

Properties

Name Type Required Restrictions Description
id string(uuid) true read-only none
name string true none File name
purpose string true none The purpose of this file, must be one of the available options
data string true write-only Base64 encoded file contents, maximum size of 25 MB. The file MIME types allowed differ depending on the file "purpose":
* lab-order can be one of: application/pdf, image/png, image/jpeg
* insurance-front, insurance-rear can be one of: image/png, image/jpeg
size number true read-only The file size in bytes

Enumerated Values

Property Value
purpose lab-order
purpose insurance-front
purpose insurance-rear

Guardian

{
  "name": "Jane Doe",
  "relationship": "Mother"
}

Properties

Name Type Required Restrictions Description
name string¦null false none Name of the patient's guardian, this is required if the patient is under 18 years old
relationship string¦null false none Patient's relationship to the guardian, this is required if the patient is under 18 years old

Insurance

{
  "front": {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "name": "lab-order.pdf",
    "purpose": "lab-order",
    "data": "string",
    "size": 13264
  },
  "rear": {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "name": "lab-order.pdf",
    "purpose": "lab-order",
    "data": "string",
    "size": 13264
  },
  "frontId": "9b45fe45-79ed-40aa-9bc3-f358a7c6e6d1",
  "rearId": "9b45fe45-79ed-40aa-9bc3-f358a7c6e6d1"
}

Properties

Name Type Required Restrictions Description
front File¦null false read-only The file object representing the image of the front of the insurance
rear File¦null false read-only The file object representing the image of the rear of the insurance
frontId File(uuid) false write-only A file ID with a purpose of 'insurance-front' uploaded using the file endpoint
rearId File(uuid) false write-only A file ID with a purpose of 'insurance-rear' uploaded using the file endpoint

LabOrderDetails

{
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "contactName": "Jane Doe",
  "contactPhone": "6025554567",
  "labOrderFiles": [
    {
      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
      "name": "lab-order.pdf",
      "purpose": "lab-order",
      "data": "string",
      "size": 13264
    }
  ],
  "labOrderFileIds": [
    "9b45fe45-79ed-40aa-9bc3-f358a7c6e6d1"
  ]
}

Properties

Name Type Required Restrictions Description
id string(uuid) true read-only The ID of this entity
contactName string¦null false none Name of the person/doctor's office who has the lab order details. Required if no labOrderFileIds are set.
contactPhone string¦null false none 10 digit phone number of the person/doctor's office who has the lab order details. Required if no labOrderFileIds are set.
labOrderFiles [File] false read-only An array of all files attached
labOrderFileIds [string] false write-only An array of file IDs uploaded using the file endpoint. Required if contactName and contactPhone are not set.

NotFound

{
  "statusCode": 404,
  "message": "Not Found"
}

Properties

Name Type Required Restrictions Description
statusCode number true read-only The http status code
message string true read-only A string describing the type of error

Enumerated Values

Property Value
statusCode 404
message Not Found

OauthToken

{
  "access_token": "string",
  "refresh_token": "string",
  "token_type": "string",
  "expires": 0
}

Properties

Name Type Required Restrictions Description
access_token string true none Access token required for all api calls
refresh_token string true none Refresh token to be used to refresh your expired access_token
token_type string true none Token type. At this point it will always be Bearer
expires number true none Expire timestamp of your access token

Patient

{
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "email": "user@example.com",
  "phoneNumber": "6025554567",
  "firstName": "Jane",
  "lastName": "Doe",
  "dob": "1977-07-08",
  "birthSex": "female",
  "guardian": {
    "name": "Jane Doe",
    "relationship": "Mother"
  },
  "insurance": {
    "front": {
      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
      "name": "lab-order.pdf",
      "purpose": "lab-order",
      "data": "string",
      "size": 13264
    },
    "rear": {
      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
      "name": "lab-order.pdf",
      "purpose": "lab-order",
      "data": "string",
      "size": 13264
    },
    "frontId": "9b45fe45-79ed-40aa-9bc3-f358a7c6e6d1",
    "rearId": "9b45fe45-79ed-40aa-9bc3-f358a7c6e6d1"
  }
}

Properties

Name Type Required Restrictions Description
id string(uuid) true read-only The patient's ID
email string(email) true none Email address
phoneNumber string true none 10 digit phone number
firstName string true none First name
lastName string true none Last name
dob string(date) true none Date of birth
birthSex string true none Birth sex
guardian Guardian false none The patient's guardian, this is required if the patient is under 18 years old
insurance Insurance false none Images of the patient's insurance

Enumerated Values

Property Value
birthSex male
birthSex female
birthSex other

PatientUpdate

{
  "guardian": {
    "name": "Jane Doe",
    "relationship": "Mother"
  },
  "insurance": {
    "front": {
      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
      "name": "lab-order.pdf",
      "purpose": "lab-order",
      "data": "string",
      "size": 13264
    },
    "rear": {
      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
      "name": "lab-order.pdf",
      "purpose": "lab-order",
      "data": "string",
      "size": 13264
    },
    "frontId": "9b45fe45-79ed-40aa-9bc3-f358a7c6e6d1",
    "rearId": "9b45fe45-79ed-40aa-9bc3-f358a7c6e6d1"
  }
}

Properties

Name Type Required Restrictions Description
guardian Guardian false none The patient's guardian, this is required if the patient is under 18 years old
insurance Insurance false none Images of the patient's insurance

PaymentCreateSetup

{
  "patientId": "460a6d87-689c-4661-a526-a52450bbe2d7"
}

Properties

Name Type Required Restrictions Description
patientId string(uuid) true none The patient's ID as retrieved from the /patient endpoint

PaymentSetup

{
  "clientSecret": "seti_1Jv3iKB60neqlRn35yPUsJN6_secret_KaEA3x316GYgEyYZUgdiUo2K1cwoDbw"
}

Properties

Name Type Required Restrictions Description
clientSecret string true read-only The Stripe client secret for this setup intent. It is used on the front end with the Stripe library to collect credit card information from the patient.

ServiceArea

{
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "city": "Phoenix",
  "county": "Maricopa County",
  "state": "AZ",
  "zipCode": "85003",
  "timezone": "America/Phoenix",
  "startDate": "2021-01-01T07:00:00.000Z",
  "endDate": "2022-01-01T07:00:00.000Z",
  "isActive": true
}

Properties

Name Type Required Restrictions Description
id string(uuid) true read-only The ID of the service area
city string¦null true read-only The city for the service area
county string¦null true read-only The county for the service area
state string true read-only The 2 character state code for the service area
zipCode string true read-only The 5 digit zip code for the service area
timezone string true read-only The timezone for the service area
startDate string(date-time) true read-only The earliest appointment date allowed for the service area
endDate string(date-time)¦null true read-only The last appointment date allowed for the service area. If it is null there is no scheduled end date.
isActive boolean true read-only True if the current date is in between the start and end date. Appointments can still be booked for inactive service areas starting for their start date.

Timeslot

{
  "key": "yGDknWzB74gP8zpET+HrI3jQVyq4ss/ENX38C1eJSR3D7zCHGloM0URG8V2y1nltsTgvED2q/ZcyJZzfZcWc021/Hg1TWICUkDXl627QDdytvUGsEcy9dqpxtqNLmkCtBRcQHnbgaSIR9E7gZ/5fj6NfTwnRH1coitxlOUCsrm9x76l80saizu9M3L5UqafNB7MtbkcCtfB4h9nubzUXahEbXPq0wFvbt/2VQl7311Vgro9XC3k/CbeBMtiQXhSMqslRop44NJO7Rp6qHEjsrZOJVfcKd3ASuYFEspBi+J+ddRilOS4p06Ai8nhrIx3pbLXoRm4aSqNaLCx5lbldLeh08ozRBt3oBGZDzwxdsYzu8iBgxMMGbH/AUpuR+7Lh9YE=",
  "start": "2021-07-01T12:00:00.000Z",
  "end": "2021-07-01T13:00:00.000Z",
  "expiresAt": "2021-06-22T12:00:00.000Z",
  "price": "2900",
  "priority": true,
  "available": 3
}

Properties

Name Type Required Restrictions Description
key string¦null true none The key used when booking an appointment. A key is valid for 60 minutes after generation, to book an appointment after that a new key is needed.
start string(date-time) true none The appointment start time
end string(date-time) true none The appointment end time
expiresAt string(date-time)¦null true none The time the booking key expires. Afterwards it cannot be used to book an appointment.
price number true none The price for the appointment in cents
priority boolean true none If an appointment is a priority slot then a lab order must be uploaded in order to book
available number true none The number of appointments available for the timeslot

ValidationError

{
  "property": "email",
  "constraints": {
    "isNotEmpty": "property should not be empty"
  },
  "children": [
    {
      "property": "email",
      "constraints": {
        "isNotEmpty": "property should not be empty"
      },
      "children": []
    }
  ]
}

Properties

Name Type Required Restrictions Description
property string true read-only The property name that the errors are for
constraints object false read-only An object containing all of the errors. The key is the error name and the value is the description.
children [ValidationError] true read-only An array of ValidationErrors for the children of this property