HTTP API

Tour

GET/api/v1/tours
GET
/api/v1/tours

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Query Parameters

q?string

Full-text query applied to tour name and title

status?string

Filter by status

include_versions?boolean

Include draft and deprecated tours (admin only)

page?integer

1-indexed page number

Formatint64
Range0 <= value
page_size?integer

Page size

Formatint64
Range0 <= value
sort_by?string

Sort field

sort_order?string

Sort order (asc or desc)

Value in

  • "asc"
  • "desc"
filter?array<string>

Additional filter expressions (field:operator:value)

Response Body

application/json

curl -X GET "https://example.com/api/v1/tours"
{  "pagination": {    "has_more": true,    "page": 0,    "page_size": 0,    "total": 0  },  "tours": [    {      "audience": {        "roles": [          "string"        ],        "segments": [          "string"        ]      },      "branching": [        {          "next_step": "string",          "when": "string"        }      ],      "created_at": "2019-08-24T14:15:22Z",      "created_by": "string",      "name": "string",      "reset_policy": {        "on_version_change": "no_op",        "preserve_flags": [          "string"        ]      },      "status": "draft",      "steps": [        {          "completion_flag": "string",          "id": "string",          "index": 0,          "mandatory": true,          "prerequisites": [            "string"          ],          "reward_hook": null,          "semantic_target": {            "description": "string",            "kind": "ui_element",            "name": "string",            "test_hint": "string"          },          "title": "string"        }      ],      "title": "string",      "tour_id": "string",      "updated_at": "2019-08-24T14:15:22Z",      "variant": null,      "version": 0    }  ]}
POST/api/v1/tours
POST
/api/v1/tours

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://example.com/api/v1/tours" \  -H "Content-Type: application/json" \  -d '{    "name": "string",    "steps": [      {        "completion_flag": "string",        "id": "string",        "index": 0,        "semantic_target": {          "kind": "ui_element",          "name": "string"        },        "title": "string"      }    ],    "title": "string"  }'
{  "created_at": "2019-08-24T14:15:22Z",  "name": "string",  "tour_id": "string",  "version": 0}
GET/api/v1/tours/{tour_id}
GET
/api/v1/tours/{tour_id}

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

tour_id*string

Response Body

application/json

curl -X GET "https://example.com/api/v1/tours/string"
{  "audience": {    "roles": [      "string"    ],    "segments": [      "string"    ]  },  "branching": [    {      "next_step": "string",      "when": "string"    }  ],  "created_at": "2019-08-24T14:15:22Z",  "created_by": "string",  "name": "string",  "reset_policy": {    "on_version_change": "no_op",    "preserve_flags": [      "string"    ]  },  "status": "draft",  "steps": [    {      "completion_flag": "string",      "id": "string",      "index": 0,      "mandatory": true,      "prerequisites": [        "string"      ],      "reward_hook": null,      "semantic_target": {        "description": "string",        "kind": "ui_element",        "name": "string",        "test_hint": "string"      },      "title": "string"    }  ],  "title": "string",  "tour_id": "string",  "updated_at": "2019-08-24T14:15:22Z",  "variant": null,  "version": 0}
DELETE/api/v1/tours/{tour_id}
DELETE
/api/v1/tours/{tour_id}

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

tour_id*string

Response Body

application/json

curl -X DELETE "https://example.com/api/v1/tours/string"
{  "message": "string",  "tour_id": "string"}
PUT/api/v1/tours/{tour_id}
PUT
/api/v1/tours/{tour_id}

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

tour_id*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X PUT "https://example.com/api/v1/tours/string" \  -H "Content-Type: application/json" \  -d '{}'
{  "status": "draft",  "tour_id": "string",  "updated_at": "2019-08-24T14:15:22Z",  "version": 0}
GET/api/v1/tours/{tour_id}/analytics
GET
/api/v1/tours/{tour_id}/analytics

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

tour_id*string

Query Parameters

version?integer

Definition version to scope analytics to (defaults to active version)

Formatint32
Range0 <= value
window?string

Analytics window (defaults to all-time rollup)

Response Body

application/json

curl -X GET "https://example.com/api/v1/tours/string/analytics"
{  "branches": [    {      "next_step": "string",      "taken": 0    }  ],  "completed": 0,  "started": 0,  "steps": [    {      "completed": 0,      "drop_off": 0,      "seen": 0,      "step_id": "string"    }  ],  "tour_id": "string",  "variants": {    "property1": {      "completed": 0,      "completion_rate": 0.1,      "started": 0    },    "property2": {      "completed": 0,      "completion_rate": 0.1,      "started": 0    }  },  "version": 0,  "window": "string"}
POST/api/v1/tours/{tour_id}/events
POST
/api/v1/tours/{tour_id}/events

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

tour_id*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://example.com/api/v1/tours/string/events" \  -H "Content-Type: application/json" \  -d '{    "event_type": "started"  }'
{  "completed_steps": [    "string"  ],  "current_step_id": "string",  "definition_version": 0,  "mandatory_complete": true,  "tour_id": "string"}
POST/api/v1/tours/{tour_id}/flags
POST
/api/v1/tours/{tour_id}/flags

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

tour_id*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://example.com/api/v1/tours/string/flags" \  -H "Content-Type: application/json" \  -d '{}'
{  "seen_flags": [    "string"  ],  "tour_id": "string"}
POST/api/v1/tours/{tour_id}/reset
POST
/api/v1/tours/{tour_id}/reset

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

tour_id*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://example.com/api/v1/tours/string/reset" \  -H "Content-Type: application/json" \  -d '{}'
{  "message": "string",  "reset_users": 0,  "scope": "user",  "tour_id": "string"}
GET/api/v1/tours/{tour_id}/status
GET
/api/v1/tours/{tour_id}/status

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

tour_id*string

Query Parameters

user?string

User whose progress is requested (admin only; defaults to the caller)

Response Body

application/json

curl -X GET "https://example.com/api/v1/tours/string/status"
{  "available_steps": [    "string"  ],  "completed_steps": [    "string"  ],  "current_step_id": "string",  "definition_version": 0,  "last_event_at": "2019-08-24T14:15:22Z",  "mandatory_complete": true,  "seen_flags": [    "string"  ],  "started_at": "2019-08-24T14:15:22Z",  "state": "not_started",  "tour_id": "string",  "user_id": "string",  "variant": "string"}

On this page