segment Tracking Plans API

Operations for managing tracking plans that enforce data schemas.

Operations 7

GET /workspaces/{workspaceName}/tracking-plans List tracking plans #
POST /workspaces/{workspaceName}/tracking-plans Create tracking plan #
GET /tracking-plans List tracking plans #
POST /tracking-plans Create tracking plan #
GET /tracking-plans/{trackingPlanId} Get tracking plan #
PATCH /tracking-plans/{trackingPlanId} Update tracking plan #
DELETE /tracking-plans/{trackingPlanId} Delete tracking plan #

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/segment-tracking-plans-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

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. See our Privacy Policy and Terms.

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

OpenAPI Specification

segment-tracking-plans-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Segment Tracking Plans API
  version: 1.0.0
  contact:
    name: Segment Support
    url: https://segment.com/help/
  termsOfService: https://segment.com/legal/terms/
  x-refined-note:
  - x-status differs across the merged source definitions and was not carried
  description: 'Operations tagged Tracking Plans across 2 of this provider''s published API definitions: segment-config-api-openapi.yml, segment-public-api-openapi.yml. Each path carries the servers of the definition it was published in.'
servers:
- url: https://platform.segmentapis.com/v1beta
  description: Production Server (v1beta)
- url: https://api.segmentapis.com
  description: Production Server
security:
- bearerAuth: []
tags:
- name: Tracking Plans
  description: Operations for managing tracking plans that enforce data schemas.
paths:
  /workspaces/{workspaceName}/tracking-plans:
    get:
      operationId: listTrackingPlans
      summary: List tracking plans
      description: Returns a list of all tracking plans in the workspace.
      tags:
      - Tracking Plans
      parameters:
      - $ref: '#/components/parameters/WorkspaceName'
      responses:
        '200':
          description: Tracking plans retrieved successfully.
          content:
            application/json:
              schema:
                type: object
                properties:
                  tracking_plans:
                    type: array
                    items:
                      $ref: '#/components/schemas/TrackingPlan'
        '401':
          $ref: '#/components/responses/Unauthorized'
    post:
      operationId: createTrackingPlan
      summary: Create tracking plan
      description: Creates a new tracking plan in the workspace.
      tags:
      - Tracking Plans
      parameters:
      - $ref: '#/components/parameters/WorkspaceName'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - tracking_plan
              properties:
                tracking_plan:
                  type: object
                  required:
                  - display_name
                  properties:
                    display_name:
                      type: string
                      description: The display name of the tracking plan.
                    rules:
                      type: object
                      description: The rules for the tracking plan.
                      properties:
                        events:
                          type: array
                          description: Event rules for the tracking plan.
                          items:
                            $ref: '#/components/schemas/TrackingPlanRule'
      responses:
        '200':
          description: Tracking plan created successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TrackingPlan'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
    servers:
    - url: https://platform.segmentapis.com/v1beta
      description: Production Server (v1beta)
  /tracking-plans:
    get:
      operationId: listTrackingPlans
      summary: List tracking plans
      description: Returns a list of all tracking plans in the workspace.
      tags:
      - Tracking Plans
      parameters:
      - $ref: '#/components/parameters/PaginationCursor'
      - $ref: '#/components/parameters/PaginationCount'
      responses:
        '200':
          description: Tracking plans retrieved successfully.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      trackingPlans:
                        type: array
                        items:
                          $ref: '#/components/schemas/TrackingPlan_2'
                      pagination:
                        $ref: '#/components/schemas/Pagination'
        '401':
          $ref: '#/components/responses/Unauthorized'
    post:
      operationId: createTrackingPlan
      summary: Create tracking plan
      description: Creates a new tracking plan in the workspace with the specified rules and configuration.
      tags:
      - Tracking Plans
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - name
              properties:
                name:
                  type: string
                  description: The name of the tracking plan.
                description:
                  type: string
                  description: A description of the tracking plan.
                type:
                  type: string
                  description: The type of tracking plan.
                  enum:
                  - ENGAGE
                  - LIVE
                  - PROPERTY_LIBRARY
                  - RULE_LIBRARY
                  - TEMPLATE
                rules:
                  type: array
                  description: The rules that define the tracking plan.
                  items:
                    $ref: '#/components/schemas/TrackingPlanRule_2'
      responses:
        '200':
          description: Tracking plan created successfully.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      trackingPlan:
                        $ref: '#/components/schemas/TrackingPlan_2'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
    servers:
    - url: https://api.segmentapis.com
      description: Production Server
  /tracking-plans/{trackingPlanId}:
    get:
      operationId: getTrackingPlan
      summary: Get tracking plan
      description: Returns a single tracking plan by its ID.
      tags:
      - Tracking Plans
      parameters:
      - $ref: '#/components/parameters/TrackingPlanId'
      responses:
        '200':
          description: Tracking plan retrieved successfully.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      trackingPlan:
                        $ref: '#/components/schemas/TrackingPlan_2'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
    patch:
      operationId: updateTrackingPlan
      summary: Update tracking plan
      description: Updates an existing tracking plan with the provided changes.
      tags:
      - Tracking Plans
      parameters:
      - $ref: '#/components/parameters/TrackingPlanId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: Updated name for the tracking plan.
                description:
                  type: string
                  description: Updated description.
      responses:
        '200':
          description: Tracking plan updated successfully.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      trackingPlan:
                        $ref: '#/components/schemas/TrackingPlan_2'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
    delete:
      operationId: deleteTrackingPlan
      summary: Delete tracking plan
      description: Deletes a tracking plan from the workspace.
      tags:
      - Tracking Plans
      parameters:
      - $ref: '#/components/parameters/TrackingPlanId'
      responses:
        '200':
          description: Tracking plan deleted successfully.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      status:
                        type: string
                        description: Status of the delete operation.
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
    servers:
    - url: https://api.segmentapis.com
      description: Production Server
