Skip to content
GbàlejòDocs

Visits

Invite visitors

POST/api/v1/visits
Scope: visits:write

Invite one visitor, a group, or a visit that repeats. Each visitor with an email address is sent an invite with a QR pass and a calendar invitation (unless sendEmail is false).

Example request

curl
curl -X POST https://api.gbalejo.com/api/v1/visits \
  -H "Authorization: Bearer $GBALEJO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "siteId": "1c4f6a3e-9d2b-4e7a-8f1c-5a3b7d9e2c61",
  "hostId": "9e7b3f2a-1d5c-4e8b-a4f7-3b6d2c9e1a74",
  "visitorTypeId": "5a2d8e1f-3c7b-4a9d-b6e2-9c4f1a7d3e53",
  "visitors": [
    {
      "name": "Tunde Bakare",
      "email": "tunde.bakare@koralogistics.com",
      "company": "Kora Logistics"
    }
  ],
  "schedule": {
    "date": "2027-01-14",
    "startTime": "10:00",
    "endTime": "12:00"
  },
  "purpose": "Quarterly supplier review"
}'
JavaScript
const response = await fetch('https://api.gbalejo.com/api/v1/visits', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.GBALEJO_API_KEY}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    siteId: '1c4f6a3e-9d2b-4e7a-8f1c-5a3b7d9e2c61',
    hostId: '9e7b3f2a-1d5c-4e8b-a4f7-3b6d2c9e1a74',
    visitorTypeId: '5a2d8e1f-3c7b-4a9d-b6e2-9c4f1a7d3e53',
    visitors: [
      {
        name: 'Tunde Bakare',
        email: 'tunde.bakare@koralogistics.com',
        company: 'Kora Logistics',
      },
    ],
    schedule: {
      date: '2027-01-14',
      startTime: '10:00',
      endTime: '12:00',
    },
    purpose: 'Quarterly supplier review',
  }),
});
// 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

201 Created
JSON
{
  "visits": [
    {
      "id": "8b0e7c1a-4f2d-4b9e-a6c3-2d1f5e9a7b40",
      "status": "INVITED",
      "source": "INVITE",
      "siteId": "1c4f6a3e-9d2b-4e7a-8f1c-5a3b7d9e2c61",
      "entranceId": "2e7d9b4c-6a1f-4c3e-9b8d-7f2a5c1e3d82",
      "visitor": {
        "id": "3d9a1e7f-5b2c-4f6d-8a3e-1c7b9f4d2e95",
        "name": "Tunde Bakare",
        "email": "tunde.bakare@koralogistics.com",
        "phone": "+2348031234567",
        "company": "Kora Logistics"
      },
      "host": {
        "id": "9e7b3f2a-1d5c-4e8b-a4f7-3b6d2c9e1a74",
        "name": "Chiamaka Eze",
        "department": "Finance"
      },
      "visitorType": {
        "id": "5a2d8e1f-3c7b-4a9d-b6e2-9c4f1a7d3e53",
        "name": "Guest",
        "colour": "blue"
      },
      "expectedStart": "2027-01-14T09:00:00.000Z",
      "expectedEnd": "2027-01-14T11:00:00.000Z",
      "purpose": "Quarterly supplier review",
      "notes": null,
      "groupId": null,
      "seriesId": null,
      "sendEmail": true,
      "includeWifi": false,
      "checkedInAt": null,
      "checkedOutAt": null,
      "createdAt": "2026-12-04T14:20:00.000Z",
      "badgeNumber": null
    }
  ],
  "groupId": null,
  "seriesId": null,
  "emailed": 1
}

Request body

application/json

siteIdrequired

string (uuid)

The site they visit: GET /sites lists them.

entranceId

string (uuid) or null

One of the site’s entrances (GET /sites lists them), to tell them where to go.

hostId

string (uuid) or null

The employee they come to see: an active employee in the directory (GET /employees lists them).

visitorTypeIdrequired

string (uuid)

Their visitor type (Guest, Contractor…): GET /visitor-types lists them, with what each asks of a visitor and how many days a visit may last.

visitorsrequired

array of objects, 1–50 items

Who is coming: more than one makes a group visit.

visitors[].namerequired

string, 1–120 characters

Their full name.

visitors[].email

string (email) or null, at most 254 characters

Where their invite and pass are sent.

visitors[].phone

string or null, at most 40 characters

Written locally or with "+"; kept in international (E.164) form for the organisation’s country.

visitors[].company

string or null, at most 160 characters

The company they come from.

schedulerequired

object

When, in the site’s time zone.

schedule.daterequired

string (date)

The day of the visit, or its first day (YYYY-MM-DD), at the site.

schedule.startTimerequired

string (HH:MM)

When it starts, HH:MM (24-hour), in the site’s time zone.

schedule.endTimerequired

