segment · Capability

Segment Config API

The Segment Config API allows programmatic management of Segment workspaces, sources, destinations, and other configuration resources. It provides endpoints to list workspace sources and destinations, create or delete destinations, and manage tracking plans. As of early 2024, Segment has stopped issuing new Config API tokens and recommends migrating to the Public API for access to the latest features. The Config API remains functional for existing users but is no longer actively developed.

Run with Naftiko SegmentAPI

What You Can Do

GET
Getworkspace — Get workspace
/workspaces/{workspaceName}
GET
Listsources — List sources
/workspaces/{workspaceName}/sources
POST
Createsource — Create source
/workspaces/{workspaceName}/sources
GET
Getsource — Get source
/workspaces/{workspaceName}/sources/{sourceName}
DELETE
Deletesource — Delete source
/workspaces/{workspaceName}/sources/{sourceName}
GET
Listdestinations — List destinations
/workspaces/{workspaceName}/sources/{sourceName}/destinations
POST
Createdestination — Create destination
/workspaces/{workspaceName}/sources/{sourceName}/destinations
GET
Getdestination — Get destination
/workspaces/{workspaceName}/sources/{sourceName}/destinations/{destinationName}
PATCH
Updatedestination — Update destination
/workspaces/{workspaceName}/sources/{sourceName}/destinations/{destinationName}
DELETE
Deletedestination — Delete destination
/workspaces/{workspaceName}/sources/{sourceName}/destinations/{destinationName}
GET
Listtrackingplans — List tracking plans
/workspaces/{workspaceName}/tracking-plans
POST
Createtrackingplan — Create tracking plan
/workspaces/{workspaceName}/tracking-plans

MCP Tools

getworkspace

Get workspace

read-only idempotent
listsources

List sources

read-only idempotent
createsource

Create source

getsource

Get source

read-only idempotent
deletesource

Delete source

idempotent
listdestinations

List destinations

read-only idempotent
createdestination

Create destination

getdestination

Get destination

read-only idempotent
updatedestination

Update destination

deletedestination

Delete destination

idempotent
listtrackingplans

List tracking plans

read-only idempotent
createtrackingplan

Create tracking plan

Capability Spec

segment-capability.yaml Raw ↑
naftiko: 1.0.0-alpha2
info:
  label: Segment Config API
  description: The Segment Config API allows programmatic management of Segment workspaces, sources, destinations, and other
    configuration resources. It provides endpoints to list workspace sources and destinations, create or delete destinations,
    and manage tracking plans. As of early 2024, Segment has stopped issuing new Config API tokens and recommends migrating
    to the Public API for access to the latest features. The Config API remains functional for existing users but is no longer
    actively developed.
  tags:
  - Segment
  - API
  created: '2026-05-06'
  modified: '2026-05-06'
