invantive documentationpart of invantive cloud
Invantive Support ForumsLog In / Sign Up

Tenant API

The tenant API is the API for programs of a tenant, at https://waypoint.invantive.eu/api/v1. A program signs in with a token that an administrator creates in the console under "Settings", tab "Tokens and OData", sent as Authorization: Bearer wpt_tok_.... The scopes of the token decide what it may do; see Applications and Installation. The OpenAPI description is at https://waypoint.invantive.eu/api/v1/openapi.json.

Check a Token

A program first checks its token:

GET /api/v1/me HTTP/1.1
Host: waypoint.invantive.eu
Authorization: Bearer wpt_tok_8f3e1c0d9a7b4e21b6c5d4f3a2e1b0c9
Accept: application/json

The answer names the token, the tenant with its code, the scopes, whether it may publish and the expiry, which is null for a token that never expires. A token that is unknown, expired or revoked answers 401 with itgenwpt200. A token of a suspended tenant answers 403 with itgenwpt225.

Resources

The tenant API offers the following resources:

  • /end-users and /end-users/{id}: end users with their attributes; GET, POST, PUT, PATCH and DELETE. A DELETE removes the end user with all their data and needs end_users.delete.
  • /end-users/batch: up to 1 000 end users in one request.
  • /accounts, /accounts/{id} and /accounts/batch: companies, in the same way.
  • /applications and /applications/{code}: applications with their origins; /applications/{code}/secrets rotates the signing secret.
  • /themes, /segments and /experiences, each with /{code}: content as drafts.
  • /experiences/{code}/publish: publish the draft; needs content.publish and a token that may publish.
  • /experiences/{code}/archive: archive an experience that end users are in the middle of.
  • /experiences/{code}/steps/{step}: change the anchor, page or placement of a step of the draft, or delete a step that was never published; /experiences/{code}/steps/{step}/retire retires a published step.
  • /broken-anchors: the anchors that the snippet did not find.
  • /steps, /user-states, /account-states, /step-states, /searches and /ideas: lists for reading.
  • /events: the stored events for reading, and POST of up to 1 000 events from the server of an application with events.write, each with application, user_id, code, properties and at. An at more than 30 minutes in the past or more than a minute in the future is stored as the moment of receipt, so older history cannot be loaded this way.
  • /event-hours and /audit-events: the hourly totals and the audit trail, for reading.
  • /api-tokens and /api-tokens/{name}: tokens; the answer of a new token holds the token once. A new token without expires never expires; an expiry in the past answers 400 with itgenwpt205.
  • /analytics/experiences/{code}: showings and completion per step, or per origin with group=origin.
  • /transfers/...: export and import, see Export and Import.

Every list also answers /$count with the number of rows as plain text.

Write End Users in a Batch

A batch is applied row by row; the answer says per row whether it was accepted, so one wrong row does not refuse the others. A row is created or updated by its id. An attribute that is sent replaces the stored one, an attribute set to null is removed, and one that is not sent stays.

POST /api/v1/end-users/batch HTTP/1.1
Host: waypoint.invantive.eu
Authorization: Bearer wpt_tok_8f3e1c0d9a7b4e21b6c5d4f3a2e1b0c9
Content-Type: application/json

{ "rows":
  [ { "id": "u-7f3c0a"
    , "name": "John Doe"
    , "email": "john.doe@acme.eu"
    , "language": "en"
    , "account": "pty-7c1e"
    , "signed_up": "2026-11-06T09:00:00Z"
    , "attributes":
      { "segment_codes": "s.trial,p.currency-tools,r.admin"
      , "plan": "trial"
      }
    }
  ]
}

The answer holds accepted, refused and per row the result created, updated or refused with the message code. A batch of more than 1 000 rows is refused as a whole with itgenwpt210.

Create an Experience

An experience is created as a draft with its triggers, steps and texts, then published:

POST /api/v1/experiences HTTP/1.1
Host: waypoint.invantive.eu
Authorization: Bearer wpt_tok_5b7d9f1a3c5e4b70a9c1e3d5f7b9a1c3
Content-Type: application/json

{ "code": "schedule-daily"
, "name": "Schedule a daily import"
, "kind": "tour"
, "application": "currency-tools"
, "segment": "trial-users"
, "order_mode": "sequential"
, "progress_scope": "account"
, "replayable": true
, "triggers":
  [ { "kind": "page", "pages": [ "/schedules" ], "repeat_scope": "account", "presentation": "start", "throttled": true }
  , { "kind": "click", "anchor": { "data_waypoint": "new-schedule" }, "repeat_scope": "end_user", "presentation": "start", "throttled": false }
  ]
, "frequency": "once"
, "goal": { "event": "schedule.created", "within_days": 7 }
, "steps":
  [ { "code": "choose-companies"
    , "anchor": { "automation_id": "schedule-companies" }
    , "page": "/schedules"
    , "wait_anchor_seconds": 5
    , "texts": { "en": { "title": "Choose the companies", "body": "Pick the Exact Online companies the schedule runs for." } }
    }
  , { "code": "save-schedule"
    , "anchor": { "automation_id": "schedule-save" }
    , "page": "/schedules"
    , "advance_on": "event"
    , "completion_event": "schedule.created"
    , "texts": { "en": { "title": "Save the schedule", "body": "The tour ends when the schedule exists." } }
    }
  ]
}

The kinds are tour, tooltip, hotspot, checklist, modal, banner, slide_out and resource_centre. The kinds of trigger are page, element, event, click, delay and manual. The frequency is once, once_per_session, every_n_days with frequency_days, or every_time. A step can also carry skip_when, done_when and event_filter, with a rule in the grammar of segments. The texts of a step are title, body, button_next, button_back and button_other. In a modal, banner or slide-out, button_back labels the button that closes it, and button_other labels the main button when the step opens another experience or follows a link. The draft is published with POST /api/v1/experiences/schedule-daily/publish, naming the reviewed draft version as draft_version in the body. Without draft_version the current draft is published.

Filtering, Sorting and Counting

Every list takes the system query options of OData version 4, with the properties in snake case:

  • $filter with eq, ne, gt, ge, lt, le, and, or, not, in and eq null; the functions contains, startswith, endswith, tolower, toupper, trim, length, year, month, day and date; one level of navigation, such as account/name.
  • $select and $orderby on every property.
  • $top as the size of a page and $skip.
  • $count=true, which adds count to the answer.

For example, GET /api/v1/end-users?$filter=contains(email,'@acme.eu')&$select=id,name,last_seen&$orderby=last_seen desc&$count=true. Shortcuts such as ?segment=trial-users become a filter and can be combined with one. A list of end users answers CSV with Accept: text/csv. Grouping is offered on the OData Service only.

Refusals

An action that is not possible answers with a status, a message code and what can be done instead:

  • A published step is retired, not deleted (409, itgenwpt208).
  • An experience that end users are in the middle of is archived, not deleted (409, itgenwpt209).
  • A token without content.publish cannot publish (403, itgenwpt202); a token of an editor who may not publish is refused with itgenwpt212. A token without the scope of another operation is refused with itgenwpt202 too.
  • A raw event, an hourly total and a row of the audit trail cannot be changed or deleted (405, itgenwpt207).
  • A segment or theme that is in use cannot be deleted (409, itgenwpt232 and itgenwpt233).

Every write, refused write and failed sign-in is kept in the audit trail. Reads are not.