Modify a custom activity definition (modify)
The modify Ortto endpoint of the activity entity is used to modify one custom activity definition in Ortto’s customer data platform (CDP).
NOTE: The amount of custom activities you can create depends on your Ortto plan.
This page provides descriptions of this endpoint’s:
- the response payload.
HTTP method and request resources
PUT https://api.ap3api.com/v1/definitions/activity/modifyNOTE: Ortto customers who have their instance region set to Australia or Europe will need to use specific service endpoints relative to the region:
Australia: https://api.au.ap3api.com/ Europe: https://api.eu.ap3api.com/For example: https://api.eu.ap3api.com/v1/<entity/endpoint>
All other Ortto users will use the default service endpoint (https://api.ap3api.com/).
Path and query parameters
This endpoint takes no additional path and/or query parameters.
Headers
This endpoint requires a custom API key and content type (
application/jsonfor the request body) in the header of the request:
X-Api-Key: CUSTOM-PRIVATE-API-KEYContent-Type: application/jsonRequest body
The request body consists of a JSON object with the valid elements listed in the table below.
The following JSON objects are examples of requests to create custom fields in your Ortto account’s CDP.
NOTE: Duplicate
namevalues are not allowed.Example modify custom activity definition request body
json
{ "name": "act1", "activity_field_id": "act:cm:act1", "state": "live", "icon_id": "happy-illustration-icon", "track_conversion_value": false, "touch": false, "filterable": true, "visible_in_feeds": false, "display_style": { "type": "activity_attribute", "title": "", "attribute_name": "attr1", "attribute_field_id": "str:cm:attr1" }, "attributes": [ { "name": "attr1", "display_type": "text" }, { "name": "attr2", "display_type": "integer", "field_id": "" }, { "name": "attr3", "display_type": "single_select", "field_id": "do-not-map" }, { "name": "attr4", "display_type": "single_select", "field_id": "str:cm:cfieldsin" }, { "name": "attr5", "display_type": "text", "field_id": "str::first" } ] }Valid request body elements
The following table lists all valid request body elements (arrays, objects, or fields), which are available to this endpoint.
Element
Type
Description
name
stringThe
namefor the custom field specified in the request body.
icon_id
stringThe ID for the icon shown against the activity in the Ortto app. You can find a list of icons and their ID values in the table under Activity icons.
track_conversion_value
booleanIf
true, the activity can be assigned a conversion value to be considered as the value attributed to the activity. Iffalse, conversion value is not enabled.
touch
booleanIf
true, this will update thefirst seenandlast seenvalues for the person associated with the activity. Learn more about track as touch. Iffalse, touch is not enabled.
filterable
booleanIf
true, this will allow users to create filters and generate reports using the activity. Otherwise,false.
visible_in_fields
booleanIf
true, the activity will be displayed in feeds throughout the app (such as in the Activities feed in a person’s view). Otherwise,false.
display_style
arrayof strings
display_styledetermines how the activity value displays in activity feeds.The activity can just display as-is (e.g. Placed order), with an attribute (e.g. Placed order #123), or with a custom code (e.g. Placed order #123 for $45,678).
The
display_styleis specified attype.typecan be:*
activity(activity only)*
activity_attribute(activity and attribute)*
activity_template(custom code)If using
activity_templateyou need to specify atitle, which is the value you wish to use as your custom activity output, such as one of the activity attributes. This value needs to be specified as a variable, e.g.title: "Placed order {{attribute.order_id}} for {{attribute.value}}"(whereorder_idandvalueare the attribute names).
type
string
title
string
attribute_name
stringThe attribute to be included in the activity event output (where
typeis set toactivity_attribute).
attribute_field_id
stringThe field ID for the custom activity attribute. (Note this is independent of person field IDs.)
attributes
arrayof objectsThe names, types and IDs of the activity’s attributes.
name
stringThe activity attribute name.
display_type
stringThe attribute’s field type. Learn more about the available types and their descriptions under Attributes in the Custom activities guide.
Display types can be set as follows:
"display_type": "email""display_type": "text""display_type": "large_text""display_type": "integer"“display_type": "decimal""display_type": "currency""display_type": "date""display_type": "time""display_type": "bool""display_type": "phone"“display_type": "single_select""display_type": "multi_select""display_type": "link""display_type": "object"
field_id
string
field_idis optional if the attribute is not mapped to a CDP field.Values can be:
empty (e.g."") — this will result in an attribute with no value,do-not-map— the attribute is not mapped to a custom or system CDP field, or a field ID, e.g.str::first— this specifies the CDP field ID to populate as the attribute value. In this example,str::firstwould populate the attribute value with the first name of the person who performed the activity.Activity icons
The following table details the icons for activity definitions.
Icon
Icon ID
calendar-illustration-icon
caution-illustration-icon
clicked-illustration-icon
coupon-illustration-icon
download-illustration-icon
email-illustration-icon
eye-illustration-icon
flag-activities-illustration-icon
happy-illustration-icon
moneys-illustration-icon
page-illustration-icon
phone-illustration-icon
reload-illustration-icon
tag-illustration-icon
time-illustration-icon
Response payload
The response payload consists of a JSON object with the elements listed in the table below.
The following JSON object is an example of people’s data that Ortto retrieves from your Ortto account’s CDP after a request to this endpoint.
Example create custom activity definition response payload from Ortto’s CDP
json
{ "custom_activity": { "name": "act1", "activity_field_id": "act:cm:act1", "state": "live", "display_mode": { "type": "activity_attribute", "attribute_name": "attr1", "attribute_field_id": "str:cm:attr1" }, "attributes": [ { "name": "attr1", "field_id": "str:cm:attr1", "cdp_field_id": "str:cm:attr1", "display_type": "text", "liquid_name": "activity.custom.act1.attr1" }, { "name": "attr2", "field_id": "int:cm:attr2", "display_type": "integer", "liquid_name": "activity.custom.act1.attr2" }, { "name": "attr3", "field_id": "str:cm:attr3", "display_type": "single_select", "liquid_name": "activity.custom.act1.attr3" }, { "name": "attr4", "field_id": "str:cm:attr4", "display_type": "single_select", "liquid_name": "activity.custom.act1.attr4" }, { "name": "attr5", "field_id": "str:cm:attr5", "cdp_field_id": "str::first", "display_type": "text", "liquid_name": "activity.custom.act1.attr5" } ], "icon_id": "happy-illustration-icon", "track_conversion_value": false, "touch": false, "filterable": true, "visible_in_feeds": false, "created_by": "", "created_at": "0001-01-01T00:00:00Z", "edited_at": "2022-08-31T05:27:33.321213397Z" } }Response payload elements
The following table lists all elements (arrays, objects, or fields) in the response from a request to this endpoint.
Element
Type
Description
custom_activity
arrayof stringsThe
custom_activityarray consists of the activity definition data.
name
stringThe name of the custom activity.
activity_field_id
stringThe field ID for the custom activity. Learn more about Ortto’s field ID format in person fields.
state
stringIdentifies the status of the custom activity. Once created, the custom activity will remain at
awaiting_implementation(seen asSetupin the app) until the first event for that activity has occurred (such as via thev1/activities/createendpoint described in the Custom activities guide), then will move tolive.
display_mode
stringThe activity design (determined as
display_stylein the request body).
type
stringThe activity display type, e.g. activity and attribute.
attribute_field_id
stringThe field ID of the attribute to be included in the activity event output (set at
type).
attributes
arrayof objectsThe
attributesarray consists of an array of objects, where each object contains data for the custom activity attributes.
name
stringThe attribute name.
field_id
stringThe field ID for the custom activity attribute.
cdp_field_id
stringThe ID for CDP field the the custom activity attribute is mapped to.
display_type
stringThe attribute’s field type. Learn more about the available types and their descriptions under Attributes in the Custom activities guide.
liquid_name
stringThe Liquid syntax for the custom activity attribute.
icon_id
stringThe ID for the icon shown against the activity in the Ortto app.
track_conversion_value
booleanIf
true, the activity can be assigned a conversion value to be considered as the value attributed to the activity. Iffalse, conversion value is not enabled.
touch
booleanIf
true, this will update thefirst seenandlast seenvalues for the person associated with the activity. Learn more about track as touch. Iffalse, touch is not enabled.
filterable
booleanIf
true, this will allow users to create filters and generate reports using the activity. Otherwise,false.
visible_in_feeds
booleanIf
true, the activity will be displayed in feeds throughout the app (such as in the Activities feed in a person’s view). Otherwise,false.
created_by
stringHow the custom activity definition was created.
created_at
stringThe date and time the custom activity definition was created. Format is ISO 8601.
edited_at
stringThe date and time the custom activity definition was edited. Format is ISO 8601.