Docs
/
/

reusable_requests mAPI reference

Complete reference documentation for the reusable_requests resource.

Validate a reusable request

#

Validates a reusable request payload without persisting it.

Validation uses the environment in the request. Accounts that allow writes in every environment can validate in that environment. When writes are limited to development, this endpoint accepts the development environment.

Endpoint

PUT/v1/reusable_requests/{reusable_request_key}/validate

Path parameters

reusable_request_key
string

The key of the reusable request to validate.

Query parameters

environment
string

The environment slug. When omitted, the account's default environment is used.

branch
string

The slug of a branch to use. When environment is omitted, the branch is resolved from Development after the account default is injected. When environment is supplied, it must be "development".

Request body

reusable_request

A reusable request object with attributes to update or create a reusable request.

conditions

Conditions that must be met before the request runs.

description
string

An internal note about the reusable request.

name
string

A name for the reusable request.

settingsRequired

The HTTP request a reusable request runs.

body
string

The body of the request. Only used for POST or PUT requests.

data_input_schema
object(any)

A JSON schema for inputs the request accepts.

data_input_values_str
string

A JSON string of input values for the request.

headers
2 possible types

The headers of the request. Can be a template string or a list of key-value pairs.

method
enum(string)
Required

The HTTP method of the request.

getpostputdeletepatch
query_params
2 possible types

The query params of the request. Can be a template string or a list of key-value pairs.

response_path
string

A JSON path into the response that is merged into the workflow data.

signing_key
string

The signing key used to sign the request.

url
string

The URL of the request.

type
enum(string)
Required

The reusable request type. Only http_fetch is supported.

http_fetch

Returns

WrappedReusableRequestResponse

Wraps the ReusableRequest response under the reusable_request key.

reusable_request

A reusable HTTP request that workflows can link to.

conditions

Conditions that must be met before the request runs.

created_at
string(date-time)

The timestamp of when the reusable request was created.

description
string

An internal note about the reusable request.

environment
string

The slug of the environment in which the reusable request exists.

key
string

The unique key for the reusable request. Must be 3 to 255 characters and match ^[a-z0-9_-]+$.

name
string

A name for the reusable request.

The HTTP request a reusable request runs.

body
string

The body of the request. Only used for POST or PUT requests.

data_input_schema
object(any)

A JSON schema for inputs the request accepts.

data_input_values_str
string

A JSON string of input values for the request.

headers
2 possible types

The headers of the request. Can be a template string or a list of key-value pairs.

method
enum(string)
Required

The HTTP method of the request.

getpostputdeletepatch
query_params
2 possible types

The query params of the request. Can be a template string or a list of key-value pairs.

response_path
string

A JSON path into the response that is merged into the workflow data.

signing_key
string

The signing key used to sign the request.

url
string

The URL of the request.

sha
string

The SHA hash of the reusable request.

type
enum(string)

The reusable request type. Only http_fetch is supported.

http_fetch
updated_at
string(date-time)

The timestamp of when the reusable request was last updated.

List reusable requests

#

Returns a paginated list of reusable requests for an environment.

Endpoint

GET/v1/reusable_requests

Query parameters

environment
string

The environment slug. When omitted, the account's default environment is used.

branch
string

The slug of a branch to use. When environment is omitted, the branch is resolved from Development after the account default is injected. When environment is supplied, it must be "development".

annotate
boolean

Whether to annotate the resource. Only used in the Knock CLI.

hide_uncommitted_changes
boolean

Whether to hide uncommitted changes. When true, only committed changes will be returned. When false, both committed and uncommitted changes will be returned.

after
string

The cursor to fetch entries after.

before
string

The cursor to fetch entries before.

limit
integer

The number of entries to fetch per-page.

Returns

PaginatedReusableRequestResponse

A paginated list of ReusableRequest. Contains a list of entries and page information.

A list of entries.

conditions

Conditions that must be met before the request runs.

created_at
string(date-time)
Required

