Usertour Event definitions API

The Event definitions API from Usertour, for event definitions.

GitHub OpenAPI

Operations 6

GET /v2/projects/{projectId}/event-definitions List event definitions #
POST /v2/projects/{projectId}/event-definitions Create an event definition #
GET /v2/projects/{projectId}/event-definitions/{id} Get an event definition #
PATCH /v2/projects/{projectId}/event-definitions/{id} Update an event definition #
DELETE /v2/projects/{projectId}/event-definitions/{id} Delete an event definition #
POST /v2/projects/{projectId}/event-definitions/{id}/restore Restore a deleted event definition #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/usertour-io:usertour-io-event-definitions-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

usertour-io-event-definitions-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Usertour API v2 Event definitions API
  description: 'Project-scoped v2 API. Authenticate with a personal API token — an opaque `utp_...` string (NOT a JWT: do not try to decode it), created in the Usertour app under Settings → API, sent as `Authorization: Bearer utp_...`.'
  version: '2.0'
  contact: {}
servers:
- url: https://api.usertour.io
tags:
- name: Event definitions
paths:
  /v2/projects/{projectId}/event-definitions:
    get:
      operationId: ApiEventDefinitionsController_list
      summary: List event definitions
      parameters:
      - name: projectId
        required: true
        in: path
        description: Project ID
        schema:
          type: string
      - name: cursor
        required: false
        in: query
        description: 'Opaque page cursor — the `cursor` query value found inside a prior response''s `next`/`previous` URL. Normally you never build this yourself: just GET those URLs as-is.'
        schema:
          type: string
      - name: limit
        required: false
        in: query
        description: Max items per page (1-100, default 20).
        schema:
          minimum: 1
          maximum: 100
          default: 20
          type: integer
      - name: name
        required: false
        in: query
        description: Filter by name (case-insensitive substring match).
        schema:
          type: string
      - name: orderBy
        required: false
        in: query
        description: 'Order by createdAt / codeName / displayName (prefix - for descending). Text sorting is case-sensitive (byte order): uppercase sorts before lowercase.'
        schema:
          anyOf:
          - type: string
            enum:
            - createdAt
            - -createdAt
            - codeName
            - -codeName
            - displayName
            - -displayName
          - type: array
            items:
              type: string
              enum:
              - createdAt
              - -createdAt
              - codeName
              - -codeName
              - displayName
              - -displayName
      - name: deleted
        required: false
        in: query
        description: List soft-deleted event definitions instead of live ones — the recovery pool for restore.
        schema:
          enum:
          - 'true'
          - 'false'
          type: string
      responses:
        '200':
          description: List of event definitions
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListEventDefinitionsResponseDto'
        '400':
          description: Invalid request — E1017 validation (may carry `issues`; an invalid orderBy/limit is also E1017), E1015 invalid scope, E0003 invalid against current domain state.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseDto'
        '401':
          description: Missing or expired API key — E1010, E1020.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseDto'
        '403':
          description: Refused — E1000 invalid key, E1011 project not in token scope, E1012 insufficient scope, E1029 environment not in token scope, E1032 environment creation needs a token without env-targeted capabilities (its allowlist cannot cover a not-yet-existing environment), E0043 the project's plan does not include the feature (e.g. webhooks require a paid plan on cloud).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseDto'
        '429':
          description: Rate limit exceeded — E1013. The limit follows the project's plan (100/500/1000/3000 requests per minute); unknown credentials share a per-IP bucket. Every response also carries X-RateLimit-Limit / -Remaining / -Reset for pacing; a 429 adds the standard Retry-After header (seconds to back off).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseDto'
      tags:
      - Event definitions
      security:
      - bearer: []
    post:
      operationId: ApiEventDefinitionsController_create
      summary: Create an event definition
      parameters:
      - name: projectId
        required: true
        in: path
        description: Project ID
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateEventDefinitionBodyDto'
      responses:
        '201':
          description: Event definition created — or, when a deleted event holds this codeName, that one restored
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EventDefinitionDto'
        '400':
          description: Invalid request — E1017 validation (may carry `issues`; an invalid orderBy/limit is also E1017), E1015 invalid scope, E0003 invalid against current domain state.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseDto'
        '401':
          description: Missing or expired API key — E1010, E1020.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseDto'
        '403':
          description: Refused — E1000 invalid key, E1011 project not in token scope, E1012 insufficient scope, E1029 environment not in token scope, E1032 environment creation needs a token without env-targeted capabilities (its allowlist cannot cover a not-yet-existing environment), E0043 the project's plan does not include the feature (e.g. webhooks require a paid plan on cloud).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseDto'
        '409':
          description: An event with this codeName already exists
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseDto'
        '429':
          description: Rate limit exceeded — E1013. The limit follows the project's plan (100/500/1000/3000 requests per minute); unknown credentials share a per-IP bucket. Every response also carries X-RateLimit-Limit / -Remaining / -Reset for pacing; a 429 adds the standard Retry-After header (seconds to back off).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseDto'
      tags:
      - Event definitions
      security:
      - bearer: []
  /v2/projects/{projectId}/event-definitions/{id}:
    get:
      operationId: ApiEventDefinitionsController_get
      summary: Get an event definition
      parameters:
      - name: projectId
        required: true
        in: path
        description: Project ID
        schema:
          type: string
      - name: id
        required: true
        in: path
        description: Event definition ID
        schema:
          type: string
      responses:
        '200':
          description: Event definition found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EventDefinitionDto'
        '400':
          description: Invalid request — E1017 validation (may carry `issues`; an invalid orderBy/limit is also E1017), E1015 invalid scope, E0003 invalid against current domain state.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseDto'
        '401':
          description: Missing or expired API key — E1010, E1020.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseDto'
        '403':
          description: Refused — E1000 invalid key, E1011 project not in token scope, E1012 insufficient scope, E1029 environment not in token scope, E1032 environment creation needs a token without env-targeted capabilities (its allowlist cannot cover a not-yet-existing environment), E0043 the project's plan does not include the feature (e.g. webhooks require a paid plan on cloud).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseDto'
        '404':
          description: Event definition not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseDto'
        '429':
          description: Rate limit exceeded — E1013. The limit follows the project's plan (100/500/1000/3000 requests per minute); unknown credentials share a per-IP bucket. Every response also carries X-RateLimit-Limit / -Remaining / -Reset for pacing; a 429 adds the standard Retry-After header (seconds to back off).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseDto'
      tags:
      - Event definitions
      security:
      - bearer: []
    patch:
      operationId: ApiEventDefinitionsController_update
      summary: Update an event definition
      parameters:
      - name: projectId
        required: true
        in: path
        description: Project ID
        schema:
          type: string
      - name: id
        required: true
        in: path
        description: Event definition ID
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateEventDefinitionBodyDto'
      responses:
        '200':
          description: Event definition updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EventDefinitionDto'
        '400':
          description: Invalid request — E1017 validation (may carry `issues`; an invalid orderBy/limit is also E1017), E1015 invalid scope, E0003 invalid against current domain state.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseDto'
        '401':
          description: Missing or expired API key — E1010, E1020.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseDto'
        '403':
          description: Refused — E1000 invalid key, E1011 project not in token scope, E1012 insufficient scope, E1029 environment not in token scope, E1032 environment creation needs a token without env-targeted capabilities (its allowlist cannot cover a not-yet-existing environment), E0043 the project's plan does not include the feature (e.g. webhooks require a paid plan on cloud).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseDto'
        '404':
          description: Event definition not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseDto'
        '409':
          description: The definition is predefined (E1036) — it cannot be modified or deleted; create your own definition instead.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseDto'
        '429':
          description: Rate limit exceeded — E1013. The limit follows the project's plan (100/500/1000/3000 requests per minute); unknown credentials share a per-IP bucket. Every response also carries X-RateLimit-Limit / -Remaining / -Reset for pacing; a 429 adds the standard Retry-After header (seconds to back off).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseDto'
      tags:
      - Event definitions
      security:
      - bearer: []
    delete:
      operationId: ApiEventDefinitionsController_remove
      summary: Delete an event definition
      description: 'Soft delete: the definition leaves lists and pickers, recorded events keep resolving it, and it can be restored. Refused (E1030) while live or draft content uses it.'
      parameters:
      - name: projectId
        required: true
        in: path
        description: Project ID
        schema:
          type: string
      - name: id
        required: true
        in: path
        description: Event definition ID
        schema:
          type: string
      responses:
        '204':
          description: Event definition deleted
        '400':
          description: Invalid request — E1017 validation (may carry `issues`; an invalid orderBy/limit is also E1017), E1015 invalid scope, E0003 invalid against current domain state.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseDto'
        '401':
          description: Missing or expired API key — E1010, E1020.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseDto'
        '403':
          description: Refused — E1000 invalid key, E1011 project not in token scope, E1012 insufficient scope, E1029 environment not in token scope, E1032 environment creation needs a token without env-targeted capabilities (its allowlist cannot cover a not-yet-existing environment), E0043 the project's plan does not include the feature (e.g. webhooks require a paid plan on cloud).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseDto'
        '404':
          description: Event definition not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseDto'
        '409':
          description: State conflict — E1030 the event is used by live or draft content (the message names it; remove it from that content first), E1036 it is predefined and cannot be deleted.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseDto'
        '429':
          description: Rate limit exceeded — E1013. The limit follows the project's plan (100/500/1000/3000 requests per minute); unknown credentials share a per-IP bucket. Every response also carries X-RateLimit-Limit / -Remaining / -Reset for pacing; a 429 adds the standard Retry-After header (seconds to back off).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseDto'
      tags:
      - Event definitions
      security:
      - bearer: []
  /v2/projects/{projectId}/event-definitions/{id}/restore:
    post:
      operationId: ApiEventDefinitionsController_restore
      summary: Restore a deleted event definition
      description: Bring a soft-deleted event definition back as it was (find it via GET /event-definitions?deleted=true). Creating or tracking an event with the same codeName restores it too. Idempotent on a definition that is not deleted.
      parameters:
      - name: projectId
        required: true
        in: path
        description: Project ID
        schema:
          type: string
      - name: id
        required: true
        in: path
        description: Event definition ID
        schema:
          type: string
      responses:
        '200':
          description: Restored event definition
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EventDefinitionDto'
        '400':
          description: Invalid request — E1017 validation (may carry `issues`; an invalid orderBy/limit is also E1017), E1015 invalid scope, E0003 invalid against current domain state.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseDto'
        '401':
          description: Missing or expired API key — E1010, E1020.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseDto'
        '403':
          description: Refused — E1000 invalid key, E1011 project not in token scope, E1012 insufficient scope, E1029 environment not in token scope, E1032 environment creation needs a token without env-targeted capabilities (its allowlist cannot cover a not-yet-existing environment), E0043 the project's plan does not include the feature (e.g. webhooks require a paid plan on cloud).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseDto'
        '404':
          description: Event definition not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseDto'
        '429':
          description: Rate limit exceeded — E1013. The limit follows the project's plan (100/500/1000/3000 requests per minute); unknown credentials share a per-IP bucket. Every response also carries X-RateLimit-Limit / -Remaining / -Reset for pacing; a 429 adds the standard Retry-After header (seconds to back off).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseDto'
      tags:
      - Event definitions
      security:
      - bearer: []