components:
  responses:
    BadRequest:
      description: The request was invalid or malformed.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: Authentication credentials were missing or invalid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: The requested resource was not found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error_2'
  schemas:
    Error:
      type: object
      properties:
        error:
          type: string
          description: The error type.
        message:
          type: string
          description: A human-readable error message.
    TrackingPlanRule:
      type: object
      properties:
        name:
          type: string
          description: The event name this rule applies to.
        description:
          type: string
          description: A description of the event.
        rules:
          type: object
          description: The JSON Schema rules for the event properties.
          additionalProperties: true
        version:
          type: number
          description: The version of the rule.
    TrackingPlan:
      type: object
      properties:
        name:
          type: string
          description: The fully qualified name of the tracking plan.
        display_name:
          type: string
          description: The display name of the tracking plan.
        rules:
          type: object
          description: The rules of the tracking plan.
          properties:
            events:
              type: array
              description: Event rules.
              items:
                $ref: '#/components/schemas/TrackingPlanRule'
        create_time:
          type: string
          format: date-time
          description: When the tracking plan was created.
        update_time:
          type: string
          format: date-time
          description: When the tracking plan was last updated.
    Error_2:
      type: object
      properties:
        errors:
          type: array
          items:
            type: object
            properties:
              type:
                type: string
                description: The error type.
              message:
                type: string
                description: A human-readable error message.
              field:
                type: string
                description: The field that caused the error, if applicable.
              data:
                type: object
                description: Additional error data.
                additionalProperties: true
    TrackingPlanRule_2:
      type: object
      properties:
        type:
          type: string
          description: The type of event this rule applies to.
          enum:
          - COMMON
          - GROUP
          - IDENTIFY
          - PAGE
          - SCREEN
          - TRACK
        key:
          type: string
          description: The event name this rule matches, for track events.
        jsonSchema:
          type: object
          description: The JSON Schema that defines the expected properties.
          additionalProperties: true
        version:
          type: number
          description: The version of the rule.
    Pagination:
      type: object
      properties:
        current:
          type: string
          description: Cursor pointing to the current page.
        next:
          type: string
          description: Cursor pointing to the next page. Null if no more pages.
        totalEntries:
          type: integer
          description: Total number of entries across all pages.
    TrackingPlan_2:
      type: object
      properties:
        id:
          type: string
          description: The unique identifier of the tracking plan.
        name:
          type: string
          description: The name of the tracking plan.
        slug:
          type: string
          description: The URL-friendly slug of the tracking plan.
        description:
          type: string
          description: A description of the tracking plan.
        type:
          type: string
          description: The type of tracking plan.
          enum:
          - ENGAGE
          - LIVE
          - PROPERTY_LIBRARY
          - RULE_LIBRARY
          - TEMPLATE
        createdAt:
          type: string
          format: date-time
          description: When the tracking plan was created.
        updatedAt:
          type: string
          format: date-time
          description: When the tracking plan was last updated.
  parameters:
    WorkspaceName:
      name: workspaceName
      in: path
      required: true
      description: The name of the workspace.
      schema:
        type: string
    PaginationCount:
      name: pagination[count]
      in: query
      description: Number of items to return per page.
      schema:
        type: integer
        minimum: 1
        maximum: 200
        default: 10
    PaginationCursor:
      name: pagination[cursor]
      in: query
      description: Cursor for pagination. Use the cursor returned in a previous response to fetch the next page.
      schema:
        type: string
    TrackingPlanId:
      name: trackingPlanId
      in: path
      required: true
      description: The unique identifier of the tracking plan.
      schema:
        type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Segment Config API access token. Note that as of early 2024, Segment has stopped issuing new Config API tokens.
x-refined-from:
- segment-config-api-openapi.yml
- segment-public-api-openapi.yml