The timestamp of when the reusable request was created.

description
string

An internal note about the reusable request.

environment
string
Required

The slug of the environment in which the reusable request exists.

key
string
Required

The unique key for the reusable request. Must be 3 to 255 characters and match ^[a-z0-9_-]+$.

name
string

A name for the reusable request.

settingsRequired

The HTTP request a reusable request runs.

body
string

The body of the request. Only used for POST or PUT requests.

data_input_schema
object(any)

A JSON schema for inputs the request accepts.

data_input_values_str
string

A JSON string of input values for the request.

headers
2 possible types

The headers of the request. Can be a template string or a list of key-value pairs.

method
enum(string)
Required

The HTTP method of the request.

getpostputdeletepatch
query_params
2 possible types

The query params of the request. Can be a template string or a list of key-value pairs.

response_path
string

A JSON path into the response that is merged into the workflow data.

signing_key
string

The signing key used to sign the request.

url
string

The URL of the request.

sha
string

The SHA hash of the reusable request.

type
enum(string)
Required

The reusable request type. Only http_fetch is supported.

http_fetch
updated_at
string(date-time)
Required

The timestamp of when the reusable request was last updated.

page_info

The information about a paginated result.

after
string

The cursor to fetch entries after. Will only be present if there are more entries to fetch.

before
string

The cursor to fetch entries before. Will only be present if there are more entries to fetch before the current page.

page_size
integer

The number of entries to fetch per-page.

Archive a reusable request

#

Archives a reusable request by key across all environments.

Endpoint

DELETE/v1/reusable_requests/{reusable_request_key}

Path parameters

reusable_request_key
string

The key of the reusable request to archive.

Query parameters

environment
string

The environment slug. When omitted, the account's default environment is used.

Returns

ArchiveReusableRequestResponse

The response from archiving a reusable request.

result
string

The result of the archive operation.

Get a reusable request

#

Retrieves a reusable request by its key.

Endpoint

GET/v1/reusable_requests/{reusable_request_key}

Path parameters

reusable_request_key
string

The key of the reusable request to retrieve.

Query parameters

environment
string

The environment slug. When omitted, the account's default environment is used.

branch
string

The slug of a branch to use. When environment is omitted, the branch is resolved from Development after the account default is injected. When environment is supplied, it must be "development".

annotate
boolean

Whether to annotate the resource. Only used in the Knock CLI.

hide_uncommitted_changes
boolean

Whether to hide uncommitted changes. When true, only committed changes will be returned. When false, both committed and uncommitted changes will be returned.

Returns

A reusable HTTP request that workflows can link to.

conditions

Conditions that must be met before the request runs.

created_at
string(date-time)

The timestamp of when the reusable request was created.

description
string

An internal note about the reusable request.

environment
string

The slug of the environment in which the reusable request exists.

key
string

The unique key for the reusable request. Must be 3 to 255 characters and match ^[a-z0-9_-]+$.

name
string

A name for the reusable request.

The HTTP request a reusable request runs.

body
string

The body of the request. Only used for POST or PUT requests.

data_input_schema
object(any)

A JSON schema for inputs the request accepts.

data_input_values_str
string

A JSON string of input values for the request.

headers
2 possible types

The headers of the request. Can be a template string or a list of key-value pairs.

method
enum(string)

The HTTP method of the request.

getpostputdeletepatch
query_params
2 possible types

The query params of the request. Can be a template string or a list of key-value pairs.

response_path
string

A JSON path into the response that is merged into the workflow data.

signing_key
string

The signing key used to sign the request.

url
string

The URL of the request.

sha
string

The SHA hash of the reusable request.

type
enum(string)

The reusable request type. Only http_fetch is supported.

http_fetch
updated_at
string(date-time)

The timestamp of when the reusable request was last updated.

Upsert a reusable request

#

Updates a reusable request of a given key, or creates a new one if it does not yet exist.

