Goals mAPI reference
Complete reference documentation for the Goals resource.
Goals
#A goal defines an event condition that Knock tracks and attributes to the workflows, guides, and broadcasts that drove it.
You can retrieve, update, create, validate, clone, and archive goals, as well as list all goals in a given environment. Goals are identified by their unique goal key.
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.
Archive a goal
#Archives a given goal across all environments. Refuses if any workflow, guide, or broadcast is attached to the goal.
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).
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).
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.
GoalRequest
#A goal payload for upsert or validate.
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.
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.
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).