{ "opencollection": "1.0.0", "info": { "name": "Knock Audiences Accounts Workflows API", "version": "1.0" }, "request": { "auth": { "type": "bearer", "token": "{{bearerToken}}" } }, "items": [ { "info": { "name": "Workflows", "type": "folder" }, "items": [ { "info": { "name": "Validate a workflow", "type": "http" }, "http": { "method": "PUT", "url": "https://api.knock.app/v1/workflows/:workflow_key/validate", "params": [ { "name": "workflow_key", "value": "", "type": "path", "description": "The key of the workflow." }, { "name": "environment", "value": "", "type": "query", "description": "The environment slug." }, { "name": "branch", "value": "", "type": "query", "description": "The slug of a branch to use. This option can only be used when `environment` is `\"development\"`." } ], "body": { "type": "json", "data": "{}" } }, "docs": "Validates a workflow payload without persisting it. Some read-only fields will be empty as they are generated by the system when persisted.\n\nNote: Validating a workflow is only done in the development environment context.\n" }, { "info": { "name": "Run a workflow", "type": "http" }, "http": { "method": "PUT", "url": "https://api.knock.app/v1/workflows/:workflow_key/run", "params": [ { "name": "workflow_key", "value": "", "type": "path", "description": "The key of the workflow." }, { "name": "environment", "value": "", "type": "query", "description": "The environment slug." }, { "name": "branch", "value": "", "type": "query", "description": "The slug of a branch to use. This option can only be used when `environment` is `\"development\"`." } ], "body": { "type": "json", "data": "{}" } }, "docs": "Runs the latest version of a committed workflow in a given environment using the params provided." }, { "info": { "name": "Preview a workflow template", "type": "http" }, "http": { "method": "POST", "url": "https://api.knock.app/v1/workflows/:workflow_key/steps/:step_ref/preview_template", "params": [ { "name": "workflow_key", "value": "", "type": "path", "description": "The key of the workflow." }, { "name": "step_ref", "value": "", "type": "path", "description": "The reference key of the channel step in the workflow to preview." }, { "name": "environment", "value": "", "type": "query", "description": "The environment slug." }, { "name": "branch", "value": "", "type": "query", "description": "The slug of a branch to use. This option can only be used when `environment` is `\"development\"`." } ], "body": { "type": "json", "data": "{}" } }, "docs": "Generates a rendered template for a given channel step in a workflow." }, { "info": { "name": "List workflows", "type": "http" }, "http": { "method": "GET", "url": "https://api.knock.app/v1/workflows", "params": [ { "name": "environment", "value": "", "type": "query", "description": "The environment slug." }, { "name": "branch", "value": "", "type": "query", "description": "The slug of a branch to use. This option can only be used when `environment` is `\"development\"`." }, { "name": "after", "value": "", "type": "query", "description": "The cursor to fetch entries after." }, { "name": "before", "value": "", "type": "query", "description": "The cursor to fetch entries before." }, { "name": "limit", "value": "", "type": "query", "description": "The number of entries to fetch per-page." }, { "name": "annotate", "value": "", "type": "query", "description": "Whether to annotate the resource. Only used in the Knock CLI." }, { "name": "hide_uncommitted_changes", "value": "", "type": "query", "description": "Whether to hide uncommitted changes. When true, only committed changes will be returned. When false, both committed and uncommitted changes will be returned." } ] }, "docs": "Returns a paginated list of workflows available in a given environment. The workflows are returned alphabetically by `key`." }, { "info": { "name": "Activate a workflow", "type": "http" }, "http": { "method": "PUT", "url": "https://api.knock.app/v1/workflows/:workflow_key/activate", "params": [ { "name": "workflow_key", "value": "", "type": "path", "description": "The key of the workflow." }, { "name": "environment", "value": "", "type": "query", "description": "The environment slug." }, { "name": "branch", "value": "", "type": "query", "description": "The slug of a branch to use. This option can only be used when `environment` is `\"development\"`." } ], "body": { "type": "json", "data": "{}" } }, "docs": "Activates (or deactivates) a workflow in a given environment. Read more in the [docs](https://docs.knock.app/concepts/workflows#workflow-status).\n\nNote: This immediately enables or disables a workflow in a given environment without needing to go through environment promotion.\n" }, { "info": { "name": "Get a workflow", "type": "http" }, "http": { "method": "GET", "url": "https://api.knock.app/v1/workflows/:workflow_key", "params": [ { "name": "workflow_key", "value": "", "type": "path", "description": "The key of the workflow to retrieve." }, { "name": "environment", "value": "", "type": "query", "description": "The environment slug." }, { "name": "branch", "value": "", "type": "query", "description": "The slug of a branch to use. This option can only be used when `environment` is `\"development\"`." }, { "name": "annotate", "value": "", "type": "query", "description": "Whether to annotate the resource. Only used in the Knock CLI." }, { "name": "hide_uncommitted_changes", "value": "", "type": "query", "description": "Whether to hide uncommitted changes. When true, only committed changes will be returned. When false, both committed and uncommitted changes will be returned." } ] }, "docs": "Retrieve a workflow by its key in a given environment." }, { "info": { "name": "Upsert a workflow", "type": "http" }, "http": { "method": "PUT", "url": "https://api.knock.app/v1/workflows/:workflow_key", "params": [ { "name": "workflow_key", "value": "", "type": "path", "description": "The key of the workflow." }, { "name": "environment", "value": "", "type": "query", "description": "The environment slug." }, { "name": "branch", "value": "", "type": "query", "description": "The slug of a branch to use. This option can only be used when `environment` is `\"development\"`." }, { "name": "annotate", "value": "", "type": "query", "description": "Whether to annotate the resource. Only used in the Knock CLI." }, { "name": "force", "value": "", "type": "query", "description": "When set to true, forces the upsert to override existing content regardless of environment restrictions. This bypasses the development-only environment check and origin environment checks." }, { "name": "commit", "value": "", "type": "query", "description": "Whether to commit the resource at the same time as modifying it." }, { "name": "commit_message", "value": "", "type": "query", "description": "The message to commit the resource with, only used if `commit` is `true`." } ], "body": { "type": "json", "data": "{}" } }, "docs": "Updates a workflow of a given key, or creates a new one if it does not yet exist.\n\nNote: this endpoint only operates on workflows in the `development` environment.\n" }, { "info": { "name": "Trigger workflow", "type": "http" }, "http": { "method": "POST", "url": "https://api.knock.app/v1/workflows/:key/trigger", "params": [ { "name": "key", "value": "", "type": "path", "description": "Key of the workflow to trigger." } ], "body": { "type": "json", "data": "{}" } }, "docs": "Trigger a workflow (specified by the key) to run for the given recipients, using the parameters provided. Returns an identifier for the workflow run request. All workflow runs are executed asynchronously. This endpoint also handles [inline identifications](/managing-recipients/identifying-recipients#inline-identifying-recipients) for the `actor`, `recipient`, and `tenant` fields." }, { "info": { "name": "Cancel workflow", "type": "http" }, "http": { "method": "POST", "url": "https://api.knock.app/v1/workflows/:key/cancel", "params": [ { "name": "key", "value": "", "type": "path", "description": "The key of the workflow to cancel." } ], "body": { "type": "json", "data": "{}" } }, "docs": "When invoked for a workflow using a specific workflow key and cancellation key, will cancel any queued workflow runs associated with that key/cancellation key pair. Can optionally be provided one or more recipients to scope the request to." } ] } ], "bundled": true }