segment Regulations API

Operations for managing data privacy regulations and suppression requests.

OpenAPI Specification

segment-regulations-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Segment Config Alias Regulations 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.
  version: 1.0.0
  contact:
    name: Segment Support
    url: https://segment.com/help/
  termsOfService: https://segment.com/legal/terms/
  x-status: deprecated
servers:
- url: https://platform.segmentapis.com/v1beta
  description: Production Server (v1beta)
security:
- bearerAuth: []
tags:
- name: Regulations
  description: Operations for managing data privacy regulations and suppression requests.
paths:
  /regulations:
    get:
      operationId: listRegulations
      summary: List regulations
      description: Returns a list of data privacy regulation requests in the workspace.
      tags:
      - Regulations
      parameters:
      - $ref: '#/components/parameters/PaginationCursor'
      - $ref: '#/components/parameters/PaginationCount'
      - name: status
        in: query
        description: Filter by regulation status.
        schema:
          type: string
          enum:
          - FAILED
          - FINISHED
          - INITIALIZED
          - INVALID
          - NOT_SUPPORTED
          - PARTIAL_SUCCESS
          - RUNNING
      responses:
        '200':
          description: Regulations retrieved successfully.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      regulations:
                        type: array
                        items:
                          $ref: '#/components/schemas/Regulation'
                      pagination:
                        $ref: '#/components/schemas/Pagination'
        '401':
          $ref: '#/components/responses/Unauthorized'
    post:
      operationId: createRegulation
      summary: Create regulation
      description: Creates a new data privacy regulation request, such as a suppression or deletion request.
      tags:
      - Regulations
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - regulationType
              - subjectType
              - subjectIds
              properties:
                regulationType:
                  type: string
                  description: The type of regulation request.
                  enum:
                  - DELETE_INTERNAL
                  - DELETE_ONLY
                  - SUPPRESS_AND_DELETE
                  - SUPPRESS_ONLY
                  - UNSUPPRESS
                subjectType:
                  type: string
                  description: The type of subject being regulated.
                  enum:
                  - OBJECT_ID
                  - USER_ID
                subjectIds:
                  type: array
                  description: The IDs of the subjects to regulate.
                  items:
                    type: string
      responses:
        '200':
          description: Regulation created successfully.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      regulateId:
                        type: string
                        description: The ID of the regulation request.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
components:
  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
    Regulation:
      type: object
      properties:
        id:
          type: string
          description: The unique identifier of the regulation request.
        workspaceId:
          type: string
          description: The workspace ID this regulation belongs to.
        overallStatus:
          type: string
          description: The overall status of the regulation request.
          enum:
          - FAILED
          - FINISHED
          - INITIALIZED
          - INVALID
          - NOT_SUPPORTED
          - PARTIAL_SUCCESS
          - RUNNING
        regulateType:
          type: string
          description: The type of regulation.
          enum:
          - DELETE_INTERNAL
          - DELETE_ONLY
          - SUPPRESS_AND_DELETE
          - SUPPRESS_ONLY
          - UNSUPPRESS
        subjectType:
          type: string
          description: The type of subject regulated.
          enum:
          - OBJECT_ID
          - USER_ID
        createdAt:
          type: string
          format: date-time
          description: When the regulation was created.
    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.
  parameters:
    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
    PaginationCount:
      name: pagination[count]
      in: query
      description: Number of items to return per page.
      schema:
        type: integer
        minimum: 1
        maximum: 200
        default: 10
  responses:
    Unauthorized:
      description: Authentication credentials were missing or invalid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    BadRequest:
      description: The request was invalid or malformed.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  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.
externalDocs:
  description: Segment Config API Documentation
  url: https://segment.com/docs/api/config-api/