Skip to content
GbàlejòDocs

Visitor types

List visitor types

GET/api/v1/visitor-types
Scope: visits:read or visits:write

The visitor types an invite can name, with what each asks of a visitor, how many days a visit may last, and whether check-in waits for the host’s approval.

Example request

curl
curl https://api.gbalejo.com/api/v1/visitor-types \
  -H "Authorization: Bearer $GBALEJO_API_KEY"
JavaScript
const response = await fetch('https://api.gbalejo.com/api/v1/visitor-types', {
  headers: {
    Authorization: `Bearer ${process.env.GBALEJO_API_KEY}`,
  },
});
// Problems come back as application/problem+json: type, title, status, detail.
if (!response.ok) throw new Error((await response.json()).detail);
const result = await response.json();

Example response

200 OK
JSON
{
  "visitorTypes": [
    {
      "id": "5a2d8e1f-3c7b-4a9d-b6e2-9c4f1a7d3e53",
      "name": "Guest",
      "colour": "blue",
      "visitorDetails": {
        "email": "OPTIONAL",
        "phone": "OPTIONAL",
        "company": "OPTIONAL"
      },
      "passValidityDays": 1,
      "multiDay": false,
      "requiresApproval": false
    }
  ]
}

Responses

200 OK

Every visitor type not archived.

visitorTypes

array of objects

Every visitor type an invite can name (archived ones are left out), in the order the app lists them.

visitorTypes[].id

string

The visitor type’s id: what an invite names as visitorTypeId.

visitorTypes[].name

string

Its name (Guest, Contractor…).

visitorTypes[].colour

string

Its colour key on badges and in the app: blue, orange, teal, slate, brown, violet or navy.

blueorangetealslatebrownvioletnavy
visitorTypes[].visitorDetails

object

What an invite gives for each visitor of this type: REQUIRED (missing, the invite is refused with 422 visitor-details-missing), OPTIONAL, or NOT_ASKED. A name is always required.

visitorTypes[].visitorDetails.email

string

A visitor’s email. REQUIRED: an invite without one for every visitor is refused. NOT_ASKED: one sent is not kept, so no invite is emailed.

REQUIREDOPTIONALNOT_ASKED
visitorTypes[].visitorDetails.phone

string

A visitor’s phone. A phone sent must be a valid number for the organisation’s country, whatever the rule (422 phone-invalid). REQUIRED: an invite without one is refused. NOT_ASKED: a valid one is not kept.

REQUIREDOPTIONALNOT_ASKED
visitorTypes[].visitorDetails.company

string

A visitor’s company. REQUIRED: an invite without one is refused. NOT_ASKED: one sent is not kept.

REQUIREDOPTIONALNOT_ASKED
visitorTypes[].passValidityDays

integer

How many calendar days one visit may span, its first and last day counted: a schedule.endDate further from schedule.date is refused with 422 pass-too-long. 1 is the day of the visit only.

visitorTypes[].multiDay

boolean

Whether a visit may last several days (passValidityDays over 1), with a schedule.endDate after schedule.date. A visit that repeats lasts one day each time, whatever the type.

visitorTypes[].requiresApproval

boolean

Whether a visitor who checks in at a kiosk waits for the host’s approval before being let in. It does not change what an invite accepts.

Errors

No key was sent, or it is mistyped or unknown.

The key has been revoked.

The key has passed its expiry date.

The organisation’s plan does not include the API (feature: "api").

Gbàlejò has suspended the organisation.

The key has none of visits:read or visits:write.

The key has made its requests for this minute (Retry-After says when).