{ "openapi": "3.0.3", "info": { "title": "Segment Public API", "description": "The Segment Public API allows you to manage Segment Workspaces and their resources including Sources, Destinations, Warehouses, Spaces, and more.", "version": "73.0.0", "x-jentic-source-url": "https://docs.segmentapis.com/" }, "servers": [ { "url": "https://api.segmentapis.com", "description": "Segment Public API" } ], "paths": { "/sources": { "get": { "operationId": "listSources", "summary": "List Sources", "description": "Lists all Sources in the Workspace.", "tags": [ "Sources" ], "parameters": [ { "name": "pagination[cursor]", "in": "query", "required": false, "schema": { "type": "string" }, "description": "Pagination cursor" }, { "name": "pagination[count]", "in": "query", "required": false, "schema": { "type": "integer" }, "description": "Number of items per page" } ], "responses": { "200": { "description": "Sources retrieved successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SourceListResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } }, "post": { "operationId": "createSource", "summary": "Create Source", "description": "Creates a new Source in the Workspace.", "tags": [ "Sources" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateSourceRequest" } } } }, "responses": { "200": { "description": "Source created successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SourceResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/sources/{sourceId}": { "get": { "operationId": "getSource", "summary": "Get Source", "description": "Retrieves a specific Source by its identifier.", "tags": [ "Sources" ], "parameters": [ { "name": "sourceId", "in": "path", "required": true, "schema": { "type": "string" }, "description": "Source identifier" } ], "responses": { "200": { "description": "Source retrieved successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SourceResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } }, "patch": { "operationId": "updateSource", "summary": "Update Source", "description": "Updates an existing Source.", "tags": [ "Sources" ], "parameters": [ { "name": "sourceId", "in": "path", "required": true, "schema": { "type": "string" }, "description": "Source identifier" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateSourceRequest" } } } }, "responses": { "200": { "description": "Source updated successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SourceResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } }, "delete": { "operationId": "deleteSource", "summary": "Delete Source", "description": "Deletes a Source from the Workspace.", "tags": [ "Sources" ], "parameters": [ { "name": "sourceId", "in": "path", "required": true, "schema": { "type": "string" }, "description": "Source identifier" } ], "responses": { "200": { "description": "Source deleted successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SuccessResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/sources/{sourceId}/labels": { "post": { "operationId": "addLabelsToSource", "summary": "Add Labels to Source", "description": "Adds existing labels to a Source.", "tags": [ "Sources" ], "parameters": [ { "name": "sourceId", "in": "path", "required": true, "schema": { "type": "string" }, "description": "Source identifier" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/LabelsRequest" } } } }, "responses": { "200": { "description": "Labels added successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/LabelsResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } }, "put": { "operationId": "replaceLabelsInSource", "summary": "Replace Labels in Source", "description": "Replaces all labels for a Source.", "tags": [ "Sources" ], "parameters": [ { "name": "sourceId", "in": "path", "required": true, "schema": { "type": "string" }, "description": "Source identifier" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/LabelsRequest" } } } }, "responses": { "200": { "description": "Labels replaced successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/LabelsResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/sources/{sourceId}/write-keys": { "post": { "operationId": "createWriteKeyForSource", "summary": "Create Write Key for Source", "description": "Creates a new write key for a Source.", "tags": [ "Sources" ], "parameters": [ { "name": "sourceId", "in": "path", "required": true, "schema": { "type": "string" }, "description": "Source identifier" } ], "responses": { "200": { "description": "Write key created successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WriteKeyResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/sources/{sourceId}/write-keys/{writeKeyId}": { "delete": { "operationId": "removeWriteKeyFromSource", "summary": "Remove Write Key from Source", "description": "Removes a write key from a Source.", "tags": [ "Sources" ], "parameters": [ { "name": "sourceId", "in": "path", "required": true, "schema": { "type": "string" }, "description": "Source identifier" }, { "name": "writeKeyId", "in": "path", "required": true, "schema": { "type": "string" }, "description": "Write key identifier" } ], "responses": { "200": { "description": "Write key removed successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SuccessResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/sources/{sourceId}/destinations": { "get": { "operationId": "listConnectedDestinationsFromSource", "summary": "List Connected Destinations from Source", "description": "Lists all Destinations connected to a Source.", "tags": [ "Sources" ], "parameters": [ { "name": "sourceId", "in": "path", "required": true, "schema": { "type": "string" }, "description": "Source identifier" } ], "responses": { "200": { "description": "Connected destinations retrieved successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DestinationListResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/sources/{sourceId}/warehouses": { "get": { "operationId": "listConnectedWarehousesFromSource", "summary": "List Connected Warehouses from Source", "description": "Lists all Warehouses connected to a Source.", "tags": [ "Sources" ], "parameters": [ { "name": "sourceId", "in": "path", "required": true, "schema": { "type": "string" }, "description": "Source identifier" } ], "responses": { "200": { "description": "Connected warehouses retrieved successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WarehouseListResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/sources/{sourceId}/schema-settings": { "get": { "operationId": "listSchemaSettingsInSource", "summary": "List Schema Settings in Source", "description": "Retrieves schema settings for a Source.", "tags": [ "Sources" ], "parameters": [ { "name": "sourceId", "in": "path", "required": true, "schema": { "type": "string" }, "description": "Source identifier" } ], "responses": { "200": { "description": "Schema settings retrieved successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SchemaSettingsResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } }, "patch": { "operationId": "updateSchemaSettingsInSource", "summary": "Update Schema Settings in Source", "description": "Updates schema settings for a Source.", "tags": [ "Sources" ], "parameters": [ { "name": "sourceId", "in": "path", "required": true, "schema": { "type": "string" }, "description": "Source identifier" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateSchemaSettingsRequest" } } } }, "responses": { "200": { "description": "Schema settings updated successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SchemaSettingsResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/destinations": { "get": { "operationId": "listDestinations", "summary": "List Destinations", "description": "Retrieves all configured Destinations.", "tags": [ "Destinations" ], "parameters": [ { "name": "pagination[cursor]", "in": "query", "required": false, "schema": { "type": "string" }, "description": "Pagination cursor" }, { "name": "pagination[count]", "in": "query", "required": false, "schema": { "type": "integer" }, "description": "Number of items per page" } ], "responses": { "200": { "description": "Destinations retrieved successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DestinationListResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } }, "post": { "operationId": "createDestination", "summary": "Create Destination", "description": "Creates a new Destination connected to a Source.", "tags": [ "Destinations" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateDestinationRequest" } } } }, "responses": { "200": { "description": "Destination created successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DestinationResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/destinations/{destinationId}": { "get": { "operationId": "getDestination", "summary": "Get Destination", "description": "Retrieves a specific Destination configuration.", "tags": [ "Destinations" ], "parameters": [ { "name": "destinationId", "in": "path", "required": true, "schema": { "type": "string" }, "description": "Destination identifier" } ], "responses": { "200": { "description": "Destination retrieved successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DestinationResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } }, "patch": { "operationId": "updateDestination", "summary": "Update Destination", "description": "Modifies an existing Destination.", "tags": [ "Destinations" ], "parameters": [ { "name": "destinationId", "in": "path", "required": true, "schema": { "type": "string" }, "description": "Destination identifier" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateDestinationRequest" } } } }, "responses": { "200": { "description": "Destination updated successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DestinationResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } }, "delete": { "operationId": "deleteDestination", "summary": "Delete Destination", "description": "Removes a Destination.", "tags": [ "Destinations" ], "parameters": [ { "name": "destinationId", "in": "path", "required": true, "schema": { "type": "string" }, "description": "Destination identifier" } ], "responses": { "200": { "description": "Destination deleted successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SuccessResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/destinations/{destinationId}/subscriptions": { "get": { "operationId": "listSubscriptionsFromDestination", "summary": "List Subscriptions from Destination", "description": "Lists all event subscriptions for a Destination.", "tags": [ "Destinations" ], "parameters": [ { "name": "destinationId", "in": "path", "required": true, "schema": { "type": "string" }, "description": "Destination identifier" } ], "responses": { "200": { "description": "Subscriptions retrieved successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SubscriptionListResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } }, "post": { "operationId": "createDestinationSubscription", "summary": "Create Destination Subscription", "description": "Adds an event subscription to a Destination.", "tags": [ "Destinations" ], "parameters": [ { "name": "destinationId", "in": "path", "required": true, "schema": { "type": "string" }, "description": "Destination identifier" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateSubscriptionRequest" } } } }, "responses": { "200": { "description": "Subscription created successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SubscriptionResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/destinations/{destinationId}/subscriptions/{subscriptionId}": { "get": { "operationId": "getSubscriptionFromDestination", "summary": "Get Subscription from Destination", "description": "Retrieves a specific event subscription.", "tags": [ "Destinations" ], "parameters": [ { "name": "destinationId", "in": "path", "required": true, "schema": { "type": "string" }, "description": "Destination identifier" }, { "name": "subscriptionId", "in": "path", "required": true, "schema": { "type": "string" }, "description": "Subscription identifier" } ], "responses": { "200": { "description": "Subscription retrieved successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SubscriptionResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } }, "patch": { "operationId": "updateSubscriptionForDestination", "summary": "Update Subscription for Destination", "description": "Modifies a Destination subscription.", "tags": [ "Destinations" ], "parameters": [ { "name": "destinationId", "in": "path", "required": true, "schema": { "type": "string" }, "description": "Destination identifier" }, { "name": "subscriptionId", "in": "path", "required": true, "schema": { "type": "string" }, "description": "Subscription identifier" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateSubscriptionRequest" } } } }, "responses": { "200": { "description": "Subscription updated successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SubscriptionResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } }, "delete": { "operationId": "removeSubscriptionFromDestination", "summary": "Remove Subscription from Destination", "description": "Deletes an event subscription.", "tags": [ "Destinations" ], "parameters": [ { "name": "destinationId", "in": "path", "required": true, "schema": { "type": "string" }, "description": "Destination identifier" }, { "name": "subscriptionId", "in": "path", "required": true, "schema": { "type": "string" }, "description": "Subscription identifier" } ], "responses": { "200": { "description": "Subscription deleted successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SuccessResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/destinations/{destinationId}/delivery-metrics": { "get": { "operationId": "listDeliveryMetricsSummaryFromDestination", "summary": "List Delivery Metrics Summary from Destination", "description": "Retrieves delivery performance metrics for a Destination.", "tags": [ "Destinations" ], "parameters": [ { "name": "destinationId", "in": "path", "required": true, "schema": { "type": "string" }, "description": "Destination identifier" }, { "name": "startDate", "in": "query", "required": false, "schema": { "type": "string", "format": "date" }, "description": "Start date for metrics range" }, { "name": "endDate", "in": "query", "required": false, "schema": { "type": "string", "format": "date" }, "description": "End date for metrics range" } ], "responses": { "200": { "description": "Delivery metrics retrieved successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DeliveryMetricsResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/warehouses/{warehouseId}/connected-sources/{sourceId}": { "post": { "operationId": "addConnectionFromSourceToWarehouse", "summary": "Add Connection from Source to Warehouse", "description": "Connects a Source to a Warehouse.", "tags": [ "Warehouses" ], "parameters": [ { "name": "warehouseId", "in": "path", "required": true, "schema": { "type": "string" }, "description": "Warehouse identifier" }, { "name": "sourceId", "in": "path", "required": true, "schema": { "type": "string" }, "description": "Source identifier" } ], "responses": { "200": { "description": "Connection created successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SuccessResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } }, "delete": { "operationId": "removeSourceConnectionFromWarehouse", "summary": "Remove Source Connection from Warehouse", "description": "Disconnects a Source from a Warehouse.", "tags": [ "Warehouses" ], "parameters": [ { "name": "warehouseId", "in": "path", "required": true, "schema": { "type": "string" }, "description": "Warehouse identifier" }, { "name": "sourceId", "in": "path", "required": true, "schema": { "type": "string" }, "description": "Source identifier" } ], "responses": { "200": { "description": "Connection removed successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SuccessResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/spaces": { "get": { "operationId": "listSpaces", "summary": "List Spaces", "description": "Retrieves all available spaces.", "tags": [ "Spaces" ], "responses": { "200": { "description": "Spaces retrieved successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SpaceListResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/spaces/{spaceId}": { "get": { "operationId": "getSpace", "summary": "Get Space", "description": "Retrieves a specific space by its identifier.", "tags": [ "Spaces" ], "parameters": [ { "name": "spaceId", "in": "path", "required": true, "schema": { "type": "string" }, "description": "Space identifier" } ], "responses": { "200": { "description": "Space retrieved successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SpaceResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/spaces/{spaceId}/messaging-subscriptions/batch": { "post": { "operationId": "batchQueryMessagingSubscriptionsForSpace", "summary": "Batch Query Messaging Subscriptions for Space", "description": "Retrieves messaging subscription statuses for multiple recipients in a space.", "tags": [ "Spaces" ], "parameters": [ { "name": "spaceId", "in": "path", "required": true, "schema": { "type": "string" }, "description": "Space identifier" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BatchSubscriptionQueryRequest" } } } }, "responses": { "200": { "description": "Subscription statuses retrieved successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BatchSubscriptionQueryResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/spaces/{spaceId}/messaging-subscriptions": { "put": { "operationId": "replaceMessagingSubscriptionsInSpaces", "summary": "Replace Messaging Subscriptions in Spaces", "description": "Updates messaging subscription settings for a space.", "tags": [ "Spaces" ], "parameters": [ { "name": "spaceId", "in": "path", "required": true, "schema": { "type": "string" }, "description": "Space identifier" } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ReplaceMessagingSubscriptionsRequest" } } } }, "responses": { "200": { "description": "Subscriptions replaced successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SuccessResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } } }, "components": { "securitySchemes": { "bearerAuth": { "type": "http", "scheme": "bearer", "description": "Segment Public API token" } }, "schemas": { "Source": { "type": "object", "properties": { "id": { "type": "string" }, "slug": { "type": "string" }, "name": { "type": "string" }, "workspaceId": { "type": "string" }, "enabled": { "type": "boolean" }, "writeKeys": { "type": "array", "items": { "type": "string" } }, "metadata": { "type": "object" }, "settings": { "type": "object" }, "labels": { "type": "array", "items": { "$ref": "#/components/schemas/Label" } } } }, "SourceResponse": { "type": "object", "properties": { "data": { "type": "object", "properties": { "source": { "$ref": "#/components/schemas/Source" } } } } }, "SourceListResponse": { "type": "object", "properties": { "data": { "type": "object", "properties": { "sources": { "type": "array", "items": { "$ref": "#/components/schemas/Source" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } } } }, "CreateSourceRequest": { "type": "object", "required": [ "slug", "metadataId" ], "properties": { "slug": { "type": "string" }, "name": { "type": "string" }, "metadataId": { "type": "string" }, "enabled": { "type": "boolean" }, "settings": { "type": "object" } } }, "UpdateSourceRequest": { "type": "object", "properties": { "name": { "type": "string" }, "enabled": { "type": "boolean" }, "slug": { "type": "string" }, "settings": { "type": "object" } } }, "Destination": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "enabled": { "type": "boolean" }, "sourceId": { "type": "string" }, "metadataId": { "type": "string" }, "settings": { "type": "object" }, "metadata": { "type": "object" } } }, "DestinationResponse": { "type": "object", "properties": { "data": { "type": "object", "properties": { "destination": { "$ref": "#/components/schemas/Destination" } } } } }, "DestinationListResponse": { "type": "object", "properties": { "data": { "type": "object", "properties": { "destinations": { "type": "array", "items": { "$ref": "#/components/schemas/Destination" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } } } }, "CreateDestinationRequest": { "type": "object", "required": [ "sourceId", "metadataId", "settings" ], "properties": { "sourceId": { "type": "string" }, "metadataId": { "type": "string" }, "name": { "type": "string" }, "enabled": { "type": "boolean" }, "settings": { "type": "object" } } }, "UpdateDestinationRequest": { "type": "object", "properties": { "name": { "type": "string" }, "enabled": { "type": "boolean" }, "settings": { "type": "object" } } }, "Subscription": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "actionId": { "type": "string" }, "enabled": { "type": "boolean" }, "trigger": { "type": "string" }, "settings": { "type": "object" } } }, "SubscriptionResponse": { "type": "object", "properties": { "data": { "type": "object", "properties": { "subscription": { "$ref": "#/components/schemas/Subscription" } } } } }, "SubscriptionListResponse": { "type": "object", "properties": { "data": { "type": "object", "properties": { "subscriptions": { "type": "array", "items": { "$ref": "#/components/schemas/Subscription" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } } } }, "CreateSubscriptionRequest": { "type": "object", "properties": { "name": { "type": "string" }, "actionId": { "type": "string" }, "enabled": { "type": "boolean" }, "trigger": { "type": "string" }, "settings": { "type": "object" } } }, "UpdateSubscriptionRequest": { "type": "object", "properties": { "name": { "type": "string" }, "enabled": { "type": "boolean" }, "trigger": { "type": "string" }, "settings": { "type": "object" } } }, "DeliveryMetricsResponse": { "type": "object", "properties": { "data": { "type": "object", "properties": { "metrics": { "type": "array", "items": { "type": "object" } } } } } }, "Space": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "slug": { "type": "string" } } }, "SpaceResponse": { "type": "object", "properties": { "data": { "type": "object", "properties": { "space": { "$ref": "#/components/schemas/Space" } } } } }, "SpaceListResponse": { "type": "object", "properties": { "data": { "type": "object", "properties": { "spaces": { "type": "array", "items": { "$ref": "#/components/schemas/Space" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } } } }, "BatchSubscriptionQueryRequest": { "type": "object", "properties": { "subscriptions": { "type": "array", "items": { "type": "object", "properties": { "key": { "type": "string", "description": "Email or phone number" }, "type": { "type": "string", "enum": [ "EMAIL", "SMS" ] } } } } } }, "BatchSubscriptionQueryResponse": { "type": "object", "properties": { "data": { "type": "object", "properties": { "successes": { "type": "array", "items": { "type": "object" } }, "failures": { "type": "array", "items": { "type": "object" } } } } } }, "ReplaceMessagingSubscriptionsRequest": { "type": "object", "properties": { "subscriptions": { "type": "array", "items": { "type": "object" } } } }, "WarehouseListResponse": { "type": "object", "properties": { "data": { "type": "object", "properties": { "warehouses": { "type": "array", "items": { "type": "object" } }, "pagination": { "$ref": "#/components/schemas/Pagination" } } } } }, "SchemaSettingsResponse": { "type": "object", "properties": { "data": { "type": "object", "properties": { "schemaSettings": { "type": "object" } } } } }, "UpdateSchemaSettingsRequest": { "type": "object", "properties": { "settings": { "type": "object" } } }, "Label": { "type": "object", "properties": { "key": { "type": "string" }, "value": { "type": "string" } } }, "LabelsRequest": { "type": "object", "properties": { "labels": { "type": "array", "items": { "$ref": "#/components/schemas/Label" } } } }, "LabelsResponse": { "type": "object", "properties": { "data": { "type": "object", "properties": { "labels": { "type": "array", "items": { "$ref": "#/components/schemas/Label" } } } } } }, "WriteKeyResponse": { "type": "object", "properties": { "data": { "type": "object", "properties": { "writeKey": { "type": "string" } } } } }, "Pagination": { "type": "object", "properties": { "current": { "type": "string" }, "next": { "type": "string" }, "totalEntries": { "type": "integer" } } }, "SuccessResponse": { "type": "object", "properties": { "data": { "type": "object", "properties": { "status": { "type": "string" } } } } }, "ErrorResponse": { "type": "object", "properties": { "errors": { "type": "array", "items": { "type": "object", "properties": { "type": { "type": "string" }, "message": { "type": "string" } } } } } } } }, "security": [ { "bearerAuth": [] } ], "tags": [ { "name": "Sources", "description": "Manage data collection sources" }, { "name": "Destinations", "description": "Manage data destinations" }, { "name": "Warehouses", "description": "Manage warehouse connections" }, { "name": "Spaces", "description": "Manage Segment spaces and messaging subscriptions" } ] }