Marketo Campaigns API
The Campaigns API from Marketo — 7 operation(s) for campaigns.
The Campaigns API from Marketo — 7 operation(s) for campaigns.
openapi: 3.0.1
info:
title: Marketo Engage Rest Approve Campaigns 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: Campaigns
paths:
/rest/asset/v1/smartCampaign/{id}.json:
get:
tags:
- Campaigns
summary: Marketo Get Smart Campaign by Id
description: 'Returns the smart campaign for the given id. Required Permissions: Read-Only Assets, Read-Write Assets'
operationId: getSmartCampaignByIdUsingGET
parameters:
- name: id
in: path
description: Id for the smart campaign
required: true
schema:
type: integer
format: int32
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/ResponseOfSmartCampaignResponse'
post:
tags:
- Campaigns
summary: Marketo Update Smart Campaign
description: 'Update the smart campaign for the given id. Required Permissions: Read-Write Assets'
operationId: updateSmartCampaignUsingPOST
parameters:
- name: id
in: path
description: Id for the smart campaign
required: true
schema:
type: integer
format: int32
requestBody:
description: updateSmartCampaignRequest
content:
application/json:
schema:
$ref: '#/components/schemas/UpdateSmartCampaignRequest'
required: true
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/ResponseOfSmartCampaignResponse'
x-codegen-request-body-name: updateSmartCampaignRequest
/rest/asset/v1/smartCampaign/byName.json:
get:
tags:
- Campaigns
summary: Marketo Get Smart Campaign by Name
description: 'Returns the smart campaign for the given name. Required Permissions: Read-Only Assets, Read-Write Assets'
operationId: getSmartCampaignByNameUsingGET
parameters:
- name: name
in: query
description: Name for the smart campaign
required: true
schema:
type: string
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/ResponseOfSmartCampaignResponse'
/rest/asset/v1/smartCampaign/{id}/smartList.json:
get:
tags:
- Campaigns
summary: Marketo Get Smart List by Smart Campaign Id
description: 'Retrieves a Smart List record by its Smart Campaign id. Required Permissions: Read-Asset or Read-Write Asset'
operationId: getSmartListBySmartCampaignIdUsingGET
parameters:
- name: id
in: path
description: Id for the smart campaign containing smart list to retrieve
required: true
schema:
type: integer
format: int64
- name: includeRules
in: query
description: Set true to populate smart list rules. Default false
schema:
type: boolean
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/ResponseOfSmartListResponseWithRules'
/rest/asset/v1/smartCampaign/{id}/activate.json:
post:
tags:
- Campaigns
summary: Marketo Activate Smart Campaign
description: 'Activates a trigger smart campaign. Required Permissions: Activate Campaign'
operationId: activateSmartCampaignUsingPOST
parameters:
- name: id
in: path
description: Id of the smart campaign
required: true
schema:
type: integer
format: int32
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/ResponseOfIdResponse'
/rest/asset/v1/smartCampaign/{id}/deactivate.json:
post:
tags:
- Campaigns
summary: Marketo Deactivate Smart Campaign
description: 'Deactivates a trigger smart campaign. Required Permissions: Deactivate Campaign'
operationId: deactivateSmartCampaignUsingPOST
parameters:
- name: id
in: path
description: Id of the smart campaign
required: true
schema:
type: integer
format: int32
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/ResponseOfIdResponse'
/rest/asset/v1/smartCampaign/{id}/clone.json:
post:
tags:
- Campaigns
summary: Marketo Clone Smart Campaign
description: 'Clones a smart campaign. Required Permissions: Read-Write Assets'
operationId: cloneSmartCampaignUsingPOST
parameters:
- name: id
in: path
description: Id of the smart campaign
required: true
schema:
type: integer
format: int32
requestBody:
description: cloneSmartCampaignRequest
content:
application/x-www-form-urlencoded:
schema:
$ref: '#/components/schemas/CloneSmartCampaignRequest'
required: true
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/ResponseOfSmartCampaignResponse'
x-codegen-request-body-name: cloneSmartCampaignRequest
/rest/asset/v1/smartCampaign/{id}/delete.json:
post:
tags:
- Campaigns
summary: Marketo Delete Smart Campaign
description: 'Deletes a smart campaign. Required Permissions: Read-Write Assets'
operationId: deleteSmartCampaignUsingPOST
parameters:
- name: id
in: path
description: Id of the smart campaign
required: true
schema:
type: integer
format: int32
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/ResponseOfIdResponse'
components:
schemas:
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
SmartListConditions:
required:
- activityAttributeId
- activityAttributeName
- isPrimary
- operator
- values
type: object
properties:
activityAttributeId:
type: integer
description: Id of the activity attribute
format: int32
activityAttributeName:
type: string
description: Name of activity attribute
operator:
type: string
description: Value of operator
values:
type: array
description: List of values
items:
type: string
isPrimary:
type: boolean
description: Whether the condition is primary or not (first condition of the smart list)
description: JSON representation of smart list conditions
ResponseOfSmartCampaignResponse:
type: object
properties:
errors:
type: array
items:
$ref: '#/components/schemas/Error'
requestId:
type: string
result:
type: array
items:
$ref: '#/components/schemas/SmartCampaignResponse'
success:
type: boolean
warnings:
type: array
items:
type: string
CloneSmartCampaignRequest:
required:
- folder
- name
type: object
properties:
description:
type: string
description: Description of the smart campaign
folder:
$ref: '#/components/schemas/Folder'
name:
type: string
description: Name of the smart campaign
UpdateSmartCampaignRequest:
type: object
properties:
description:
type: string
description: Description of the smart campaign
name:
type: string
description: Name of the smart campaign
SmartListRules:
required:
- filterMatchType
- filters
- triggers
type: object
properties:
filterMatchType:
type: string
description: Smart list filter match type (rule logic)
enum:
- All
- Any
- Advanced
triggers:
type: array
description: List of smart list triggers
items:
type: string
filters:
type: array
description: List of smart list filters
items:
$ref: '#/components/schemas/SmartListFilters'
description: JSON representation of smart list rules
SmartListFilters:
required:
- conditions
- id
- name
- operator
- ruleType
- ruleTypeId
type: object
properties:
id:
type: integer
description: Id of the filter
format: int32
name:
type: string
description: Name of filter
ruleTypeId:
type: integer
description: Id of the rule type
format: int32
ruleType:
type: string
description: Name of rule type
operator:
type: string
description: Name of operator
conditions:
type: array
description: List of smart list conditions
items:
$ref: '#/components/schemas/SmartListConditions'
description: JSON representation of smart list filters
SmartListResponseWithRules:
required:
- createdAt
- description
- folder
- id
- name
- updatedAt
- url
- workspace
type: object
properties:
id:
type: integer
description: Id of the smart list
format: int64
name:
type: string
description: Name of the smart list
description:
type: string
description: Description of the smart list
createdAt:
type: string
description: Datetime the smart list was created
format: date-time
updatedAt:
type: string
description: Datetime the smart list was most recently updated
format: date-time
url:
type: string
description: Url of the smart list in the Marketo UI
folder:
$ref: '#/components/schemas/Folder'
workspace:
type: string
description: Name of the workspace
rules:
$ref: '#/components/schemas/SmartListRules'
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
SmartCampaignResponse:
required:
- createdAt
- description
- flowId
- folder
- id
- isActive
- isCommunicationLimitEnabled
- isRequestable
- isSystem
- maxMembers
- name
- qualificationRuleInterval
- qualificationRuleType
- qualificationRuleUnit
- recurrence
- smartListId
- status
- type
- updatedAt
- workspace
type: object
properties:
id:
type: integer
description: Id of the smart campaign (system managed)
format: int32
name:
type: string
description: Name of the smart campaign
description:
type: string
description: Description of the smart campaign
type:
type: string
description: 'Type of the smart campaign. Batch: has at least one filter and no triggers. Trigger: has at least one trigger. Default: has no smart list rules'
enum:
- batch
- default
- trigger
isSystem:
type: boolean
description: Whether smart campaign is system managed. Defaults to false
isActive:
type: boolean
description: Whether smart campaign is active. Defaults to false
isRequestable:
type: boolean
description: Whether smart campaign is requestable (is active and contains 'Campaign is Requested' trigger with Source of 'Web Service API'). Defaults to false
recurrence:
$ref: '#/components/schemas/Recurrence'
qualificationRuleType:
type: string
description: Type of qualification rule. Defaults to 'once'
enum:
- once
- any
- interval
qualificationRuleInterval:
type: integer
description: Interval of qualification rule. Only set when qualificationRuleType is 'interval'
qualificationRuleUnit:
type: string
description: Unit of measure of qualification rule. Only set when qualificationRuleType is 'interval'
enum:
- hour
- day
- week
- month
maxMembers:
type: integer
description: Smart campaign membership limit
format: int32
isCommunicationLimitEnabled:
type: boolean
description: Whether smart campaign communication limit is enabled (i.e. block non-operational emails). Defaults to false
smartListId:
type: integer
description: Id of the smart campaign's child smart list
format: int32
flowId:
type: integer
description: Id of the smart campaign's child flow
format: int32
parentProgramId:
type: integer
description: Parent program Id. Present if smart campaign is under program or nested folder
format: int32
folder:
$ref: '#/components/schemas/Folder'
createdAt:
type: string
description: Datetime when the smart campaign was created
format: date-time
updatedAt:
type: string
description: Datetime when the smart campaign was most recently updated
format: date-time
workspace:
type: string
description: Name of the smart campaign workspace
computedUrl:
type: string
description: URL to asset in Marketo Engage
status:
type: string
description: Status of smart campaign
enum:
- Inactive
- Single Run
- Invalid
- Recurring Run
- Active
- Requested
- Never Run
IdResponse:
required:
- id
type: object
properties:
id:
type: integer
description: Id of the asset
format: int32
Recurrence:
required:
- dayOfMonth
- dayOfWeek
- endAt
- interval
- intervalType
- startAt
- weekOfMonth
- weekdayMask
- weekdayOnly
type: object
properties:
startAt:
type: string
description: Datetime of the first scheduled campaign to run. Required if setting recurrence. Not required to create a smart campaign that has no recurrence
format: date-time
endAt:
type: string
description: Datetime after which no further runs will be automatically scheduled
format: date-time
intervalType:
type: string
description: Recurrence interval. Not required to create a smart campaign that has no recurrence
enum:
- Daily
- Weekly
- Monthly
interval:
type: integer
description: Number of interval units between recurrences
format: int32
weekdayOnly:
type: boolean
description: Only run smart campaign on weekdays. May only be set if intervalType is 'Daily'. Defaults to false
weekdayMask:
type: array
description: String array of empty or one or more of 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'. May only be set if intervalType is 'Weekly'
items:
type: string
dayOfMonth:
type: integer
description: Day of the month to recur. Permissible range 1-31. May only be set if intervalType is 'Monthly' and dayOfWeek and weekOfMonth are unset.
format: int32
dayOfWeek:
type: string
description: Day of the week to recur. May only be set if dayOfMonth is not set, and weekOfMonth is set
format: int32
enum:
- Monday
- Tuesday
- Wednesday
- Thursday
- Friday
- Saturday
- Sunday
weekOfMonth:
type: integer
description: Week of the month to recur. Permissible range 1-4. May only be set if dayOfMonth is not set, and dayOfWeek is set
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
ResponseOfSmartListResponseWithRules:
type: object
properties:
errors:
type: array
items:
$ref: '#/components/schemas/Error'
requestId:
type: string
result:
type: array
items:
$ref: '#/components/schemas/SmartListResponseWithRules'
success:
type: boolean
warnings:
type: array
items:
type: string
x-original-swagger-version: '2.0'