The write targets the environment in the request. Accounts that allow writes in every environment can create and update in that environment. Pass force to write outside the request's origin environment. When writes are limited to development, this endpoint accepts the development environment unless force is set.

Endpoint

PUT/v1/reusable_requests/{reusable_request_key}

Path parameters

reusable_request_key
string

The key of the reusable request to upsert.

Query parameters

environment
string

The environment slug. When omitted, the account's default environment is used.

branch
string

The slug of a branch to use. When environment is omitted, the branch is resolved from Development after the account default is injected. When environment is supplied, it must be "development".

annotate
boolean

Whether to annotate the resource. Only used in the Knock CLI.

force
boolean

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.

commit
boolean

Whether to commit the resource at the same time as modifying it.

commit_message
string

The message to commit the resource with, only used if commit is true.

allow_empty
boolean

When used with commit, creates a new version with identical content and commits it if there are no unpublished changes.

Request body

reusable_request

A reusable request object with attributes to update or create a reusable request.

conditions

Conditions that must be met before the request runs.

description
string

An internal note about the reusable request.

name
string

A name for the reusable request.

settingsRequired

The HTTP request a reusable request runs.

body
string

The body of the request. Only used for POST or PUT requests.

data_input_schema
object(any)

A JSON schema for inputs the request accepts.

data_input_values_str
string

A JSON string of input values for the request.

headers
2 possible types

The headers of the request. Can be a template string or a list of key-value pairs.

method
enum(string)
Required

The HTTP method of the request.

getpostputdeletepatch
query_params
2 possible types

The query params of the request. Can be a template string or a list of key-value pairs.

response_path
string

A JSON path into the response that is merged into the workflow data.

signing_key
string

The signing key used to sign the request.

url
string

The URL of the request.

type
enum(string)
Required

The reusable request type. Only http_fetch is supported.

http_fetch

Returns

WrappedReusableRequestResponse

Wraps the ReusableRequest response under the reusable_request key.

reusable_request

A reusable HTTP request that workflows can link to.

conditions

Conditions that must be met before the request runs.

created_at
string(date-time)

The timestamp of when the reusable request was created.

description
string

An internal note about the reusable request.

environment
string

The slug of the environment in which the reusable request exists.

key
string

The unique key for the reusable request. Must be 3 to 255 characters and match ^[a-z0-9_-]+$.

name
string

A name for the reusable request.

The HTTP request a reusable request runs.

body
string

The body of the request. Only used for POST or PUT requests.

data_input_schema
object(any)

A JSON schema for inputs the request accepts.

data_input_values_str
string

A JSON string of input values for the request.

headers
2 possible types

The headers of the request. Can be a template string or a list of key-value pairs.

method
enum(string)
Required

The HTTP method of the request.

getpostputdeletepatch
query_params
2 possible types

The query params of the request. Can be a template string or a list of key-value pairs.

response_path
string

A JSON path into the response that is merged into the workflow data.

signing_key
string

The signing key used to sign the request.

url
string

The URL of the request.

sha
string

The SHA hash of the reusable request.

type
enum(string)

The reusable request type. Only http_fetch is supported.

http_fetch
updated_at
string(date-time)

The timestamp of when the reusable request was last updated.

Unarchive a reusable request

#

Unarchives a reusable request by key, with every copy archived alongside it in other environments.

Returns a 404 when the key isn't archived, including when an earlier or concurrent request already restored it. Returns a 422 with the code key_in_use when a live reusable request uses the key.

Endpoint

PUT/v1/reusable_requests/{reusable_request_key}/unarchive

Path parameters

reusable_request_key
string

The key of the reusable request to unarchive.

Query parameters

environment
string

The environment slug. When omitted, the account's default environment is used.

Returns

WrappedReusableRequestResponse

Wraps the ReusableRequest response under the reusable_request key.

reusable_request

A reusable HTTP request that workflows can link to.

conditions

Conditions that must be met before the request runs.

created_at
string(date-time)

The timestamp of when the reusable request was created.

description
string

