Goals mAPI reference
Complete reference documentation for the Goals resource.
Goals
#Goals are measurable outcomes you define in Knock and attach to workflows, broadcasts, and guides for completion and attribution tracking. Goal upserts publish immediately and do not accept a commit parameter. Clone a goal to copy it into another environment; goals are not promotable.
Archive a goal
#Archives a given goal across all environments.
Endpoint
Path parameters
The key of the goal to archive.
Query parameters
The environment slug.
Returns
The response from archiving a goal.
The result of the archive operation.
Get a goal
#Retrieve a goal by its key in a given environment.
Endpoint
Path parameters
The key of the goal to retrieve.
Query parameters
The environment slug.
The slug of a branch to use. This option can only be used when environment is "development".
Whether to annotate the resource. Only used in the Knock CLI.
Returns
A goal defines an event condition that is tracked and attributed to messaging resources.
A goal condition consisting of a polymorphic event and optional match conditions.
The event to track. Supports recipient, integration_source, and audience event types.
A list of condition groups. Required for recipient events; each group uses an operator (and/or) with nested conditions.
The timestamp of when the goal was created. (read-only).
An optional description for the goal. Maximum of 280 characters allowed.
The slug of the environment in which the goal exists. (read-only).
The unique key string for the goal. Must be at minimum 1 character and at maximum 255 characters in length.
A name for the goal. Must be at minimum 1 character and at maximum 255 characters in length.
The SHA hash of the goal data. (read-only).
The timestamp of when the goal was last updated. (read-only).
Upsert a goal
#Updates a goal of a given key, or creates a new one if it does not yet exist. The goal is published immediately; this endpoint does not accept a commit parameter.
Endpoint
Path parameters
The key of the goal to upsert.
Query parameters
The environment slug.
Whether to annotate the resource. Only used in the Knock CLI.
Request body
A goal payload for upsert or validate.
A goal condition consisting of a polymorphic event and optional match conditions.
The event to track. Supports recipient, integration_source, and audience event types.
A list of condition groups. Required for recipient events; each group uses an operator (and/or) with nested conditions.
An optional description for the goal. Maximum of 280 characters allowed.
A name for the goal. Must be at minimum 1 character and at maximum 255 characters in length.
Returns
Wraps the Goal response under the goal key.
A goal defines an event condition that is tracked and attributed to messaging resources.
A goal condition consisting of a polymorphic event and optional match conditions.
The event to track. Supports recipient, integration_source, and audience event types.
A list of condition groups. Required for recipient events; each group uses an operator (and/or) with nested conditions.
The timestamp of when the goal was created. (read-only).
An optional description for the goal. Maximum of 280 characters allowed.
The slug of the environment in which the goal exists. (read-only).
The unique key string for the goal. Must be at minimum 1 character and at maximum 255 characters in length.
A name for the goal. Must be at minimum 1 character and at maximum 255 characters in length.
The SHA hash of the goal data. (read-only).
The timestamp of when the goal was last updated. (read-only).
Validate a goal
#Validates a goal payload without persisting it.
Endpoint
Path parameters
The key of the goal to validate.
Query parameters
The environment slug.
The slug of a branch to use. This option can only be used when environment is "development".
Request body
A goal payload for upsert or validate.
A goal condition consisting of a polymorphic event and optional match conditions.
The event to track. Supports recipient, integration_source, and audience event types.
A list of condition groups. Required for recipient events; each group uses an operator (and/or) with nested conditions.
An optional description for the goal. Maximum of 280 characters allowed.
A name for the goal. Must be at minimum 1 character and at maximum 255 characters in length.
Returns
Wraps the Goal response under the goal key.
A goal defines an event condition that is tracked and attributed to messaging resources.
A goal condition consisting of a polymorphic event and optional match conditions.
The event to track. Supports recipient, integration_source, and audience event types.
A list of condition groups. Required for recipient events; each group uses an operator (and/or) with nested conditions.
The timestamp of when the goal was created. (read-only).
An optional description for the goal. Maximum of 280 characters allowed.
The slug of the environment in which the goal exists. (read-only).
The unique key string for the goal. Must be at minimum 1 character and at maximum 255 characters in length.
A name for the goal. Must be at minimum 1 character and at maximum 255 characters in length.
The SHA hash of the goal data. (read-only).
The timestamp of when the goal was last updated. (read-only).
List goals
#Returns a paginated list of goals for the given environment.
Endpoint
Query parameters
The environment slug.
The slug of a branch to use. This option can only be used when environment is "development".
The cursor to fetch entries after.
The cursor to fetch entries before.
The number of entries to fetch per-page.
Whether to annotate the resource. Only used in the Knock CLI.
Returns
A paginated list of Goal. Contains a list of entries and page information.
A list of entries.
A goal condition consisting of a polymorphic event and optional match conditions.
The event to track. Supports recipient, integration_source, and audience event types.
A list of condition groups. Required for recipient events; each group uses an operator (and/or) with nested conditions.
The timestamp of when the goal was created. (read-only).
An optional description for the goal. Maximum of 280 characters allowed.
The slug of the environment in which the goal exists. (read-only).
The unique key string for the goal. Must be at minimum 1 character and at maximum 255 characters in length.
A name for the goal. Must be at minimum 1 character and at maximum 255 characters in length.
The SHA hash of the goal data. (read-only).
The timestamp of when the goal was last updated. (read-only).
The information about a paginated result.
The cursor to fetch entries after. Will only be present if there are more entries to fetch.
The cursor to fetch entries before. Will only be present if there are more entries to fetch before the current page.
The number of entries to fetch per-page.
Clone a goal
#Clones a goal into a destination environment.
Endpoint
Path parameters
The key of the source goal to clone.
Query parameters
The environment slug.
Request body
The destination key, name, and environment for the cloned goal.
The destination environment slug.
The key for the cloned goal.
The name for the cloned goal.
Returns
Wraps the Goal response under the goal key.
A goal defines an event condition that is tracked and attributed to messaging resources.
A goal condition consisting of a polymorphic event and optional match conditions.
The event to track. Supports recipient, integration_source, and audience event types.
A list of condition groups. Required for recipient events; each group uses an operator (and/or) with nested conditions.
The timestamp of when the goal was created. (read-only).
An optional description for the goal. Maximum of 280 characters allowed.
The slug of the environment in which the goal exists. (read-only).
The unique key string for the goal. Must be at minimum 1 character and at maximum 255 characters in length.
A name for the goal. Must be at minimum 1 character and at maximum 255 characters in length.
The SHA hash of the goal data. (read-only).
The timestamp of when the goal was last updated. (read-only).
Goal
#A goal defines an event condition that is tracked and attributed to messaging resources.
Attributes
A goal condition consisting of a polymorphic event and optional match conditions.
The event to track. Supports recipient, integration_source, and audience event types.
A list of condition groups. Required for recipient events; each group uses an operator (and/or) with nested conditions.
The timestamp of when the goal was created. (read-only).
An optional description for the goal. Maximum of 280 characters allowed.
The slug of the environment in which the goal exists. (read-only).
The unique key string for the goal. Must be at minimum 1 character and at maximum 255 characters in length.
A name for the goal. Must be at minimum 1 character and at maximum 255 characters in length.
The SHA hash of the goal data. (read-only).
The timestamp of when the goal was last updated. (read-only).
GoalCondition
#A goal condition consisting of a polymorphic event and optional match conditions.
Attributes
The event to track. Supports recipient, integration_source, and audience event types.
A list of condition groups. Required for recipient events; each group uses an operator (and/or) with nested conditions.
GoalAttachment
#Attaches a goal to a workflow, guide, or broadcast for attribution tracking.
Attributes
The number of days to attribute conversions after the notification is sent. Must be between 1 and 30. Defaults to 7.
The key of the goal to attach.
CloneGoalRequest
#The destination key, name, and environment for the cloned goal.
Attributes
The destination environment slug.
The key for the cloned goal.
The name for the cloned goal.