segment Sources API

Operations for managing data collection sources within a workspace.

Operations 9

GET /workspaces/{workspaceName}/sources List sources #
POST /workspaces/{workspaceName}/sources Create source #
GET /workspaces/{workspaceName}/sources/{sourceName} Get source #
DELETE /workspaces/{workspaceName}/sources/{sourceName} Delete source #
GET /sources List sources #
POST /sources Create source #
GET /sources/{sourceId} Get source #
PATCH /sources/{sourceId} Update source #
DELETE /sources/{sourceId} Delete source #

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-sources-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-sources-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Segment Sources 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 Sources 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: Sources
  description: Operations for managing data collection sources within a workspace.
paths:
  /workspaces/{workspaceName}/sources:
    get:
      operationId: listSources
      summary: List sources
      description: Returns a list of all sources in the specified workspace.
      tags:
      - Sources
      parameters:
      - $ref: '#/components/parameters/WorkspaceName'
      responses:
        '200':
          description: Sources retrieved successfully.
          content:
            application/json:
              schema:
                type: object
                properties:
                  sources:
                    type: array
                    items:
                      $ref: '#/components/schemas/Source'
        '401':
          $ref: '#/components/responses/Unauthorized'
    post:
      operationId: createSource
      summary: Create source
      description: Creates a new source in the specified workspace.
      tags:
      - Sources
      parameters:
      - $ref: '#/components/parameters/WorkspaceName'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - source
              properties:
                source:
                  type: object
                  required:
                  - name
                  - catalog_name
                  properties:
                    name:
                      type: string
                      description: The fully qualified name of the source.
                    catalog_name:
                      type: string
                      description: The catalog name of the source type.
      responses:
        '200':
          description: Source created successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Source'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
    servers:
    - url: https://platform.segmentapis.com/v1beta
      description: Production Server (v1beta)
  /workspaces/{workspaceName}/sources/{sourceName}:
    get:
      operationId: getSource
      summary: Get source
      description: Returns a single source by name within the specified workspace.
      tags:
      - Sources
      parameters:
      - $ref: '#/components/parameters/WorkspaceName'
      - $ref: '#/components/parameters/SourceName'
      responses:
        '200':
          description: Source retrieved successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Source'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
    delete:
      operationId: deleteSource
      summary: Delete source
      description: Deletes a source from the workspace by name.
      tags:
      - Sources
      parameters:
      - $ref: '#/components/parameters/WorkspaceName'
      - $ref: '#/components/parameters/SourceName'
      responses:
        '200':
          description: Source deleted successfully.
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
    servers:
    - url: https://platform.segmentapis.com/v1beta
      description: Production Server (v1beta)
  /sources:
    get:
      operationId: listSources
      summary: List sources
      description: Returns a list of all sources in the workspace, including their configuration, write keys, and metadata.
      tags:
      - Sources
      parameters:
      - $ref: '#/components/parameters/PaginationCursor'
      - $ref: '#/components/parameters/PaginationCount'
      responses:
        '200':
          description: Sources retrieved successfully.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      sources:
                        type: array
                        items:
                          $ref: '#/components/schemas/Source_2'
                      pagination:
                        $ref: '#/components/schemas/Pagination'
        '401':
          $ref: '#/components/responses/Unauthorized'
    post:
      operationId: createSource
      summary: Create source
      description: Creates a new source in the workspace with the specified configuration and metadata.
      tags:
      - Sources
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - slug
              - metadataId
              properties:
                slug:
                  type: string
                  description: URL-friendly name for the source.
                metadataId:
                  type: string
                  description: The ID of the source metadata from the catalog.
                enabled:
                  type: boolean
                  description: Whether the source is enabled.
                settings:
                  type: object
                  description: Configuration settings for the source.
                  additionalProperties: true
      responses:
        '200':
          description: Source created successfully.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      source:
                        $ref: '#/components/schemas/Source_2'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
    servers:
    - url: https://api.segmentapis.com
      description: Production Server
  /sources/{sourceId}:
    get:
      operationId: getSource
      summary: Get source
      description: Returns a single source by its ID, including its configuration, write key, and metadata.
      tags:
      - Sources
      parameters:
      - $ref: '#/components/parameters/SourceId'
      responses:
        '200':
          description: Source retrieved successfully.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      source:
                        $ref: '#/components/schemas/Source_2'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
    patch:
      operationId: updateSource
      summary: Update source
      description: Updates an existing source with the provided configuration changes.
      tags:
      - Sources
      parameters:
      - $ref: '#/components/parameters/SourceId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: Updated name for the source.
                enabled:
                  type: boolean
                  description: Whether the source is enabled.
                slug:
                  type: string
                  description: Updated URL-friendly name.
                settings:
                  type: object
                  description: Updated configuration settings.
                  additionalProperties: true
      responses:
        '200':
          description: Source updated successfully.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      source:
                        $ref: '#/components/schemas/Source_2'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
    delete:
      operationId: deleteSource
      summary: Delete source
      description: Deletes a source from the workspace by its ID. This action is irreversible.
      tags:
      - Sources
      parameters:
      - $ref: '#/components/parameters/SourceId'
      responses:
        '200':
          description: Source 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'
    NotFound:
      description: The requested resource was not found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: Authentication credentials were missing or invalid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  schemas:
    Error:
      type: object
      properties:
        error:
          type: string
          description: The error type.
        message:
          type: string
          description: A human-readable error message.
    Source:
      type: object
      properties:
        name:
          type: string
          description: The fully qualified name of the source.
        catalog_name:
          type: string
          description: The catalog name of the source type.
        parent:
          type: string
          description: The parent workspace name.
        write_keys:
          type: array
          items:
            type: string
          description: The write keys for the source.
        library_config:
          type: object
          description: Library configuration settings.
          additionalProperties: true
        create_time:
          type: string
          format: date-time
          description: When the source was created.
    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
    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.
    Label:
      type: object
      properties:
        key:
          type: string
          description: The label key.
        value:
          type: string
          description: The label value.
        description:
          type: string
          description: A description of the label.
    Source_2:
      type: object
      properties:
        id:
          type: string
          description: The unique identifier of the source.
        slug:
          type: string
          description: The URL-friendly slug of the source.
        name:
          type: string
          description: The display name of the source.
        enabled:
          type: boolean
          description: Whether the source is enabled.
        writeKeys:
          type: array
          items:
            type: string
          description: The write keys associated with the source.
        metadata:
          $ref: '#/components/schemas/CatalogSource'
        settings:
          type: object
          description: Configuration settings for the source.
          additionalProperties: true
        labels:
          type: array
          items:
            $ref: '#/components/schemas/Label'
          description: Labels applied to the source.
    CatalogSource:
      type: object
      properties:
        id:
          type: string
          description: The metadata ID of the catalog source.
        name:
          type: string
          description: The name of the source integration.
        slug:
          type: string
          description: The URL-friendly slug.
        description:
          type: string
          description: A description of the source integration.
        logos:
          type: object
          description: Logo URLs for the integration.
          properties:
            default:
              type: string
              format: uri
              description: Default logo URL.
            alt:
              type: string
              format: uri
              description: Alternative logo URL.
            mark:
              type: string
              format: uri
              description: Mark logo URL.
        categories:
          type: array
          items:
            type: string
          description: Categories this source belongs to.
  parameters:
    SourceName:
      name: sourceName
      in: path
      required: true
      description: The name of the source.
      schema:
        type: string
    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
    SourceId:
      name: sourceId
      in: path
      required: true
      description: The unique identifier of the source.
      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