Optimizely Realtime Segments API
The RealtimeSegments API from Optimizely — 3 operation(s) for realtimesegments.
The RealtimeSegments API from Optimizely — 3 operation(s) for realtimesegments.
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/optimizely-realtimesegments-api"
curl "https://apis.io/api/v1/apis?limit=25"
Discovery needs no key. Ratings and market analysis are Pro.
openapi: 3.2.0
info:
title: Realtime Segments API
version: '1.0'
contact:
name: Dmytro Duk
email: dmytro.duk@optimizely.com
license:
name: proprietary
servers:
- url: //api.us1.odp.optimizely.com/v3
tags:
- name: RealtimeSegments
paths:
/segments:
get:
summary: List segments
description: Lists all the real-time segments for an account.
operationId: RealtimeSegments_ListSegments
responses:
'200':
description: A successful response.
content:
application/json:
schema:
$ref: '#/components/schemas/ListSegmentsResponse'
tags:
- RealtimeSegments
security:
- ApiKeyAuth: []
/segments/{segment_id}:
get:
summary: Get segment
description: 'Returns the schema of a requested segment. Note: this does not return the list of members in the segment.'
operationId: RealtimeSegments_GetSegment
responses:
'200':
description: A successful response.
content:
application/json:
schema:
$ref: '#/components/schemas/GetSegmentResponse'
parameters:
- name: segment_id
in: path
required: true
schema:
type: string
tags:
- RealtimeSegments
security:
- ApiKeyAuth: []
delete:
summary: Delete segment
description: 'Removes the requested segment. Note: this does not delete the members of the segment.'
operationId: RealtimeSegments_UninstallSegment
responses:
'200':
description: A successful response.
content:
application/json:
schema:
$ref: '#/components/schemas/UninstallSegmentResponse'
'404':
description: Not Found.
content:
application/json:
schema: {}
parameters:
- name: segment_id
in: path
required: true
schema:
type: string
tags:
- RealtimeSegments
security:
- ApiKeyAuth: []
post:
summary: Create segment
description: Create a new segment.
operationId: RealtimeSegments_CreateSegment
responses:
'200':
description: A successful response.
content:
application/json:
schema:
$ref: '#/components/schemas/InstallSegmentResponse'
'201':
description: Created.
content:
application/json:
schema:
$ref: '#/components/schemas/InstallSegmentResponse'
'400':
description: Bad Request.
content:
application/json:
schema: {}
parameters:
- name: segment_id
in: path
required: true
schema:
type: string
requestBody:
$ref: '#/components/requestBodies/RealtimeSegments_CreateSegmentBody'
tags:
- RealtimeSegments
security:
- ApiKeyAuth: []
put:
summary: Update segment
description: Modify the parameters of an existing segment.
operationId: RealtimeSegments_InstallSegment
responses:
'200':
description: A successful response.
content:
application/json:
schema:
$ref: '#/components/schemas/InstallSegmentResponse'
'201':
description: Created.
content:
application/json:
schema:
$ref: '#/components/schemas/InstallSegmentResponse'
'400':
description: Bad Request.
content:
application/json:
schema: {}
parameters:
- name: segment_id
in: path
required: true
schema:
type: string
requestBody:
$ref: '#/components/requestBodies/RealtimeSegments_CreateSegmentBody'
tags:
- RealtimeSegments
security:
- ApiKeyAuth: []
/segments/{segment_id}:validate:
post:
summary: Validate segment
description: Validate segment definition.
operationId: RealtimeSegments_ValidateSegment
responses:
'200':
description: Valid segment definition.
content:
application/json:
schema:
properties: {}
'400':
description: Bad Request.
content:
application/json:
schema: {}
parameters:
- name: segment_id
in: path
required: true
schema:
type: string
requestBody:
$ref: '#/components/requestBodies/RealtimeSegments_CreateSegmentBody'
tags:
- RealtimeSegments
security:
- ApiKeyAuth: []
components:
schemas:
Expression:
type: object
properties:
combination:
$ref: '#/components/schemas/Expression.Combination'
comparison:
$ref: '#/components/schemas/Comparison'
path_reference:
$ref: '#/components/schemas/PathReference'
string_literal:
$ref: '#/components/schemas/StringLiteral'
number_literal:
$ref: '#/components/schemas/NumberLiteral'
boolean_literal:
$ref: '#/components/schemas/BooleanLiteral'
is_missing:
$ref: '#/components/schemas/IsMissing'
is_not_missing:
$ref: '#/components/schemas/IsNotMissing'
false_or_missing:
$ref: '#/components/schemas/FalseOrMissing'
true_or_missing:
$ref: '#/components/schemas/TrueOrMissing'
coalesce:
$ref: '#/components/schemas/Coalesce'
truncate_time:
$ref: '#/components/schemas/TruncateTime'
shift_time:
$ref: '#/components/schemas/ShiftTime'
any_of_string:
$ref: '#/components/schemas/AnyOfString'
any_of_number:
$ref: '#/components/schemas/AnyOfNumber'
none_of_string:
$ref: '#/components/schemas/NoneOfString'
none_of_number:
$ref: '#/components/schemas/NoneOfNumber'
like_any_of_string:
$ref: '#/components/schemas/LikeAnyOfString'
like_none_of_string:
$ref: '#/components/schemas/LikeNoneOfString'
is_list_member:
$ref: '#/components/schemas/IsListMember'
is_not_list_member:
$ref: '#/components/schemas/IsNotListMember'
Conjunction:
type: string
enum:
- CONJUNCTION_NOT_SET
- AND
- OR
default: CONJUNCTION_NOT_SET
ListSegmentsResponse:
type: object
properties:
segment_ids:
type: array
items:
type: string
IsMissing:
type: object
properties:
source:
$ref: '#/components/schemas/Expression'
description: Evaluates to boolean.
SequenceCondition:
type: object
properties:
sequence:
$ref: '#/components/schemas/Sequence'
min_count:
type: integer
format: int32
description: Optional, but at least one of min_count or max_count should be specified.
max_count:
type: integer
format: int32
description: Optional, cannot be less than min_count.
Key:
type: object
properties:
key:
type: string
description: Must be unique within a SegmentDefinition.
ShiftTime:
type: object
properties:
source:
$ref: '#/components/schemas/Expression'
amount:
$ref: '#/components/schemas/Expression'
unit:
$ref: '#/components/schemas/TimeUnit'
timezone:
$ref: '#/components/schemas/Expression'
description: Evaluates to number (epoch seconds).
TimeUnit:
type: string
enum:
- TIME_UNIT_NOT_SET
- SECOND
- MINUTE
- HOUR
- DAY
default: TIME_UNIT_NOT_SET
NoneOfString:
type: object
properties:
needle:
$ref: '#/components/schemas/Expression'
haystack:
type: array
items:
type: string
description: Evaluates to boolean.
TrackedData:
type: object
properties:
key:
$ref: '#/components/schemas/Key'
source_path:
type: string
description: 'Path to a source object, eg: event.product or event.product.parent_product.'
field_sub_paths:
type: array
items:
type: string
description: 'Within the source, set of field sub-paths, eg: (product_id, category.name_0).'
BooleanLiteral:
type: object
properties:
value:
type: boolean
description: Evaluates to boolean.
Condition.Combination:
type: object
properties:
conjunction:
$ref: '#/components/schemas/Conjunction'
conditions:
type: array
items:
$ref: '#/components/schemas/Condition'
CustomerCondition:
type: object
properties:
customer_filter:
$ref: '#/components/schemas/Expression'
Sequence:
type: object
properties:
entry_event_filter:
$ref: '#/components/schemas/Expression'
unique_key_sources:
type: array
items:
$ref: '#/components/schemas/Expression'
description: Optional, each must evaluate to a primitive.
tracked_data:
type: array
items:
$ref: '#/components/schemas/TrackedData'
description: Optional.
max_age_seconds:
type: integer
format: int32
description: Must be between 1 and 2419200 (ie, 28 days).
goal:
$ref: '#/components/schemas/Continuation'
disqualifier:
$ref: '#/components/schemas/Continuation'
TruncateTime:
type: object
properties:
source:
$ref: '#/components/schemas/Expression'
unit:
$ref: '#/components/schemas/TimeUnit'
timezone:
$ref: '#/components/schemas/Expression'
description: Evaluates to number (epoch seconds).
StringLiteral:
type: object
properties:
value:
type: string
description: Evaluates to string.
Comparison:
type: object
properties:
lhs:
$ref: '#/components/schemas/Expression'
comparator:
$ref: '#/components/schemas/Comparator'
rhs:
$ref: '#/components/schemas/Expression'
description: Evaluates to boolean.
Continuation.Combination:
type: object
properties:
conjunction:
$ref: '#/components/schemas/Conjunction'
continuations:
type: array
items:
$ref: '#/components/schemas/Continuation'
description: Cannot be empty.
AnyOfString:
type: object
properties:
needle:
$ref: '#/components/schemas/Expression'
haystack:
type: array
items:
type: string
description: Evaluates to boolean.
NumberLiteral:
type: object
properties:
value:
type: string
description: Evaluates to number.
LikeNoneOfString:
type: object
properties:
needle:
$ref: '#/components/schemas/Expression'
haystack:
type: array
items:
type: string
description: Evaluates to boolean.
PathReference:
type: object
properties:
value:
type: string
description: Evaluates to type of referenced field.
IsNotMissing:
type: object
properties:
source:
$ref: '#/components/schemas/Expression'
description: Evaluates to boolean.
IsNotListMember:
type: object
properties:
list:
type: string
description: Evaluates to boolean.
GetSegmentResponse:
type: object
properties:
revision:
type: integer
format: int32
example: 1
description:
type: string
example: Customer has email
metadata:
type: object
example:
display_name: Customer Has Email
additionalProperties:
type: string
definition:
$ref: '#/components/schemas/SegmentDefinition'
FalseOrMissing:
type: object
properties:
source:
$ref: '#/components/schemas/Expression'
description: Evaluates to boolean.
Coalesce:
type: object
properties:
sources:
type: array
items:
$ref: '#/components/schemas/Expression'
description: Must all evaluate to same type.
description: Evaluates to type of source.
LikeAnyOfString:
type: object
properties:
needle:
$ref: '#/components/schemas/Expression'
haystack:
type: array
items:
type: string
description: Evaluates to boolean.
SegmentDefinition:
type: object
example:
root_condition:
customer_condition:
customer_filter:
is_not_missing:
source:
path_reference:
value: customer.email
properties:
root_condition:
$ref: '#/components/schemas/Condition'
collections:
type: array
items:
$ref: '#/components/schemas/Collection'
UninstallSegmentResponse:
type: object
NoneOfNumber:
type: object
properties:
needle:
$ref: '#/components/schemas/Expression'
haystack:
type: array
items:
type: string
description: Evaluates to boolean.
Collection:
type: object
properties:
key:
type: string
source:
$ref: '#/components/schemas/Key'
narrowed_sub_paths:
type: array
items:
type: string
description: Optional, a subset of the tracked data's sub-paths for narrowing the output.
unique:
type: boolean
description: Only output unique rows.
Condition:
type: object
properties:
combination:
$ref: '#/components/schemas/Condition.Combination'
customer_condition:
$ref: '#/components/schemas/CustomerCondition'
sequence_condition:
$ref: '#/components/schemas/SequenceCondition'
AnyOfNumber:
type: object
properties:
needle:
$ref: '#/components/schemas/Expression'
haystack:
type: array
items:
type: string
description: Evaluates to boolean.
IsListMember:
type: object
properties:
list:
type: string
description: Evaluates to boolean.
Expression.Combination:
type: object
properties:
conjunction:
$ref: '#/components/schemas/Conjunction'
expressions:
type: array
items:
$ref: '#/components/schemas/Expression'
description: Cannot be empty; all must evaluate to boolean.
description: Evaluates to boolean.
TrueOrMissing:
type: object
properties:
source:
$ref: '#/components/schemas/Expression'
description: Evaluates to boolean.
Comparator:
type: string
enum:
- COMPARATOR_NOT_SET
- EQUAL
- NOT_EQUAL
- LESS_THAN
- LESS_THAN_OR_EQUAL
- GREATER_THAN
- GREATER_THAN_OR_EQUAL
- LIKE
- NOT_LIKE
default: COMPARATOR_NOT_SET
InstallSegmentResponse:
type: object
example:
revision: 1
properties:
revision:
type: integer
format: int32
Continuation:
type: object
properties:
combination:
$ref: '#/components/schemas/Continuation.Combination'
event_filter:
$ref: '#/components/schemas/Expression'
sequence_condition:
$ref: '#/components/schemas/SequenceCondition'
timeout_source:
$ref: '#/components/schemas/Expression'
requestBodies:
RealtimeSegments_CreateSegmentBody:
content:
application/json:
schema:
type: object
properties:
description:
type: string
example: Customer has email
metadata:
type: object
example:
display_name: Customer Has Email
additionalProperties:
type: string
definition:
$ref: '#/components/schemas/SegmentDefinition'
required: true
securitySchemes:
ApiKeyAuth:
type: apiKey
name: x-api-key
in: header
x-readme:
explorer-enabled: true
proxy-enabled: true