Usertour Environments API
The Environments API from Usertour, for environments.
The Environments API from Usertour, for environments.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
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.curl "https://apis.io/api/v1/apis/usertour-io:usertour-io-environments-api"
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.
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: 3.2.0
info:
title: Usertour API v2 Environments 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: Environments
paths:
/v2/projects/{projectId}/environments:
get:
operationId: ApiEnvironmentsController_list
summary: List environments
parameters:
- name: projectId
required: true
in: path
description: Project ID
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: 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: 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 / -createdAt.
schema:
anyOf:
- type: string
enum:
- createdAt
- -createdAt
- type: array
items:
type: string
enum:
- createdAt
- -createdAt
responses:
'200':
description: List of environments
content:
application/json:
schema:
$ref: '#/components/schemas/ListEnvironmentsResponseDto'
'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:
- Environments
security:
- bearer: []
post:
operationId: ApiEnvironmentsController_create
summary: Create an environment
description: Create an environment in the project. The first one is made primary.
parameters:
- name: projectId
required: true
in: path
description: Project ID
schema:
type: string
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CreateEnvironmentBodyDto'
responses:
'201':
description: Environment created
content:
application/json:
schema:
$ref: '#/components/schemas/EnvironmentDto'
'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:
- Environments
security:
- bearer: []
/v2/projects/{projectId}/environments/{id}:
get:
operationId: ApiEnvironmentsController_get
summary: Get an environment
parameters:
- name: id
required: true
in: path
description: Environment ID
schema:
type: string
- name: projectId
required: true
in: path
description: Project ID
schema:
type: string
responses:
'200':
description: Environment found
content:
application/json:
schema:
$ref: '#/components/schemas/EnvironmentDto'
'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: Environment 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:
- Environments
security:
- bearer: []
patch:
operationId: ApiEnvironmentsController_update
summary: Update an environment
description: Rename an environment.
parameters:
- name: id
required: true
in: path
description: Environment ID
schema:
type: string
- name: projectId
required: true
in: path
description: Project ID
schema:
type: string
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/UpdateEnvironmentBodyDto'
responses:
'200':
description: Environment updated
content:
application/json:
schema:
$ref: '#/components/schemas/EnvironmentDto'
'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: Environment 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:
- Environments
security:
- bearer: []
delete:
operationId: ApiEnvironmentsController_remove
summary: Delete an environment
description: Delete an environment. The primary / last environment cannot be deleted.
parameters:
- name: id
required: true
in: path
description: Environment ID
schema:
type: string
- name: projectId
required: true
in: path
description: Project ID
schema:
type: string
responses:
'204':
description: Environment 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: Environment not found
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponseDto'
'409':
description: State conflict — E0023 cannot delete the primary environment (set another primary first), E0022 cannot delete the last environment.
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:
- Environments
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
ListEnvironmentsResponseDto:
type: object
properties:
results:
type: array
items:
type: object
properties:
id:
type: string
object:
type: string
enum:
- environment
name:
type:
- string
- 'null'
isPrimary:
type: boolean
token:
type:
- string
- 'null'
description: 'The environment''s SDK token — pass it to usertour.init() to load this environment''s published content. null when `inTokenScope` is false: an out-of-scope environment is listed for discovery, but its key is withheld (the SDK token accepts identify/track ingestion, so handing it out would let a scoped credential act on an environment it was denied).'
inTokenScope:
type: boolean
description: Whether the CURRENT credential may act on this environment. false = the environment is listed for discovery, but reads / writes / publishing targeted at it are rejected (E1029) — plan against this instead of discovering scope limits from errors.
createdAt:
type: string
format: date-time
updatedAt:
type: string
format: date-time
required:
- id
- object
- name
- isPrimary
- token
- inTokenScope
- createdAt
- updatedAt
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
CreateEnvironmentBodyDto:
type: object
properties:
name:
type: string
minLength: 1
description: Environment name.
required:
- name
additionalProperties: false
EnvironmentDto:
type: object
properties:
id:
type: string
object:
type: string
enum:
- environment
name:
type:
- string
- 'null'
isPrimary:
type: boolean
token:
type:
- string
- 'null'
description: 'The environment''s SDK token — pass it to usertour.init() to load this environment''s published content. null when `inTokenScope` is false: an out-of-scope environment is listed for discovery, but its key is withheld (the SDK token accepts identify/track ingestion, so handing it out would let a scoped credential act on an environment it was denied).'
inTokenScope:
type: boolean
description: Whether the CURRENT credential may act on this environment. false = the environment is listed for discovery, but reads / writes / publishing targeted at it are rejected (E1029) — plan against this instead of discovering scope limits from errors.
createdAt:
type: string
format: date-time
updatedAt:
type: string
format: date-time
required:
- id
- object
- name
- isPrimary
- token
- inTokenScope
- createdAt
- updatedAt
UpdateEnvironmentBodyDto:
type: object
properties:
name:
type: string
minLength: 1
description: Environment name.
required:
- name
additionalProperties: false
securitySchemes:
bearer:
scheme: bearer
bearerFormat: utp_... personal API token (opaque)
type: http