Marketo Segments API

Segment Controller

OpenAPI Specification

marketo-segments-api-openapi.yml Raw ↑
openapi: 3.0.1
info:
  title: Marketo Engage Rest Approve Segments API
  description: Marketo exposes a REST API which allows for remote execution of many of the systems capabilities. From creating programs to bulk lead import, there are many options which allow fine-grained control of a Marketo instance.
  termsOfService: https://www.adobe.com/legal.html
  contact:
    name: Adobe Developer Relations
    url: https://experienceleague.adobe.com/en/docs/marketo-developer/marketo/home
    email: developerfeedback@marketo.com
  license:
    name: API License Agreement
    url: https://experienceleague.adobe.com/en/docs/marketo-developer/marketo/api-license
  version: '1.0'
servers:
- url: https://localhost:8080/
tags:
- name: Segments
  description: Segment Controller
paths:
  /rest/asset/v1/segmentation.json:
    get:
      tags:
      - Segments
      summary: Marketo Get Segmentations
      description: 'Retrieves a list of accessible segmentations for the target instance. Required Permissions: Read-Only Assets, Read-Write Assets'
      operationId: getSegmentationUsingGET
      parameters:
      - name: status
        in: query
        description: Status filter for draft or approved versions
        schema:
          type: string
          enum:
          - approved
          - draft
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResponseOfSegmentationResponse'
  /rest/asset/v1/segmentation/{id}/segments.json:
    get:
      tags:
      - Segments
      summary: Marketo Get Segments For Segmentation
      description: 'Retrieves a list of segments inside the target segmentation. Required Permissions: Read-Only Assets, Read-Write Assets'
      operationId: getSegmentsForSegmentationUsingGET
      parameters:
      - name: id
        in: path
        description: id
        required: true
        schema:
          type: integer
          format: int32
      - name: status
        in: query
        description: Status filter for draft or approved versions
        schema:
          type: string
          enum:
          - approved
          - draft
      - name: offset
        in: query
        description: Integer offset for paging
        schema:
          type: integer
          format: int32
      - name: maxReturn
        in: query
        description: Maximum number of channels to return. Max 200, default 20
        schema:
          type: integer
          format: int32
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResponseOfSegmentsResponse'
  /rest/asset/v1/snippet/{id}/dynamicContent/{segmentId}.json:
    post:
      tags:
      - Segments
      summary: Marketo Update Snippet Dynamic Content
      description: 'Updates the target dynamic content section. Required Permissions: Read-Write Assets'
      operationId: updateDynamicContentUsingPOST
      parameters:
      - name: id
        in: path
        description: id
        required: true
        schema:
          type: integer
          format: int32
      - name: segmentId
        in: path
        description: segmentId
        required: true
        schema:
          type: integer
          format: int32
      requestBody:
        description: request
        content:
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/UpdateSnippetDynamicContentRequest'
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResponseOfIdResponse'
      x-codegen-request-body-name: request
components:
  schemas:
    UpdateSnippetDynamicContentRequest:
      type: object
      properties:
        type:
          type: string
          description: Type of dynamic content section
          enum:
          - Typeofcontent.Either'HTML'or'Text'
        value:
          type: string
          description: Value of the dynamic content section
    Folder:
      required:
      - id
      - type
      type: object
      properties:
        id:
          type: integer
          description: Id of the folder
          format: int32
        type:
          type: string
          description: Type of folder
          enum:
          - Folder
          - Program
      description: JSON representation of a folder
    ResponseOfSegmentsResponse:
      type: object
      properties:
        errors:
          type: array
          items:
            $ref: '#/components/schemas/Error'
        requestId:
          type: string
        result:
          type: array
          items:
            $ref: '#/components/schemas/SegmentsResponse'
        success:
          type: boolean
        warnings:
          type: array
          items:
            type: string
    SegmentationResponse:
      required:
      - folder
      - status
      type: object
      properties:
        createdAt:
          type: string
          description: Datetime the asset was created
          format: date-time
        description:
          type: string
          description: Description of the asset
        folder:
          $ref: '#/components/schemas/Folder'
        id:
          type: integer
          description: Id of the asset
          format: int64
        name:
          type: string
          description: Name of the asset
        status:
          type: string
          description: Status filter for draft or approved versions
        updatedAt:
          type: string
          description: Datetime the asset was most recently updated
          format: date-time
        url:
          type: string
          description: Url of the asset in the Marketo UI
        workspace:
          type: string
          description: Name of the workspace
    ResponseOfSegmentationResponse:
      type: object
      properties:
        errors:
          type: array
          items:
            $ref: '#/components/schemas/Error'
        requestId:
          type: string
        result:
          type: array
          items:
            $ref: '#/components/schemas/SegmentationResponse'
        success:
          type: boolean
        warnings:
          type: array
          items:
            type: string
    ResponseOfIdResponse:
      type: object
      properties:
        errors:
          type: array
          items:
            $ref: '#/components/schemas/Error'
        requestId:
          type: string
        result:
          type: array
          items:
            $ref: '#/components/schemas/IdResponse'
        success:
          type: boolean
        warnings:
          type: array
          items:
            type: string
    IdResponse:
      required:
      - id
      type: object
      properties:
        id:
          type: integer
          description: Id of the asset
          format: int32
    Error:
      required:
      - code
      - message
      type: object
      properties:
        code:
          type: string
          description: Error code of the error. See full list of error codes <a href="https://developers.marketo.com/rest-api/error-codes/">here</a>
        message:
          type: string
          description: Message describing the cause of the error
    SegmentsResponse:
      required:
      - segmentationId
      type: object
      properties:
        createdAt:
          type: string
          description: Datetime the asset was created
          format: date-time
        description:
          type: string
          description: Description of the asset
        id:
          type: integer
          description: Id of the asset
          format: int64
        name:
          type: string
          description: Name of the asset
        segmentationId:
          type: integer
          description: Id of the Segmentation
          format: int32
        updatedAt:
          type: string
          description: Datetime the asset was most recently updated
          format: date-time
        url:
          type: string
          description: Url of the asset in the Marketo UI
x-original-swagger-version: '2.0'