string (HH:MM)

When it ends, HH:MM (24-hour), after the start.

schedule.endDate

string (date) or null

For a visit over several days, its last day (YYYY-MM-DD), within the visitor type’s pass length. The same day when left out.

schedule.repeat

object or null

Repeat the visit on these weekdays until a day (a contractor every weekday): one visit a day, for up to 92 days and 100 visits.

schedule.repeat.untilrequired

string (date)

The last day it may repeat on (YYYY-MM-DD).

schedule.repeat.weekdaysrequired

array of integers, 1–7 items, each 1–7

The weekdays it repeats on: 1 Monday … 7 Sunday.

purpose

string or null, at most 200 characters

What the visit is for.

notes

string or null, at most 1000 characters

For reception only; visitors never see them.

groupName

string or null, at most 120 characters

A group’s name ("Board meeting"), shown to reception; used only for more than one visitor.

sendEmail

boolean, default true

Email each visitor who has an address their invite, with a QR pass and a calendar invitation.

includeWifi

boolean, default false

Put the site’s guest Wi-Fi in the invite.

Responses

201 Created

The visits made: one for each visitor and day.

visits

array of objects

Every visit made: one for each visitor on each day.

visits[].id

string

The visit’s id.

visits[].status

string

Where the visit is: INVITED (a later day), EXPECTED (today), PENDING_APPROVAL (waiting for approval at check-in), CHECKED_IN, CHECKED_OUT, AUTO_CHECKED_OUT (at the site’s end of day), CANCELLED, NO_SHOW or DENIED (refused at check-in).

INVITEDEXPECTEDPENDING_APPROVALCHECKED_INCHECKED_OUTDENIEDCANCELLEDNO_SHOWAUTO_CHECKED_OUT
visits[].source

string

How it was made: INVITE (one invite, in the app or here), BULK (a list), RECURRING (a visit that repeats) or WALK_IN (at the kiosk or the desk).

INVITEBULKRECURRINGWALK_IN
visits[].siteId

string

The site visited.

visits[].entranceId

string or null

The entrance the visitor was asked to use, or null.

visits[].visitor

object

The visitor.

visits[].visitor.id

string

The visitor’s id, the same on each of their visits.

visits[].visitor.name

string

Their name.

visits[].visitor.email

string or null

Their email address.

visits[].visitor.phone

string or null

Their phone number, in international (E.164) form.

visits[].visitor.company

string or null

Their company.

visits[].host

object or null

The employee visited, or null.

visits[].host.id

string

The employee’s id.

visits[].host.name

string

Their name.

visits[].host.department

string or null

Their department.

visits[].visitorType

object

The visitor type.

visits[].visitorType.id

string

The visitor type’s id.

visits[].visitorType.name

string

Its name (Guest, Contractor…).

visits[].visitorType.colour

string

Its colour key on badges and in the app (blue, orange, teal…).

visits[].expectedStart

string

When the visit is due to start (ISO 8601, UTC).

visits[].expectedEnd

string

When it is due to end (ISO 8601, UTC).

visits[].purpose

string or null

What the visit is for.

visits[].notes

string or null

Notes for reception.

visits[].groupId

string or null

Shared by the visits of one group invite; null for one visitor.

visits[].seriesId

string or null

Shared by the visits of one repeating visit; null otherwise.

visits[].sendEmail

boolean

Whether the visitor is emailed their invite.

visits[].includeWifi

boolean

Whether the invite carries the site’s guest Wi-Fi.

visits[].checkedInAt

string or null

When they checked in (ISO 8601), or null.

visits[].checkedOutAt

string or null

When they checked out (ISO 8601), or null.

visits[].createdAt

string

When the visit was made (ISO 8601).

visits[].badgeNumber

string or null

The number on the visitor’s badge ("B-7KQ2") once one is printed.

groupId

string or null

The group’s id when more than one visitor was invited, or null.

seriesId

string or null

The series’ id when the visit repeats, or null.

emailed

integer

How many invite emails were queued.

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

A payment is overdue: the organisation can read but not change anything until it is paid.

The plan’s visits a month would be passed (limit: "monthlyVisits").

Gbàlejò has suspended the organisation.

The key does not have visits:write.

There is no such site.

A field is missing or not valid: errors lists each one with its path.

The entrance is not one of the site’s.

The visitor type is archived or does not exist.

The host is not in the directory, or is inactive.

The visit ends before it starts, or repeat.until is before date.

The visit lasts more days than the visitor type’s pass allows.

A repeating visit runs over 92 days or 100 visits.

None of the weekdays falls between the first and last day.

The visit (or every day of a repeating one) has already ended.

A visitor’s phone number is not a valid number.

The visitor type requires an email, phone or company that a visitor lacks.

The same email address appears twice in the invite.

The invite would make over 500 visits (visitors × days).

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