capability:
  consumes:
  - type: http
    namespace: segment
    baseUri: https://platform.segmentapis.com/v1beta
    description: Segment Config API HTTP API.
    authentication:
      type: bearer
      token: '{{SEGMENT_TOKEN}}'
    resources:
    - name: workspaces-workspacename
      path: /workspaces/{workspaceName}
      operations:
      - name: getworkspace
        method: GET
        description: Get workspace
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: workspaces-workspacename-sources
      path: /workspaces/{workspaceName}/sources
      operations:
      - name: listsources
        method: GET
        description: List sources
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
      - name: createsource
        method: POST
        description: Create source
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: workspaces-workspacename-sources-sourcename
      path: /workspaces/{workspaceName}/sources/{sourceName}
      operations:
      - name: getsource
        method: GET
        description: Get source
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
      - name: deletesource
        method: DELETE
        description: Delete source
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: workspaces-workspacename-sources-sourcename-dest
      path: /workspaces/{workspaceName}/sources/{sourceName}/destinations
      operations:
      - name: listdestinations
        method: GET
        description: List destinations
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
      - name: createdestination
        method: POST
        description: Create destination
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: workspaces-workspacename-sources-sourcename-dest
      path: /workspaces/{workspaceName}/sources/{sourceName}/destinations/{destinationName}
      operations:
      - name: getdestination
        method: GET
        description: Get destination
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
      - name: updatedestination
        method: PATCH
        description: Update destination
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
      - name: deletedestination
        method: DELETE
        description: Delete destination
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: workspaces-workspacename-tracking-plans
      path: /workspaces/{workspaceName}/tracking-plans
      operations:
      - name: listtrackingplans
        method: GET
        description: List tracking plans
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
      - name: createtrackingplan
        method: POST
        description: Create tracking plan
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
  exposes:
  - type: rest
    port: 8080
    namespace: segment-rest
    description: REST adapter for Segment Config API.
    resources:
    - path: /workspaces/{workspaceName}
      name: getworkspace
      operations:
      - method: GET
        name: getworkspace
        description: Get workspace
        call: segment.getworkspace
        outputParameters:
        - type: object
          mapping: $.
    - path: /workspaces/{workspaceName}/sources
      name: listsources
      operations:
      - method: GET
        name: listsources
        description: List sources
        call: segment.listsources
        outputParameters:
        - type: object
          mapping: $.
    - path: /workspaces/{workspaceName}/sources
      name: createsource
      operations:
      - method: POST
        name: createsource
        description: Create source
        call: segment.createsource
        outputParameters:
        - type: object
          mapping: $.
    - path: /workspaces/{workspaceName}/sources/{sourceName}
      name: getsource
      operations:
      - method: GET
        name: getsource
        description: Get source
        call: segment.getsource
        outputParameters:
        - type: object
          mapping: $.
    - path: /workspaces/{workspaceName}/sources/{sourceName}
      name: deletesource
      operations:
      - method: DELETE
        name: deletesource
        description: Delete source
        call: segment.deletesource
        outputParameters:
        - type: object
          mapping: $.
    - path: /workspaces/{workspaceName}/sources/{sourceName}/destinations
      name: listdestinations
      operations:
      - method: GET
        name: listdestinations
        description: List destinations
        call: segment.listdestinations
        outputParameters:
        - type: object
          mapping: $.
    - path: /workspaces/{workspaceName}/sources/{sourceName}/destinations
      name: createdestination
      operations:
      - method: POST
        name: createdestination
        description: Create destination
        call: segment.createdestination
        outputParameters:
        - type: object
          mapping: $.
    - path: /workspaces/{workspaceName}/sources/{sourceName}/destinations/{destinationName}
      name: getdestination
      operations:
      - method: GET
        name: getdestination
        description: Get destination
        call: segment.getdestination
        outputParameters:
        - type: object
          mapping: $.
    - path: /workspaces/{workspaceName}/sources/{sourceName}/destinations/{destinationName}
      name: updatedestination
      operations:
      - method: PATCH
        name: updatedestination
        description: Update destination
        call: segment.updatedestination
        outputParameters:
        - type: object
          mapping: $.
    - path: /workspaces/{workspaceName}/sources/{sourceName}/destinations/{destinationName}
      name: deletedestination
      operations:
      - method: DELETE
        name: deletedestination
        description: Delete destination
        call: segment.deletedestination
        outputParameters:
        - type: object
          mapping: $.
    - path: /workspaces/{workspaceName}/tracking-plans
      name: listtrackingplans
      operations:
      - method: GET
        name: listtrackingplans
        description: List tracking plans
        call: segment.listtrackingplans
        outputParameters:
        - type: object
          mapping: $.
    - path: /workspaces/{workspaceName}/tracking-plans
      name: createtrackingplan
      operations:
      - method: POST
        name: createtrackingplan
        description: Create tracking plan
        call: segment.createtrackingplan
        outputParameters:
        - type: object
          mapping: $.
  - type: mcp
    port: 9090
    namespace: segment-mcp
    transport: http
    description: MCP adapter for Segment Config API for AI agent use.
    tools:
    - name: getworkspace
      description: Get workspace
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: segment.getworkspace
      outputParameters:
      - type: object
        mapping: $.
    - name: listsources
      description: List sources
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: segment.listsources
      outputParameters:
      - type: object
        mapping: $.
    - name: createsource
      description: Create source
      hints:
        readOnly: false
        destructive: false
        idempotent: false
      call: segment.createsource
      outputParameters:
      - type: object
        mapping: $.
    - name: getsource
      description: Get source
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: segment.getsource
      outputParameters:
      - type: object
        mapping: $.
    - name: deletesource
      description: Delete source
      hints:
        readOnly: false
        destructive: true
        idempotent: true
      call: segment.deletesource
      outputParameters:
      - type: object
        mapping: $.
    - name: listdestinations
      description: List destinations
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: segment.listdestinations
      outputParameters:
      - type: object
        mapping: $.
    - name: createdestination
      description: Create destination
      hints:
        readOnly: false
        destructive: false
        idempotent: false
      call: segment.createdestination
      outputParameters:
      - type: object
        mapping: $.
    - name: getdestination
      description: Get destination
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: segment.getdestination
      outputParameters:
      - type: object
        mapping: $.
    - name: updatedestination
      description: Update destination
      hints:
        readOnly: false
        destructive: false
        idempotent: false
      call: segment.updatedestination
      outputParameters:
      - type: object
        mapping: $.
    - name: deletedestination
      description: Delete destination
      hints:
        readOnly: false
        destructive: true
        idempotent: true
      call: segment.deletedestination
      outputParameters:
      - type: object
        mapping: $.
    - name: listtrackingplans
      description: List tracking plans
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: segment.listtrackingplans
      outputParameters:
      - type: object
        mapping: $.
    - name: createtrackingplan
      description: Create tracking plan
      hints:
        readOnly: false
        destructive: false
        idempotent: false
      call: segment.createtrackingplan
      outputParameters:
      - type: object
        mapping: $.
binds:
- namespace: env
  keys:
    SEGMENT_TOKEN: SEGMENT_TOKEN