An internal note about the reusable request.

environment
string

The slug of the environment in which the reusable request exists.

key
string

The unique key for the reusable request. Must be 3 to 255 characters and match ^[a-z0-9_-]+$.

name
string

A name for the reusable request.

The HTTP request a reusable request runs.

body
string

The body of the request. Only used for POST or PUT requests.

data_input_schema
object(any)

A JSON schema for inputs the request accepts.

data_input_values_str
string

A JSON string of input values for the request.

headers
2 possible types

The headers of the request. Can be a template string or a list of key-value pairs.

method
enum(string)
Required

The HTTP method of the request.

getpostputdeletepatch
query_params
2 possible types

The query params of the request. Can be a template string or a list of key-value pairs.

response_path
string

A JSON path into the response that is merged into the workflow data.

signing_key
string

The signing key used to sign the request.

url
string

The URL of the request.

sha
string

The SHA hash of the reusable request.

type
enum(string)

The reusable request type. Only http_fetch is supported.

http_fetch
updated_at
string(date-time)

The timestamp of when the reusable request was last updated.

ReusableRequest

#

A reusable HTTP request that workflows can link to.

Attributes

conditions

Conditions that must be met before the request runs.

created_at
string(date-time)

The timestamp of when the reusable request was created.

description
string

An internal note about the reusable request.

environment
string

The slug of the environment in which the reusable request exists.

key
string

The unique key for the reusable request. Must be 3 to 255 characters and match ^[a-z0-9_-]+$.

name
string

A name for the reusable request.

The HTTP request a reusable request runs.

body
string

The body of the request. Only used for POST or PUT requests.

data_input_schema
object(any)

A JSON schema for inputs the request accepts.

data_input_values_str
string

A JSON string of input values for the request.

headers
2 possible types

The headers of the request. Can be a template string or a list of key-value pairs.

method
enum(string)

The HTTP method of the request.

getpostputdeletepatch
query_params
2 possible types

The query params of the request. Can be a template string or a list of key-value pairs.

response_path
string

A JSON path into the response that is merged into the workflow data.

signing_key
string

The signing key used to sign the request.

url
string

The URL of the request.

sha
string

The SHA hash of the reusable request.

type
enum(string)

The reusable request type. Only http_fetch is supported.

http_fetch
updated_at
string(date-time)

The timestamp of when the reusable request was last updated.

ReusableRequestRequest

#

A reusable request object with attributes to update or create a reusable request.

Attributes

conditions

Conditions that must be met before the request runs.

description
string

An internal note about the reusable request.

name
string

A name for the reusable request.

The HTTP request a reusable request runs.

body
string

The body of the request. Only used for POST or PUT requests.

data_input_schema
object(any)

A JSON schema for inputs the request accepts.

data_input_values_str
string

A JSON string of input values for the request.

headers
2 possible types

The headers of the request. Can be a template string or a list of key-value pairs.

method
enum(string)

The HTTP method of the request.

getpostputdeletepatch
query_params
2 possible types

The query params of the request. Can be a template string or a list of key-value pairs.

response_path
string

A JSON path into the response that is merged into the workflow data.

signing_key
string

The signing key used to sign the request.

url
string

The URL of the request.

type
enum(string)

The reusable request type. Only http_fetch is supported.

http_fetch

ReusableRequestSettings

#

The HTTP request a reusable request runs.

Attributes

body
string

The body of the request. Only used for POST or PUT requests.

data_input_schema
object(any)

A JSON schema for inputs the request accepts.

data_input_values_str
string

A JSON string of input values for the request.

headers
2 possible types

The headers of the request. Can be a template string or a list of key-value pairs.

method
enum(string)

The HTTP method of the request.

getpostputdeletepatch
query_params
2 possible types

The query params of the request. Can be a template string or a list of key-value pairs.

response_path
string

A JSON path into the response that is merged into the workflow data.

signing_key
string

The signing key used to sign the request.

url
string

The URL of the request.

New chat