components:
  schemas:
    ErrorResponseDto:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              description: Stable machine-readable code (e.g. E1017). Match on this, never on `message`.
            message:
              type: string
              description: Human-readable summary. Wording may change between releases.
            issues:
              description: Validation errors (E1017) may carry one entry per problem so every field can be fixed in a single round-trip. Absent on other errors.
              type: array
              items:
                type: object
                properties:
                  rule:
                    type: string
                    description: 'Which validation layer rejected it: schema | reactive_condition | action_not_allowed | step_shape | reference_target | auto_start | media_url | destination_url. New values may be added; treat an unknown value as a generic validation failure.'
                  message:
                    type: string
                  path:
                    description: Path into the request body (e.g. `steps[0].triggers[0].when[1]`).
                    type: string
                required:
                - rule
                - message
            doc_url:
              type: string
              description: Base URL of the API documentation.
      required:
      - error
    ListEventDefinitionsResponseDto:
      type: object
      properties:
        results:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
              object:
                type: string
                enum:
                - eventDefinition
              createdAt:
                type: string
                format: date-time
              description:
                type: string
              displayName:
                type: string
              codeName:
                type: string
              predefined:
                type: boolean
                description: 'true = a built-in Usertour lifecycle event (flow/launcher/checklist/survey/… started/ended/etc.) — NOT trackable: a tracker can only fire a CUSTOM event. false = a custom event you created.'
              attributes:
                type: array
                items:
                  type: string
                description: codeNames of the event-scoped attributes attached to this event.
            required:
            - id
            - object
            - createdAt
            - description
            - displayName
            - codeName
            - predefined
            - attributes
        next:
          type:
          - string
          - 'null'
          description: Full URL of the next page — request it as-is (it already carries `cursor=` and your query parameters). null = no further pages.
        previous:
          type:
          - string
          - 'null'
          description: Full URL of the previous page — request it as-is. null = already at the first page.
      required:
      - results
      - next
      - previous
    EventDefinitionDto:
      type: object
      properties:
        id:
          type: string
        object:
          type: string
          enum:
          - eventDefinition
        createdAt:
          type: string
          format: date-time
        description:
          type: string
        displayName:
          type: string
        codeName:
          type: string
        predefined:
          type: boolean
          description: 'true = a built-in Usertour lifecycle event (flow/launcher/checklist/survey/… started/ended/etc.) — NOT trackable: a tracker can only fire a CUSTOM event. false = a custom event you created.'
        attributes:
          type: array
          items:
            type: string
          description: codeNames of the event-scoped attributes attached to this event.
      required:
      - id
      - object
      - createdAt
      - description
      - displayName
      - codeName
      - predefined
      - attributes
    UpdateEventDefinitionBodyDto:
      type: object
      properties:
        displayName:
          description: Human-readable name.
          type: string
          minLength: 1
        description:
          description: Optional description.
          type: string
        attributes:
          description: Replace the attached attributes with these codeNames. Omit to leave unchanged.
          type: array
          items:
            type: string
      additionalProperties: false
    CreateEventDefinitionBodyDto:
      type: object
      properties:
        codeName:
          type: string
          minLength: 2
          maxLength: 100
          pattern: ^[a-zA-Z][a-zA-Z0-9_]*$
          description: Stable identifier, unique per project. Immutable. Must start with a letter, then letters/digits/underscores, 2–100 chars.
        displayName:
          type: string
          minLength: 1
          description: Human-readable name.
        description:
          description: Optional description.
          type: string
        attributes:
          type: array
          items:
            type: string
          description: codeNames of EXISTING event-scoped attributes to attach to this event — the built-in / predefined ones, custom event properties auto-registered at ingestion when your app tracked an event with a properties payload, or ones pre-defined via the attribute definition first with scope `eventDefinition`. Unknown codeNames are rejected.
      required:
      - codeName
      - displayName
      additionalProperties: false
  securitySchemes:
    bearer:
      scheme: bearer
      bearerFormat: utp_... personal API token (opaque)
      type: http