# KlaviyoAPI::FlowsApi
All URIs are relative to *https://a.klaviyo.com*
| Method | HTTP request | Description |
| ------ | ------------ | ----------- |
| [**get_flow**](FlowsApi.md#get_flow) | **GET** /api/flows/{id}/ | Get Flow |
| [**get_flow_action**](FlowsApi.md#get_flow_action) | **GET** /api/flow-actions/{id}/ | Get Flow Action |
| [**get_flow_action_flow**](FlowsApi.md#get_flow_action_flow) | **GET** /api/flow-actions/{action_id}/flow/ | Get Flow For Flow Action |
| [**get_flow_action_messages**](FlowsApi.md#get_flow_action_messages) | **GET** /api/flow-actions/{action_id}/flow-messages/ | Get Messages For Flow Action |
| [**get_flow_action_relationships**](FlowsApi.md#get_flow_action_relationships) | **GET** /api/flow-actions/{id}/relationships/{related_resource}/ | Get Flow Action Relationships |
| [**get_flow_flow_actions**](FlowsApi.md#get_flow_flow_actions) | **GET** /api/flows/{flow_id}/flow-actions/ | Get Flow Actions For Flow |
| [**get_flow_message**](FlowsApi.md#get_flow_message) | **GET** /api/flow-messages/{id}/ | Get Flow Message |
| [**get_flow_message_action**](FlowsApi.md#get_flow_message_action) | **GET** /api/flow-messages/{message_id}/flow-action/ | Get Flow Action For Message |
| [**get_flow_message_relationships**](FlowsApi.md#get_flow_message_relationships) | **GET** /api/flow-messages/{id}/relationships/{related_resource}/ | Get Flow Message Relationships |
| [**get_flow_relationships**](FlowsApi.md#get_flow_relationships) | **GET** /api/flows/{id}/relationships/{related_resource}/ | Get Flow Relationships |
| [**get_flow_tags**](FlowsApi.md#get_flow_tags) | **GET** /api/flows/{flow_id}/tags/ | Get Flow Tags |
| [**get_flows**](FlowsApi.md#get_flows) | **GET** /api/flows/ | Get Flows |
| [**update_flow**](FlowsApi.md#update_flow) | **PATCH** /api/flows/{id}/ | Update Flow Status |
## get_flow
> Hash<String, Object> get_flow(id, opts)
Get Flow
Get a flow with the given flow ID. Include parameters can be provided to get the following related resource data: `flow-actions`
*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `Flows Read`
### Examples
```ruby
require 'time'
require 'klaviyo-api-sdk'
# setup authorization
KlaviyoAPI.configure do |config|
# Configure API key authorization: Klaviyo-API-Key
config.api_key['Klaviyo-API-Key'] = 'YOUR API KEY'
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
# config.api_key_prefix['Klaviyo-API-Key'] = 'Bearer'
end
api_instance = KlaviyoAPI::FlowsApi.new
id = 'id_example' # String |
opts = {
fields_flow_action: ['action_type'], # Array | For more information please visit https://developers.klaviyo.com/en/v2023-01-24/reference/api-overview#sparse-fieldsets
fields_flow: ['name'], # Array | For more information please visit https://developers.klaviyo.com/en/v2023-01-24/reference/api-overview#sparse-fieldsets
include: ['flow-actions'] # Array | For more information please visit https://developers.klaviyo.com/en/v2023-01-24/reference/api-overview#relationships
}
begin
# Get Flow
result = api_instance.get_flow(id, opts)
p result
rescue KlaviyoAPI::ApiError => e
puts "Error when calling FlowsApi->get_flow: #{e}"
end
```
#### Using the get_flow_with_http_info variant
This returns an Array which contains the response data, status code and headers.
> get_flow_with_http_info(id, opts)
```ruby
begin
# Get Flow
data, status_code, headers = api_instance.get_flow_with_http_info(id, opts)
p status_code # => 2xx
p headers # => { ... }
p data # => Hash<String, Object>
rescue KlaviyoAPI::ApiError => e
puts "Error when calling FlowsApi->get_flow_with_http_info: #{e}"
end
```
### Parameters
| Name | Type | Description | Notes |
| ---- | ---- | ----------- | ----- |
| **id** | **String** | | |
| **fields_flow_action** | [**Array<String>**](String.md) | For more information please visit https://developers.klaviyo.com/en/v2023-01-24/reference/api-overview#sparse-fieldsets | [optional] |
| **fields_flow** | [**Array<String>**](String.md) | For more information please visit https://developers.klaviyo.com/en/v2023-01-24/reference/api-overview#sparse-fieldsets | [optional] |
| **include** | [**Array<String>**](String.md) | For more information please visit https://developers.klaviyo.com/en/v2023-01-24/reference/api-overview#relationships | [optional] |
### Return type
**Hash<String, Object>**
### Authorization
[Klaviyo-API-Key](../README.md#Klaviyo-API-Key)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
## get_flow_action
> Hash<String, Object> get_flow_action(id, opts)
Get Flow Action
Get a flow action from a flow with the given flow action ID. Include parameters can be provided to get the following related resource data: `flows`, `flow-messages`
*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `Flows Read`
### Examples
```ruby
require 'time'
require 'klaviyo-api-sdk'
# setup authorization
KlaviyoAPI.configure do |config|
# Configure API key authorization: Klaviyo-API-Key
config.api_key['Klaviyo-API-Key'] = 'YOUR API KEY'
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
# config.api_key_prefix['Klaviyo-API-Key'] = 'Bearer'
end
api_instance = KlaviyoAPI::FlowsApi.new
id = 'id_example' # String |
opts = {
fields_flow_action: ['action_type'], # Array | For more information please visit https://developers.klaviyo.com/en/v2023-01-24/reference/api-overview#sparse-fieldsets
fields_flow_message: ['name'], # Array | For more information please visit https://developers.klaviyo.com/en/v2023-01-24/reference/api-overview#sparse-fieldsets
fields_flow: ['name'], # Array | For more information please visit https://developers.klaviyo.com/en/v2023-01-24/reference/api-overview#sparse-fieldsets
include: ['flow-messages'] # Array | For more information please visit https://developers.klaviyo.com/en/v2023-01-24/reference/api-overview#relationships
}
begin
# Get Flow Action
result = api_instance.get_flow_action(id, opts)
p result
rescue KlaviyoAPI::ApiError => e
puts "Error when calling FlowsApi->get_flow_action: #{e}"
end
```
#### Using the get_flow_action_with_http_info variant
This returns an Array which contains the response data, status code and headers.
> get_flow_action_with_http_info(id, opts)
```ruby
begin
# Get Flow Action
data, status_code, headers = api_instance.get_flow_action_with_http_info(id, opts)
p status_code # => 2xx
p headers # => { ... }
p data # => Hash<String, Object>
rescue KlaviyoAPI::ApiError => e
puts "Error when calling FlowsApi->get_flow_action_with_http_info: #{e}"
end
```
### Parameters
| Name | Type | Description | Notes |
| ---- | ---- | ----------- | ----- |
| **id** | **String** | | |
| **fields_flow_action** | [**Array<String>**](String.md) | For more information please visit https://developers.klaviyo.com/en/v2023-01-24/reference/api-overview#sparse-fieldsets | [optional] |
| **fields_flow_message** | [**Array<String>**](String.md) | For more information please visit https://developers.klaviyo.com/en/v2023-01-24/reference/api-overview#sparse-fieldsets | [optional] |
| **fields_flow** | [**Array<String>**](String.md) | For more information please visit https://developers.klaviyo.com/en/v2023-01-24/reference/api-overview#sparse-fieldsets | [optional] |
| **include** | [**Array<String>**](String.md) | For more information please visit https://developers.klaviyo.com/en/v2023-01-24/reference/api-overview#relationships | [optional] |
### Return type
**Hash<String, Object>**
### Authorization
[Klaviyo-API-Key](../README.md#Klaviyo-API-Key)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
## get_flow_action_flow
> Hash<String, Object> get_flow_action_flow(action_id, opts)
Get Flow For Flow Action
Get the flow associated with the given action ID.
*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `Flows Read`
### Examples
```ruby
require 'time'
require 'klaviyo-api-sdk'
# setup authorization
KlaviyoAPI.configure do |config|
# Configure API key authorization: Klaviyo-API-Key
config.api_key['Klaviyo-API-Key'] = 'YOUR API KEY'
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
# config.api_key_prefix['Klaviyo-API-Key'] = 'Bearer'
end
api_instance = KlaviyoAPI::FlowsApi.new
action_id = 'action_id_example' # String |
opts = {
fields_flow: ['name'] # Array | For more information please visit https://developers.klaviyo.com/en/v2023-01-24/reference/api-overview#sparse-fieldsets
}
begin
# Get Flow For Flow Action
result = api_instance.get_flow_action_flow(action_id, opts)
p result
rescue KlaviyoAPI::ApiError => e
puts "Error when calling FlowsApi->get_flow_action_flow: #{e}"
end
```
#### Using the get_flow_action_flow_with_http_info variant
This returns an Array which contains the response data, status code and headers.
> get_flow_action_flow_with_http_info(action_id, opts)
```ruby
begin
# Get Flow For Flow Action
data, status_code, headers = api_instance.get_flow_action_flow_with_http_info(action_id, opts)
p status_code # => 2xx
p headers # => { ... }
p data # => Hash<String, Object>
rescue KlaviyoAPI::ApiError => e
puts "Error when calling FlowsApi->get_flow_action_flow_with_http_info: #{e}"
end
```
### Parameters
| Name | Type | Description | Notes |
| ---- | ---- | ----------- | ----- |
| **action_id** | **String** | | |
| **fields_flow** | [**Array<String>**](String.md) | For more information please visit https://developers.klaviyo.com/en/v2023-01-24/reference/api-overview#sparse-fieldsets | [optional] |
### Return type
**Hash<String, Object>**
### Authorization
[Klaviyo-API-Key](../README.md#Klaviyo-API-Key)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
## get_flow_action_messages
> Hash<String, Object> get_flow_action_messages(action_id, opts)
Get Messages For Flow Action
Get all flow messages associated with the given action ID. Flow messages can be sorted by the following fields, in ascending and descending order: ascending: `id`, `name`, `created`, `updated` descending: `-id`, `-name`, `-created`, `-updated` Returns a maximum of 50 flows per request, which can be paginated with offset pagination. Offset pagination uses the following parameters: `page[size]` and `page[number]`
*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `Flows Read`
### Examples
```ruby
require 'time'
require 'klaviyo-api-sdk'
# setup authorization
KlaviyoAPI.configure do |config|
# Configure API key authorization: Klaviyo-API-Key
config.api_key['Klaviyo-API-Key'] = 'YOUR API KEY'
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
# config.api_key_prefix['Klaviyo-API-Key'] = 'Bearer'
end
api_instance = KlaviyoAPI::FlowsApi.new
action_id = 'action_id_example' # String |
opts = {
fields_flow_message: ['name'], # Array | For more information please visit https://developers.klaviyo.com/en/v2023-01-24/reference/api-overview#sparse-fieldsets
filter: 'filter_example', # String | For more information please visit https://developers.klaviyo.com/en/v2023-01-24/reference/api-overview#filtering
Allowed field(s)/operator(s):
`id`: `any`
`name`: `contains`, `ends-with`, `equals`, `starts-with`
`created`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`
`updated`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`
sort: 'created' # String | For more information please visit https://developers.klaviyo.com/en/v2023-01-24/reference/api-overview#sorting
}
begin
# Get Messages For Flow Action
result = api_instance.get_flow_action_messages(action_id, opts)
p result
rescue KlaviyoAPI::ApiError => e
puts "Error when calling FlowsApi->get_flow_action_messages: #{e}"
end
```
#### Using the get_flow_action_messages_with_http_info variant
This returns an Array which contains the response data, status code and headers.
> get_flow_action_messages_with_http_info(action_id, opts)
```ruby
begin
# Get Messages For Flow Action
data, status_code, headers = api_instance.get_flow_action_messages_with_http_info(action_id, opts)
p status_code # => 2xx
p headers # => { ... }
p data # => Hash<String, Object>
rescue KlaviyoAPI::ApiError => e
puts "Error when calling FlowsApi->get_flow_action_messages_with_http_info: #{e}"
end
```
### Parameters
| Name | Type | Description | Notes |
| ---- | ---- | ----------- | ----- |
| **action_id** | **String** | | |
| **fields_flow_message** | [**Array<String>**](String.md) | For more information please visit https://developers.klaviyo.com/en/v2023-01-24/reference/api-overview#sparse-fieldsets | [optional] |
| **filter** | **String** | For more information please visit https://developers.klaviyo.com/en/v2023-01-24/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`id`: `any`<br>`name`: `contains`, `ends-with`, `equals`, `starts-with`<br>`created`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` | [optional] |
| **sort** | **String** | For more information please visit https://developers.klaviyo.com/en/v2023-01-24/reference/api-overview#sorting | [optional] |
### Return type
**Hash<String, Object>**
### Authorization
[Klaviyo-API-Key](../README.md#Klaviyo-API-Key)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
## get_flow_action_relationships
> Hash<String, Object> get_flow_action_relationships(id, related_resource, opts)
Get Flow Action Relationships
Get all [relationships](https://developers.klaviyo.com/en/reference/api_overview#relationships) for flow messages associated with the given flow action ID. Flow message relationships can be sorted by the following fields, in ascending and descending order: `id`, `name`, `created`, `updated` Returns a maximum of 50 flow message relationships per request, which can be paginated with offset pagination. Offset pagination uses the following parameters: `page[size]` and `page[number]`
*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `Flows Read`
### Examples
```ruby
require 'time'
require 'klaviyo-api-sdk'
# setup authorization
KlaviyoAPI.configure do |config|
# Configure API key authorization: Klaviyo-API-Key
config.api_key['Klaviyo-API-Key'] = 'YOUR API KEY'
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
# config.api_key_prefix['Klaviyo-API-Key'] = 'Bearer'
end
api_instance = KlaviyoAPI::FlowsApi.new
id = 'id_example' # String |
related_resource = 'flow' # String |
opts = {
filter: 'filter_example', # String | For more information please visit https://developers.klaviyo.com/en/v2023-01-24/reference/api-overview#filtering
Allowed field(s)/operator(s):
`name`: `contains`, `ends-with`, `equals`, `starts-with`
`created`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`
`updated`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`
sort: 'created' # String | For more information please visit https://developers.klaviyo.com/en/v2023-01-24/reference/api-overview#sorting
}
begin
# Get Flow Action Relationships
result = api_instance.get_flow_action_relationships(id, related_resource, opts)
p result
rescue KlaviyoAPI::ApiError => e
puts "Error when calling FlowsApi->get_flow_action_relationships: #{e}"
end
```
#### Using the get_flow_action_relationships_with_http_info variant
This returns an Array which contains the response data, status code and headers.
> get_flow_action_relationships_with_http_info(id, related_resource, opts)
```ruby
begin
# Get Flow Action Relationships
data, status_code, headers = api_instance.get_flow_action_relationships_with_http_info(id, related_resource, opts)
p status_code # => 2xx
p headers # => { ... }
p data # => Hash<String, Object>
rescue KlaviyoAPI::ApiError => e
puts "Error when calling FlowsApi->get_flow_action_relationships_with_http_info: #{e}"
end
```
### Parameters
| Name | Type | Description | Notes |
| ---- | ---- | ----------- | ----- |
| **id** | **String** | | |
| **related_resource** | **String** | | |
| **filter** | **String** | For more information please visit https://developers.klaviyo.com/en/v2023-01-24/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`name`: `contains`, `ends-with`, `equals`, `starts-with`<br>`created`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` | [optional] |
| **sort** | **String** | For more information please visit https://developers.klaviyo.com/en/v2023-01-24/reference/api-overview#sorting | [optional] |
### Return type
**Hash<String, Object>**
### Authorization
[Klaviyo-API-Key](../README.md#Klaviyo-API-Key)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
## get_flow_flow_actions
> Hash<String, Object> get_flow_flow_actions(flow_id, opts)
Get Flow Actions For Flow
Get all flow actions associated with the given flow ID. Flow actions can be sorted by the following fields, in ascending and descending order: `id`, `status`, `created`, `updated`, `action_type` Returns a maximum of 50 flows per request, which can be paginated with offset pagination. Offset pagination uses the following parameters: `page[size]` and `page[number]`.
*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `Flows Read`
### Examples
```ruby
require 'time'
require 'klaviyo-api-sdk'
# setup authorization
KlaviyoAPI.configure do |config|
# Configure API key authorization: Klaviyo-API-Key
config.api_key['Klaviyo-API-Key'] = 'YOUR API KEY'
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
# config.api_key_prefix['Klaviyo-API-Key'] = 'Bearer'
end
api_instance = KlaviyoAPI::FlowsApi.new
flow_id = 'flow_id_example' # String |
opts = {
fields_flow_action: ['action_type'], # Array | For more information please visit https://developers.klaviyo.com/en/v2023-01-24/reference/api-overview#sparse-fieldsets
filter: 'filter_example', # String | For more information please visit https://developers.klaviyo.com/en/v2023-01-24/reference/api-overview#filtering
Allowed field(s)/operator(s):
`id`: `any`
`action_type`: `any`, `equals`
`status`: `equals`
`created`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`
`updated`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`
sort: 'action_type' # String | For more information please visit https://developers.klaviyo.com/en/v2023-01-24/reference/api-overview#sorting
}
begin
# Get Flow Actions For Flow
result = api_instance.get_flow_flow_actions(flow_id, opts)
p result
rescue KlaviyoAPI::ApiError => e
puts "Error when calling FlowsApi->get_flow_flow_actions: #{e}"
end
```
#### Using the get_flow_flow_actions_with_http_info variant
This returns an Array which contains the response data, status code and headers.
> get_flow_flow_actions_with_http_info(flow_id, opts)
```ruby
begin
# Get Flow Actions For Flow
data, status_code, headers = api_instance.get_flow_flow_actions_with_http_info(flow_id, opts)
p status_code # => 2xx
p headers # => { ... }
p data # => Hash<String, Object>
rescue KlaviyoAPI::ApiError => e
puts "Error when calling FlowsApi->get_flow_flow_actions_with_http_info: #{e}"
end
```
### Parameters
| Name | Type | Description | Notes |
| ---- | ---- | ----------- | ----- |
| **flow_id** | **String** | | |
| **fields_flow_action** | [**Array<String>**](String.md) | For more information please visit https://developers.klaviyo.com/en/v2023-01-24/reference/api-overview#sparse-fieldsets | [optional] |
| **filter** | **String** | For more information please visit https://developers.klaviyo.com/en/v2023-01-24/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`id`: `any`<br>`action_type`: `any`, `equals`<br>`status`: `equals`<br>`created`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` | [optional] |
| **sort** | **String** | For more information please visit https://developers.klaviyo.com/en/v2023-01-24/reference/api-overview#sorting | [optional] |
### Return type
**Hash<String, Object>**
### Authorization
[Klaviyo-API-Key](../README.md#Klaviyo-API-Key)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
## get_flow_message
> Hash<String, Object> get_flow_message(id, opts)
Get Flow Message
Get the flow message of a flow with the given message ID. Include parameters can be provided to get the following related resource data: 'flow-actions'
*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `Flows Read`
### Examples
```ruby
require 'time'
require 'klaviyo-api-sdk'
# setup authorization
KlaviyoAPI.configure do |config|
# Configure API key authorization: Klaviyo-API-Key
config.api_key['Klaviyo-API-Key'] = 'YOUR API KEY'
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
# config.api_key_prefix['Klaviyo-API-Key'] = 'Bearer'
end
api_instance = KlaviyoAPI::FlowsApi.new
id = 'id_example' # String |
opts = {
fields_flow_action: ['action_type'], # Array | For more information please visit https://developers.klaviyo.com/en/v2023-01-24/reference/api-overview#sparse-fieldsets
fields_flow_message: ['name'], # Array | For more information please visit https://developers.klaviyo.com/en/v2023-01-24/reference/api-overview#sparse-fieldsets
include: ['flow-action'] # Array | For more information please visit https://developers.klaviyo.com/en/v2023-01-24/reference/api-overview#relationships
}
begin
# Get Flow Message
result = api_instance.get_flow_message(id, opts)
p result
rescue KlaviyoAPI::ApiError => e
puts "Error when calling FlowsApi->get_flow_message: #{e}"
end
```
#### Using the get_flow_message_with_http_info variant
This returns an Array which contains the response data, status code and headers.
> get_flow_message_with_http_info(id, opts)
```ruby
begin
# Get Flow Message
data, status_code, headers = api_instance.get_flow_message_with_http_info(id, opts)
p status_code # => 2xx
p headers # => { ... }
p data # => Hash<String, Object>
rescue KlaviyoAPI::ApiError => e
puts "Error when calling FlowsApi->get_flow_message_with_http_info: #{e}"
end
```
### Parameters
| Name | Type | Description | Notes |
| ---- | ---- | ----------- | ----- |
| **id** | **String** | | |
| **fields_flow_action** | [**Array<String>**](String.md) | For more information please visit https://developers.klaviyo.com/en/v2023-01-24/reference/api-overview#sparse-fieldsets | [optional] |
| **fields_flow_message** | [**Array<String>**](String.md) | For more information please visit https://developers.klaviyo.com/en/v2023-01-24/reference/api-overview#sparse-fieldsets | [optional] |
| **include** | [**Array<String>**](String.md) | For more information please visit https://developers.klaviyo.com/en/v2023-01-24/reference/api-overview#relationships | [optional] |
### Return type
**Hash<String, Object>**
### Authorization
[Klaviyo-API-Key](../README.md#Klaviyo-API-Key)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
## get_flow_message_action
> Hash<String, Object> get_flow_message_action(message_id, opts)
Get Flow Action For Message
Get the flow action for a flow message with the given message ID.
*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `Flows Read`
### Examples
```ruby
require 'time'
require 'klaviyo-api-sdk'
# setup authorization
KlaviyoAPI.configure do |config|
# Configure API key authorization: Klaviyo-API-Key
config.api_key['Klaviyo-API-Key'] = 'YOUR API KEY'
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
# config.api_key_prefix['Klaviyo-API-Key'] = 'Bearer'
end
api_instance = KlaviyoAPI::FlowsApi.new
message_id = 'message_id_example' # String |
opts = {
fields_flow_action: ['action_type'] # Array | For more information please visit https://developers.klaviyo.com/en/v2023-01-24/reference/api-overview#sparse-fieldsets
}
begin
# Get Flow Action For Message
result = api_instance.get_flow_message_action(message_id, opts)
p result
rescue KlaviyoAPI::ApiError => e
puts "Error when calling FlowsApi->get_flow_message_action: #{e}"
end
```
#### Using the get_flow_message_action_with_http_info variant
This returns an Array which contains the response data, status code and headers.
> get_flow_message_action_with_http_info(message_id, opts)
```ruby
begin
# Get Flow Action For Message
data, status_code, headers = api_instance.get_flow_message_action_with_http_info(message_id, opts)
p status_code # => 2xx
p headers # => { ... }
p data # => Hash<String, Object>
rescue KlaviyoAPI::ApiError => e
puts "Error when calling FlowsApi->get_flow_message_action_with_http_info: #{e}"
end
```
### Parameters
| Name | Type | Description | Notes |
| ---- | ---- | ----------- | ----- |
| **message_id** | **String** | | |
| **fields_flow_action** | [**Array<String>**](String.md) | For more information please visit https://developers.klaviyo.com/en/v2023-01-24/reference/api-overview#sparse-fieldsets | [optional] |
### Return type
**Hash<String, Object>**
### Authorization
[Klaviyo-API-Key](../README.md#Klaviyo-API-Key)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
## get_flow_message_relationships
> Hash<String, Object> get_flow_message_relationships(id, related_resource)
Get Flow Message Relationships
Get the [relationship](https://developers.klaviyo.com/en/reference/api_overview#relationships) for a flow message's flow action, given the flow ID.
*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `Flows Read`
### Examples
```ruby
require 'time'
require 'klaviyo-api-sdk'
# setup authorization
KlaviyoAPI.configure do |config|
# Configure API key authorization: Klaviyo-API-Key
config.api_key['Klaviyo-API-Key'] = 'YOUR API KEY'
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
# config.api_key_prefix['Klaviyo-API-Key'] = 'Bearer'
end
api_instance = KlaviyoAPI::FlowsApi.new
id = 'id_example' # String |
related_resource = 'flow-action' # String |
begin
# Get Flow Message Relationships
result = api_instance.get_flow_message_relationships(id, related_resource)
p result
rescue KlaviyoAPI::ApiError => e
puts "Error when calling FlowsApi->get_flow_message_relationships: #{e}"
end
```
#### Using the get_flow_message_relationships_with_http_info variant
This returns an Array which contains the response data, status code and headers.
> get_flow_message_relationships_with_http_info(id, related_resource)
```ruby
begin
# Get Flow Message Relationships
data, status_code, headers = api_instance.get_flow_message_relationships_with_http_info(id, related_resource)
p status_code # => 2xx
p headers # => { ... }
p data # => Hash<String, Object>
rescue KlaviyoAPI::ApiError => e
puts "Error when calling FlowsApi->get_flow_message_relationships_with_http_info: #{e}"
end
```
### Parameters
| Name | Type | Description | Notes |
| ---- | ---- | ----------- | ----- |
| **id** | **String** | | |
| **related_resource** | **String** | | |
### Return type
**Hash<String, Object>**
### Authorization
[Klaviyo-API-Key](../README.md#Klaviyo-API-Key)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
## get_flow_relationships
> Hash<String, Object> get_flow_relationships(id, related_resource)
Get Flow Relationships
If the `related_resource` is `tags`, returns the tag IDs of all tags associated with the given flow.
*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `Flows Read` `Tags Read`
### Examples
```ruby
require 'time'
require 'klaviyo-api-sdk'
# setup authorization
KlaviyoAPI.configure do |config|
# Configure API key authorization: Klaviyo-API-Key
config.api_key['Klaviyo-API-Key'] = 'YOUR API KEY'
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
# config.api_key_prefix['Klaviyo-API-Key'] = 'Bearer'
end
api_instance = KlaviyoAPI::FlowsApi.new
id = 'id_example' # String |
related_resource = 'flow-actions' # String |
begin
# Get Flow Relationships
result = api_instance.get_flow_relationships(id, related_resource)
p result
rescue KlaviyoAPI::ApiError => e
puts "Error when calling FlowsApi->get_flow_relationships: #{e}"
end
```
#### Using the get_flow_relationships_with_http_info variant
This returns an Array which contains the response data, status code and headers.
> get_flow_relationships_with_http_info(id, related_resource)
```ruby
begin
# Get Flow Relationships
data, status_code, headers = api_instance.get_flow_relationships_with_http_info(id, related_resource)
p status_code # => 2xx
p headers # => { ... }
p data # => Hash<String, Object>
rescue KlaviyoAPI::ApiError => e
puts "Error when calling FlowsApi->get_flow_relationships_with_http_info: #{e}"
end
```
### Parameters
| Name | Type | Description | Notes |
| ---- | ---- | ----------- | ----- |
| **id** | **String** | | |
| **related_resource** | **String** | | |
### Return type
**Hash<String, Object>**
### Authorization
[Klaviyo-API-Key](../README.md#Klaviyo-API-Key)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
## get_flow_tags
> Hash<String, Object> get_flow_tags(flow_id, opts)
Get Flow Tags
Return all tags associated with the given flow ID.
*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `Flows Read` `Tags Read`
### Examples
```ruby
require 'time'
require 'klaviyo-api-sdk'
# setup authorization
KlaviyoAPI.configure do |config|
# Configure API key authorization: Klaviyo-API-Key
config.api_key['Klaviyo-API-Key'] = 'YOUR API KEY'
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
# config.api_key_prefix['Klaviyo-API-Key'] = 'Bearer'
end
api_instance = KlaviyoAPI::FlowsApi.new
flow_id = 'flow_id_example' # String |
opts = {
fields_tag: ['name'] # Array | For more information please visit https://developers.klaviyo.com/en/v2023-01-24/reference/api-overview#sparse-fieldsets
}
begin
# Get Flow Tags
result = api_instance.get_flow_tags(flow_id, opts)
p result
rescue KlaviyoAPI::ApiError => e
puts "Error when calling FlowsApi->get_flow_tags: #{e}"
end
```
#### Using the get_flow_tags_with_http_info variant
This returns an Array which contains the response data, status code and headers.
> get_flow_tags_with_http_info(flow_id, opts)
```ruby
begin
# Get Flow Tags
data, status_code, headers = api_instance.get_flow_tags_with_http_info(flow_id, opts)
p status_code # => 2xx
p headers # => { ... }
p data # => Hash<String, Object>
rescue KlaviyoAPI::ApiError => e
puts "Error when calling FlowsApi->get_flow_tags_with_http_info: #{e}"
end
```
### Parameters
| Name | Type | Description | Notes |
| ---- | ---- | ----------- | ----- |
| **flow_id** | **String** | | |
| **fields_tag** | [**Array<String>**](String.md) | For more information please visit https://developers.klaviyo.com/en/v2023-01-24/reference/api-overview#sparse-fieldsets | [optional] |
### Return type
**Hash<String, Object>**
### Authorization
[Klaviyo-API-Key](../README.md#Klaviyo-API-Key)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
## get_flows
> Hash<String, Object> get_flows(opts)
Get Flows
Get all flows in an account. Flows can be sorted by the following fields, in ascending and descending order: `id`, `name`, `status`, `trigger_type`, `created`, `updated` Include parameters can be provided to get the following related resource data: `flow-actions` Returns a maximum of 50 flows per request, which can be paginated with offset pagination. Offset pagination uses the following parameters: `page[size]` and `page[number]`.
*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `Flows Read`
### Examples
```ruby
require 'time'
require 'klaviyo-api-sdk'
# setup authorization
KlaviyoAPI.configure do |config|
# Configure API key authorization: Klaviyo-API-Key
config.api_key['Klaviyo-API-Key'] = 'YOUR API KEY'
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
# config.api_key_prefix['Klaviyo-API-Key'] = 'Bearer'
end
api_instance = KlaviyoAPI::FlowsApi.new
opts = {
fields_flow_action: ['action_type'], # Array | For more information please visit https://developers.klaviyo.com/en/v2023-01-24/reference/api-overview#sparse-fieldsets
fields_flow: ['name'], # Array | For more information please visit https://developers.klaviyo.com/en/v2023-01-24/reference/api-overview#sparse-fieldsets
filter: 'filter_example', # String | For more information please visit https://developers.klaviyo.com/en/v2023-01-24/reference/api-overview#filtering
Allowed field(s)/operator(s):
`id`: `any`
`name`: `contains`, `ends-with`, `equals`, `starts-with`
`status`: `equals`
`archived`: `equals`
`created`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`
`updated`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`
`trigger_type`: `equals`
include: ['flow-actions'], # Array | For more information please visit https://developers.klaviyo.com/en/v2023-01-24/reference/api-overview#relationships
sort: 'created' # String | For more information please visit https://developers.klaviyo.com/en/v2023-01-24/reference/api-overview#sorting
}
begin
# Get Flows
result = api_instance.get_flows(opts)
p result
rescue KlaviyoAPI::ApiError => e
puts "Error when calling FlowsApi->get_flows: #{e}"
end
```
#### Using the get_flows_with_http_info variant
This returns an Array which contains the response data, status code and headers.
> get_flows_with_http_info(opts)
```ruby
begin
# Get Flows
data, status_code, headers = api_instance.get_flows_with_http_info(opts)
p status_code # => 2xx
p headers # => { ... }
p data # => Hash<String, Object>
rescue KlaviyoAPI::ApiError => e
puts "Error when calling FlowsApi->get_flows_with_http_info: #{e}"
end
```
### Parameters
| Name | Type | Description | Notes |
| ---- | ---- | ----------- | ----- |
| **fields_flow_action** | [**Array<String>**](String.md) | For more information please visit https://developers.klaviyo.com/en/v2023-01-24/reference/api-overview#sparse-fieldsets | [optional] |
| **fields_flow** | [**Array<String>**](String.md) | For more information please visit https://developers.klaviyo.com/en/v2023-01-24/reference/api-overview#sparse-fieldsets | [optional] |
| **filter** | **String** | For more information please visit https://developers.klaviyo.com/en/v2023-01-24/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`id`: `any`<br>`name`: `contains`, `ends-with`, `equals`, `starts-with`<br>`status`: `equals`<br>`archived`: `equals`<br>`created`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`updated`: `equals`, `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`trigger_type`: `equals` | [optional] |
| **include** | [**Array<String>**](String.md) | For more information please visit https://developers.klaviyo.com/en/v2023-01-24/reference/api-overview#relationships | [optional] |
| **sort** | **String** | For more information please visit https://developers.klaviyo.com/en/v2023-01-24/reference/api-overview#sorting | [optional] |
### Return type
**Hash<String, Object>**
### Authorization
[Klaviyo-API-Key](../README.md#Klaviyo-API-Key)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
## update_flow
> Hash<String, Object> update_flow(id, flow_update_query)
Update Flow Status
Update the status of a flow with the given flow ID, and all actions in that flow.
*Rate limits*:
Burst: `3/s`
Steady: `60/m` **Scopes:** `Flows Write`
### Examples
```ruby
require 'time'
require 'klaviyo-api-sdk'
# setup authorization
KlaviyoAPI.configure do |config|
# Configure API key authorization: Klaviyo-API-Key
config.api_key['Klaviyo-API-Key'] = 'YOUR API KEY'
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
# config.api_key_prefix['Klaviyo-API-Key'] = 'Bearer'
end
api_instance = KlaviyoAPI::FlowsApi.new
id = 'id_example' # String |
flow_update_query = KlaviyoAPI::FlowUpdateQuery.new({data: KlaviyoAPI::FlowUpdateQueryAsSubResource.new({type: 'flow', id: 'id_example', attributes: KlaviyoAPI::FlowUpdateQueryAsSubResourceAttributes.new({status: 'status_example'})})}) # FlowUpdateQuery |
begin
# Update Flow Status
result = api_instance.update_flow(id, flow_update_query)
p result
rescue KlaviyoAPI::ApiError => e
puts "Error when calling FlowsApi->update_flow: #{e}"
end
```
#### Using the update_flow_with_http_info variant
This returns an Array which contains the response data, status code and headers.
> update_flow_with_http_info(id, flow_update_query)
```ruby
begin
# Update Flow Status
data, status_code, headers = api_instance.update_flow_with_http_info(id, flow_update_query)
p status_code # => 2xx
p headers # => { ... }
p data # => Hash<String, Object>
rescue KlaviyoAPI::ApiError => e
puts "Error when calling FlowsApi->update_flow_with_http_info: #{e}"
end
```
### Parameters
| Name | Type | Description | Notes |
| ---- | ---- | ----------- | ----- |
| **id** | **String** | | |
| **flow_update_query** | [**FlowUpdateQuery**](FlowUpdateQuery.md) | | |
### Return type
**Hash<String, Object>**
### Authorization
[Klaviyo-API-Key](../README.md#Klaviyo-API-Key)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json