segment Functions API

Operations for managing custom functions that transform or enrich data flowing through Segment.

Operations 5

GET /functions List functions #
POST /functions Create function #
GET /functions/{functionId} Get function #
PATCH /functions/{functionId} Update function #
DELETE /functions/{functionId} Delete function #

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-functions-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-functions-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Segment Public Functions API
  description: The Segment Public API allows developers to programmatically manage Segment workspaces and their resources. It supports full CRUD operations for sources, destinations, warehouses, tracking plans, functions, transformations, and catalog entries. The API follows REST conventions with standard HTTP methods and predictable resource-oriented URLs. It is available for Team and Business tier customers and is the recommended API going forward, replacing the older Config API.
  version: 1.0.0
  contact:
    name: Segment Support
    url: https://segment.com/help/
  termsOfService: https://segment.com/legal/terms/
servers:
- url: https://api.segmentapis.com
  description: Production Server
security:
- bearerAuth: []
tags:
- name: Functions
  description: Operations for managing custom functions that transform or enrich data flowing through Segment.
paths:
  /functions:
    get:
      operationId: listFunctions
      summary: List functions
      description: Returns a list of all custom functions in the workspace.
      tags:
      - Functions
      parameters:
      - $ref: '#/components/parameters/PaginationCursor'
      - $ref: '#/components/parameters/PaginationCount'
      - name: resourceType
        in: query
        description: Filter functions by resource type.
        schema:
          type: string
          enum:
          - DESTINATION
          - INSERT_DESTINATION
          - INSERT_SOURCE
          - SOURCE
      responses:
        '200':
          description: Functions retrieved successfully.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      functions:
                        type: array
                        items:
                          $ref: '#/components/schemas/Function'
                      pagination:
                        $ref: '#/components/schemas/Pagination'
        '401':
          $ref: '#/components/responses/Unauthorized'
    post:
      operationId: createFunction
      summary: Create function
      description: Creates a new custom function in the workspace.
      tags:
      - Functions
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - code
              - resourceType
              properties:
                code:
                  type: string
                  description: The JavaScript code for the function.
                displayName:
                  type: string
                  description: A display name for the function.
                logoUrl:
                  type: string
                  format: uri
                  description: URL of a logo image for the function.
                resourceType:
                  type: string
                  description: The type of resource this function applies to.
                  enum:
                  - DESTINATION
                  - INSERT_DESTINATION
                  - INSERT_SOURCE
                  - SOURCE
                description:
                  type: string
                  description: A description of the function.
                settings:
                  type: array
                  description: Settings definitions for the function.
                  items:
                    $ref: '#/components/schemas/FunctionSetting'
      responses:
        '200':
          description: Function created successfully.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      function:
                        $ref: '#/components/schemas/Function'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
  /functions/{functionId}:
    get:
      operationId: getFunction
      summary: Get function
      description: Returns a single function by its ID.
      tags:
      - Functions
      parameters:
      - $ref: '#/components/parameters/FunctionId'
      responses:
        '200':
          description: Function retrieved successfully.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      function:
                        $ref: '#/components/schemas/Function'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
    patch:
      operationId: updateFunction
      summary: Update function
      description: Updates an existing function with the provided changes.
      tags:
      - Functions
      parameters:
      - $ref: '#/components/parameters/FunctionId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                code:
                  type: string
                  description: Updated JavaScript code.
                displayName:
                  type: string
                  description: Updated display name.
                description:
                  type: string
                  description: Updated description.
                settings:
                  type: array
                  description: Updated settings definitions.
                  items:
                    $ref: '#/components/schemas/FunctionSetting'
      responses:
        '200':
          description: Function updated successfully.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      function:
                        $ref: '#/components/schemas/Function'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
    delete:
      operationId: deleteFunction
      summary: Delete function
      description: Deletes a function from the workspace.
      tags:
      - Functions
      parameters:
      - $ref: '#/components/parameters/FunctionId'
      responses:
        '200':
          description: Function 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'
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:
        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
    FunctionSetting:
      type: object
      properties:
        name:
          type: string
          description: The name of the setting.
        label:
          type: string
          description: A human-readable label for the setting.
        description:
          type: string
          description: A description of the setting.
        type:
          type: string
          description: The data type of the setting.
          enum:
          - BOOLEAN
          - STRING
          - TEXT_MAP
        required:
          type: boolean
          description: Whether this setting is required.
        sensitive:
          type: boolean
          description: Whether this setting contains sensitive data.
    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.
    Function:
      type: object
      properties:
        id:
          type: string
          description: The unique identifier of the function.
        resourceType:
          type: string
          description: The type of resource this function applies to.
          enum:
          - DESTINATION
          - INSERT_DESTINATION
          - INSERT_SOURCE
          - SOURCE
        createdAt:
          type: string
          format: date-time
          description: When the function was created.
        createdBy:
          type: string
          description: The user who created the function.
        code:
          type: string
          description: The JavaScript code of the function.
        displayName:
          type: string
          description: The display name of the function.
        description:
          type: string
          description: A description of the function.
        logoUrl:
          type: string
          format: uri
          description: URL of the function logo.
        settings:
          type: array
          description: Settings definitions for the function.
          items:
            $ref: '#/components/schemas/FunctionSetting'
  parameters:
    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
    FunctionId:
      name: functionId
      in: path
      required: true
      description: The unique identifier of the function.
      schema:
        type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Segment Public API access token. Generate tokens from the Segment workspace settings.
externalDocs:
  description: Segment Public API Documentation
  url: https://docs.segmentapis.com/