# Flow Versions

## List Flow Versions

> Retrieves a paginated list of all versions for a specific flow.

```json
{"openapi":"3.0.0","info":{"title":"Patchworks Core API","version":"1.0.0"},"tags":[{"name":"Flow Versions"}],"servers":[{"url":"https://core.wearepatchworks.com"}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"Authorization","description":"API key passed in the Authorization header. Format: `<api-key>`"},"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"OAuth 2 Bearer token obtained from POST /fabric/api/login"}},"schemas":{"FlowsListResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Flows"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"},"links":{"$ref":"#/components/schemas/PaginationLinks"}}},"Flows":{"type":"object","properties":{"id":{"type":"integer","description":"Unique identifier"},"name":{"type":"string"},"enabled_at":{"type":"string","format":"date-time"},"status":{"type":"string","enum":["Draft","Inactive","Deployed"]},"format":{"type":"string","enum":["csv","json","txt","xml"]},"body":{"type":"string"},"deployed_at":{"type":"string"},"labels":{"type":"string","items":{"type":"object"}},"notification_groups":{"type":"string"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"description":{"type":"string"},"layout_direction":{"type":"string"},"is_enabled":{"type":"object"},"latest_version":{"type":"object"},"current_version":{"type":"object"},"deployed_version":{"type":"object"},"latest_deployed_version":{"type":"array","items":{"type":"object"}},"versions":{"type":"array","items":{"type":"object"}},"version_type_counts":{"type":"array","items":{"type":"object"}},"message_brokers":{"type":"array","items":{"type":"object"}},"message_broker_queues":{"type":"array","items":{"type":"object"}},"notification_group_ids":{"type":"array","items":{"type":"object"}},"webhooks":{"type":"string"},"callbacks":{"type":"string"},"current_version_step_count":{"type":"integer"},"current_version_connector_count":{"type":"integer"},"current_version_script_count":{"type":"integer"},"current_version_cache_count":{"type":"integer"},"current_version_data_pool_count":{"type":"integer"},"current_version_cross_ref_count":{"type":"integer"},"use_queued_time":{"type":"string"},"remove_failed_payloads":{"type":"array","items":{"type":"object"}},"priority":{"type":"array","items":{"type":"object"}},"prod_flag":{"type":"array","items":{"type":"object"}},"deployments":{"type":"array","items":{"type":"object"}},"webhooks_count":{"type":"integer"},"callbacks_count":{"type":"integer"},"marketplace_app_id":{"type":"integer"},"blueprint_id":{"type":"integer"},"blueprint_version_number":{"type":"string"},"flow_folder_id":{"type":"integer"}}},"PaginationMeta":{"type":"object","properties":{"current_page":{"type":"integer"},"from":{"type":"integer","nullable":true},"last_page":{"type":"integer"},"path":{"type":"string"},"per_page":{"type":"integer"},"to":{"type":"integer","nullable":true},"total":{"type":"integer"}}},"PaginationLinks":{"type":"object","properties":{"first":{"type":"string","format":"uri"},"last":{"type":"string","format":"uri"},"prev":{"type":"string","format":"uri","nullable":true},"next":{"type":"string","format":"uri","nullable":true}}}}},"paths":{"/api/v1/flows/{flow}/versions":{"get":{"summary":"List Flow Versions","description":"Retrieves a paginated list of all versions for a specific flow.","parameters":[{"name":"flow","in":"path","required":true,"schema":{"type":"string"},"description":"The flow identifier."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlowsListResponse"}}}},"401":{"description":"Unauthenticated"},"403":{"description":"Unauthorized"}},"tags":["Flow Versions"]}}}}
```

## Create Flow Version

> Creates a new draft version of a flow. Intended for use when a flow has no existing versions.

```json
{"openapi":"3.0.0","info":{"title":"Patchworks Core API","version":"1.0.0"},"tags":[{"name":"Flow Versions"}],"servers":[{"url":"https://core.wearepatchworks.com"}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"Authorization","description":"API key passed in the Authorization header. Format: `<api-key>`"},"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"OAuth 2 Bearer token obtained from POST /fabric/api/login"}},"schemas":{"FlowsResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Flows"}}},"Flows":{"type":"object","properties":{"id":{"type":"integer","description":"Unique identifier"},"name":{"type":"string"},"enabled_at":{"type":"string","format":"date-time"},"status":{"type":"string","enum":["Draft","Inactive","Deployed"]},"format":{"type":"string","enum":["csv","json","txt","xml"]},"body":{"type":"string"},"deployed_at":{"type":"string"},"labels":{"type":"string","items":{"type":"object"}},"notification_groups":{"type":"string"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"description":{"type":"string"},"layout_direction":{"type":"string"},"is_enabled":{"type":"object"},"latest_version":{"type":"object"},"current_version":{"type":"object"},"deployed_version":{"type":"object"},"latest_deployed_version":{"type":"array","items":{"type":"object"}},"versions":{"type":"array","items":{"type":"object"}},"version_type_counts":{"type":"array","items":{"type":"object"}},"message_brokers":{"type":"array","items":{"type":"object"}},"message_broker_queues":{"type":"array","items":{"type":"object"}},"notification_group_ids":{"type":"array","items":{"type":"object"}},"webhooks":{"type":"string"},"callbacks":{"type":"string"},"current_version_step_count":{"type":"integer"},"current_version_connector_count":{"type":"integer"},"current_version_script_count":{"type":"integer"},"current_version_cache_count":{"type":"integer"},"current_version_data_pool_count":{"type":"integer"},"current_version_cross_ref_count":{"type":"integer"},"use_queued_time":{"type":"string"},"remove_failed_payloads":{"type":"array","items":{"type":"object"}},"priority":{"type":"array","items":{"type":"object"}},"prod_flag":{"type":"array","items":{"type":"object"}},"deployments":{"type":"array","items":{"type":"object"}},"webhooks_count":{"type":"integer"},"callbacks_count":{"type":"integer"},"marketplace_app_id":{"type":"integer"},"blueprint_id":{"type":"integer"},"blueprint_version_number":{"type":"string"},"flow_folder_id":{"type":"integer"}}},"ErrorResponse":{"type":"object","properties":{"message":{"type":"string"},"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}}}}},"paths":{"/api/v1/flows/{flow}/versions":{"post":{"summary":"Create Flow Version","description":"Creates a new draft version of a flow. Intended for use when a flow has no existing versions.","parameters":[{"name":"flow","in":"path","required":true,"schema":{"type":"string"},"description":"The flow identifier."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlowsResponse"}}}},"401":{"description":"Unauthenticated"},"403":{"description":"Unauthorized"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"tags":["Flow Versions"]}}}}
```

## Get Flow Version

> Retrieves the details of a specific flow version.

```json
{"openapi":"3.0.0","info":{"title":"Patchworks Core API","version":"1.0.0"},"tags":[{"name":"Flow Versions"}],"servers":[{"url":"https://core.wearepatchworks.com"}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"Authorization","description":"API key passed in the Authorization header. Format: `<api-key>`"},"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"OAuth 2 Bearer token obtained from POST /fabric/api/login"}},"schemas":{"FlowsResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Flows"}}},"Flows":{"type":"object","properties":{"id":{"type":"integer","description":"Unique identifier"},"name":{"type":"string"},"enabled_at":{"type":"string","format":"date-time"},"status":{"type":"string","enum":["Draft","Inactive","Deployed"]},"format":{"type":"string","enum":["csv","json","txt","xml"]},"body":{"type":"string"},"deployed_at":{"type":"string"},"labels":{"type":"string","items":{"type":"object"}},"notification_groups":{"type":"string"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"description":{"type":"string"},"layout_direction":{"type":"string"},"is_enabled":{"type":"object"},"latest_version":{"type":"object"},"current_version":{"type":"object"},"deployed_version":{"type":"object"},"latest_deployed_version":{"type":"array","items":{"type":"object"}},"versions":{"type":"array","items":{"type":"object"}},"version_type_counts":{"type":"array","items":{"type":"object"}},"message_brokers":{"type":"array","items":{"type":"object"}},"message_broker_queues":{"type":"array","items":{"type":"object"}},"notification_group_ids":{"type":"array","items":{"type":"object"}},"webhooks":{"type":"string"},"callbacks":{"type":"string"},"current_version_step_count":{"type":"integer"},"current_version_connector_count":{"type":"integer"},"current_version_script_count":{"type":"integer"},"current_version_cache_count":{"type":"integer"},"current_version_data_pool_count":{"type":"integer"},"current_version_cross_ref_count":{"type":"integer"},"use_queued_time":{"type":"string"},"remove_failed_payloads":{"type":"array","items":{"type":"object"}},"priority":{"type":"array","items":{"type":"object"}},"prod_flag":{"type":"array","items":{"type":"object"}},"deployments":{"type":"array","items":{"type":"object"}},"webhooks_count":{"type":"integer"},"callbacks_count":{"type":"integer"},"marketplace_app_id":{"type":"integer"},"blueprint_id":{"type":"integer"},"blueprint_version_number":{"type":"string"},"flow_folder_id":{"type":"integer"}}}}},"paths":{"/api/v1/flows/{flow}/versions/{version}":{"get":{"summary":"Get Flow Version","description":"Retrieves the details of a specific flow version.","parameters":[{"name":"flow","in":"path","required":true,"schema":{"type":"string"},"description":"The flow identifier."},{"name":"version","in":"path","required":true,"schema":{"type":"string"},"description":"The version identifier."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlowsResponse"}}}},"401":{"description":"Unauthenticated"},"403":{"description":"Unauthorized"}},"tags":["Flow Versions"]}}}}
```

## Update Flow Version

> Updates an existing flow version. Accepts a \`deployed\_at\` timestamp.

```json
{"openapi":"3.0.0","info":{"title":"Patchworks Core API","version":"1.0.0"},"tags":[{"name":"Flow Versions"}],"servers":[{"url":"https://core.wearepatchworks.com"}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"Authorization","description":"API key passed in the Authorization header. Format: `<api-key>`"},"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"OAuth 2 Bearer token obtained from POST /fabric/api/login"}},"schemas":{"FlowsResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Flows"}}},"Flows":{"type":"object","properties":{"id":{"type":"integer","description":"Unique identifier"},"name":{"type":"string"},"enabled_at":{"type":"string","format":"date-time"},"status":{"type":"string","enum":["Draft","Inactive","Deployed"]},"format":{"type":"string","enum":["csv","json","txt","xml"]},"body":{"type":"string"},"deployed_at":{"type":"string"},"labels":{"type":"string","items":{"type":"object"}},"notification_groups":{"type":"string"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"description":{"type":"string"},"layout_direction":{"type":"string"},"is_enabled":{"type":"object"},"latest_version":{"type":"object"},"current_version":{"type":"object"},"deployed_version":{"type":"object"},"latest_deployed_version":{"type":"array","items":{"type":"object"}},"versions":{"type":"array","items":{"type":"object"}},"version_type_counts":{"type":"array","items":{"type":"object"}},"message_brokers":{"type":"array","items":{"type":"object"}},"message_broker_queues":{"type":"array","items":{"type":"object"}},"notification_group_ids":{"type":"array","items":{"type":"object"}},"webhooks":{"type":"string"},"callbacks":{"type":"string"},"current_version_step_count":{"type":"integer"},"current_version_connector_count":{"type":"integer"},"current_version_script_count":{"type":"integer"},"current_version_cache_count":{"type":"integer"},"current_version_data_pool_count":{"type":"integer"},"current_version_cross_ref_count":{"type":"integer"},"use_queued_time":{"type":"string"},"remove_failed_payloads":{"type":"array","items":{"type":"object"}},"priority":{"type":"array","items":{"type":"object"}},"prod_flag":{"type":"array","items":{"type":"object"}},"deployments":{"type":"array","items":{"type":"object"}},"webhooks_count":{"type":"integer"},"callbacks_count":{"type":"integer"},"marketplace_app_id":{"type":"integer"},"blueprint_id":{"type":"integer"},"blueprint_version_number":{"type":"string"},"flow_folder_id":{"type":"integer"}}},"ErrorResponse":{"type":"object","properties":{"message":{"type":"string"},"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}}},"FlowsUpdateVersionsRequest":{"type":"object","properties":{"deployed_at":{"type":"string","format":"date-time","nullable":true}}}}},"paths":{"/api/v1/flows/{flow}/versions/{version}":{"put":{"summary":"Update Flow Version","description":"Updates an existing flow version. Accepts a `deployed_at` timestamp.","parameters":[{"name":"flow","in":"path","required":true,"schema":{"type":"string"},"description":"The flow identifier."},{"name":"version","in":"path","required":true,"schema":{"type":"string"},"description":"The version identifier."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlowsResponse"}}}},"401":{"description":"Unauthenticated"},"403":{"description":"Unauthorized"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlowsUpdateVersionsRequest"}}}},"tags":["Flow Versions"]}}}}
```

## Delete Flow Version

> Permanently deletes a specific flow version.

```json
{"openapi":"3.0.0","info":{"title":"Patchworks Core API","version":"1.0.0"},"tags":[{"name":"Flow Versions"}],"servers":[{"url":"https://core.wearepatchworks.com"}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"Authorization","description":"API key passed in the Authorization header. Format: `<api-key>`"},"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"OAuth 2 Bearer token obtained from POST /fabric/api/login"}},"schemas":{"MessageResponse":{"type":"object","properties":{"message":{"type":"string"}}}}},"paths":{"/api/v1/flows/{flow}/versions/{version}":{"delete":{"summary":"Delete Flow Version","description":"Permanently deletes a specific flow version.","parameters":[{"name":"flow","in":"path","required":true,"schema":{"type":"string"},"description":"The flow identifier."},{"name":"version","in":"path","required":true,"schema":{"type":"string"},"description":"The version identifier."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"401":{"description":"Unauthenticated"},"403":{"description":"Unauthorized"}},"tags":["Flow Versions"]}}}}
```

## Copy Flow Version

> Copies an existing deployed flow version into a new draft version. Any existing draft for that flow is overwritten.

```json
{"openapi":"3.0.0","info":{"title":"Patchworks Core API","version":"1.0.0"},"tags":[{"name":"Flow Versions"}],"servers":[{"url":"https://core.wearepatchworks.com"}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"Authorization","description":"API key passed in the Authorization header. Format: `<api-key>`"},"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"OAuth 2 Bearer token obtained from POST /fabric/api/login"}},"schemas":{"ErrorResponse":{"type":"object","properties":{"message":{"type":"string"},"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}}}}},"paths":{"/api/v1/flows/{flow}/versions/{version}/copy":{"post":{"summary":"Copy Flow Version","description":"Copies an existing deployed flow version into a new draft version. Any existing draft for that flow is overwritten.","parameters":[{"name":"flow","in":"path","required":true,"schema":{"type":"string"},"description":"The flow identifier."},{"name":"version","in":"path","required":true,"schema":{"type":"string"},"description":"The version identifier."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Unauthenticated"},"403":{"description":"Unauthorized"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"tags":["Flow Versions"]}}}}
```

## Upload Flow Version

> Uploads a given flow version to your \`private\` marketplace.\
> \
> This operation requires \`administrator\` permissions. If you are authorising requests with an API key, this request won't work (company-level API keys are associated with manager-level permissions). If you are an \`administrator\`, you can use OAuth 2 credentials to complete this operation. For more information please see our \[Authentication]\(<https://doc.wearepatchworks.com/product-documentation/api-reference/getting-started/authentication#oauth-2-client-credentials>) section.

```json
{"openapi":"3.0.0","info":{"title":"Patchworks Core API","version":"1.0.0"},"tags":[{"name":"Flow Versions"}],"servers":[{"url":"https://core.wearepatchworks.com"}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"Authorization","description":"API key passed in the Authorization header. Format: `<api-key>`"},"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"OAuth 2 Bearer token obtained from POST /fabric/api/login"}},"schemas":{"ErrorResponse":{"type":"object","properties":{"message":{"type":"string"},"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}}},"FlowVersionsUploadUploadRequest":{"type":"object","properties":{"private":{"type":"string"}}}}},"paths":{"/api/v1/flow-versions/{flow_version}/upload":{"post":{"summary":"Upload Flow Version","description":"Uploads a given flow version to your `private` marketplace.\n\nThis operation requires `administrator` permissions. If you are authorising requests with an API key, this request won't work (company-level API keys are associated with manager-level permissions). If you are an `administrator`, you can use OAuth 2 credentials to complete this operation. For more information please see our [Authentication](https://doc.wearepatchworks.com/product-documentation/api-reference/getting-started/authentication#oauth-2-client-credentials) section.","parameters":[{"name":"flow_version","in":"path","required":true,"schema":{"type":"string"},"description":"The flow version identifier."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Unauthenticated"},"403":{"description":"Unauthorized"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlowVersionsUploadUploadRequest"}}}},"tags":["Flow Versions"]}}}}
```

## List Flow Version Metrics

> Retrieves paginated metrics for a flow's versions. Results can be filtered by time interval, metric type, and key.

```json
{"openapi":"3.0.0","info":{"title":"Patchworks Core API","version":"1.0.0"},"tags":[{"name":"Flow Versions"}],"servers":[{"url":"https://core.wearepatchworks.com"}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"Authorization","description":"API key passed in the Authorization header. Format: `<api-key>`"},"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"OAuth 2 Bearer token obtained from POST /fabric/api/login"}},"schemas":{"FlowsListResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Flows"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"},"links":{"$ref":"#/components/schemas/PaginationLinks"}}},"Flows":{"type":"object","properties":{"id":{"type":"integer","description":"Unique identifier"},"name":{"type":"string"},"enabled_at":{"type":"string","format":"date-time"},"status":{"type":"string","enum":["Draft","Inactive","Deployed"]},"format":{"type":"string","enum":["csv","json","txt","xml"]},"body":{"type":"string"},"deployed_at":{"type":"string"},"labels":{"type":"string","items":{"type":"object"}},"notification_groups":{"type":"string"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"description":{"type":"string"},"layout_direction":{"type":"string"},"is_enabled":{"type":"object"},"latest_version":{"type":"object"},"current_version":{"type":"object"},"deployed_version":{"type":"object"},"latest_deployed_version":{"type":"array","items":{"type":"object"}},"versions":{"type":"array","items":{"type":"object"}},"version_type_counts":{"type":"array","items":{"type":"object"}},"message_brokers":{"type":"array","items":{"type":"object"}},"message_broker_queues":{"type":"array","items":{"type":"object"}},"notification_group_ids":{"type":"array","items":{"type":"object"}},"webhooks":{"type":"string"},"callbacks":{"type":"string"},"current_version_step_count":{"type":"integer"},"current_version_connector_count":{"type":"integer"},"current_version_script_count":{"type":"integer"},"current_version_cache_count":{"type":"integer"},"current_version_data_pool_count":{"type":"integer"},"current_version_cross_ref_count":{"type":"integer"},"use_queued_time":{"type":"string"},"remove_failed_payloads":{"type":"array","items":{"type":"object"}},"priority":{"type":"array","items":{"type":"object"}},"prod_flag":{"type":"array","items":{"type":"object"}},"deployments":{"type":"array","items":{"type":"object"}},"webhooks_count":{"type":"integer"},"callbacks_count":{"type":"integer"},"marketplace_app_id":{"type":"integer"},"blueprint_id":{"type":"integer"},"blueprint_version_number":{"type":"string"},"flow_folder_id":{"type":"integer"}}},"PaginationMeta":{"type":"object","properties":{"current_page":{"type":"integer"},"from":{"type":"integer","nullable":true},"last_page":{"type":"integer"},"path":{"type":"string"},"per_page":{"type":"integer"},"to":{"type":"integer","nullable":true},"total":{"type":"integer"}}},"PaginationLinks":{"type":"object","properties":{"first":{"type":"string","format":"uri"},"last":{"type":"string","format":"uri"},"prev":{"type":"string","format":"uri","nullable":true},"next":{"type":"string","format":"uri","nullable":true}}}}},"paths":{"/api/v1/flows/{flow}/version-metrics":{"get":{"summary":"List Flow Version Metrics","description":"Retrieves paginated metrics for a flow's versions. Results can be filtered by time interval, metric type, and key.","parameters":[{"name":"flow","in":"path","required":true,"schema":{"type":"string"},"description":"The flow identifier."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlowsListResponse"}}}},"401":{"description":"Unauthenticated"},"403":{"description":"Unauthorized"}},"tags":["Flow Versions"]}}}}
```

## List Flow Version Schedules

> Retrieves a paginated list of all schedules for a specific flow version.

```json
{"openapi":"3.0.0","info":{"title":"Patchworks Core API","version":"1.0.0"},"tags":[{"name":"Flow Versions"}],"servers":[{"url":"https://core.wearepatchworks.com"}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"Authorization","description":"API key passed in the Authorization header. Format: `<api-key>`"},"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"OAuth 2 Bearer token obtained from POST /fabric/api/login"}},"schemas":{"FlowVersionsListResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/FlowVersions"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"},"links":{"$ref":"#/components/schemas/PaginationLinks"}}},"FlowVersions":{"type":"object","properties":{"id":{"type":"integer","description":"Unique identifier"},"virtual_environment_id":{"type":"string"},"flow_version_id":{"type":"string"},"priority":{"type":"integer"},"cron_string":{"type":"string"},"microservice":{"type":"string"},"config":{"type":"string"},"flow_step_route_id":{"type":"integer"},"variables":{"type":"string","items":{"type":"object"}},"parent_id":{"type":"integer"},"type":{"type":"string"},"key":{"type":"string"},"value":{"type":"string"},"date_format":{"type":"string"},"secret":{"type":"string"},"enabled_at":{"type":"string"},"created_at":{"type":"string","format":"date-time","items":{"type":"object"}},"updated_at":{"type":"string","format":"date-time","items":{"type":"object"}},"flow_id":{"type":"integer"},"flow_name":{"type":"string"},"flow_priority":{"type":"string"},"iteration":{"type":"string"},"status":{"type":"string","enum":["Draft","Inactive","Deployed"]},"is_deployed":{"type":"boolean"},"is_editable":{"type":"boolean"},"deployed_at":{"type":"object","format":"date-time"},"deployed_by":{"type":"object"},"deployed_by_user":{"type":"object"},"deployments":{"type":"array","items":{"type":"object"}},"has_callback_step":{"type":"array","items":{"type":"object"}},"steps":{"type":"array","items":{"type":"object"}},"runs":{"type":"string"},"latest_run":{"type":"string"},"schedules":{"type":"string"},"filters":{"type":"array","items":{"type":"object"}},"steps_count":{"type":"array","items":{"type":"object"}},"pivot":{"type":"string"},"saved_at":{"type":"string","format":"date-time"},"saved_by":{"type":"string"},"saved_by_user":{"type":"object"}}},"PaginationMeta":{"type":"object","properties":{"current_page":{"type":"integer"},"from":{"type":"integer","nullable":true},"last_page":{"type":"integer"},"path":{"type":"string"},"per_page":{"type":"integer"},"to":{"type":"integer","nullable":true},"total":{"type":"integer"}}},"PaginationLinks":{"type":"object","properties":{"first":{"type":"string","format":"uri"},"last":{"type":"string","format":"uri"},"prev":{"type":"string","format":"uri","nullable":true},"next":{"type":"string","format":"uri","nullable":true}}}}},"paths":{"/api/v1/flow-versions/{flow_version}/schedules":{"get":{"summary":"List Flow Version Schedules","description":"Retrieves a paginated list of all schedules for a specific flow version.","parameters":[{"name":"flow_version","in":"path","required":true,"schema":{"type":"string"},"description":"The flow version identifier."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlowVersionsListResponse"}}}},"401":{"description":"Unauthenticated"},"403":{"description":"Unauthorized"}},"tags":["Flow Versions"]}}}}
```

## Create Flow Version Schedule

> Creates a new schedule for a flow version using a \`cron\_string\`.

```json
{"openapi":"3.0.0","info":{"title":"Patchworks Core API","version":"1.0.0"},"tags":[{"name":"Flow Versions"}],"servers":[{"url":"https://core.wearepatchworks.com"}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"Authorization","description":"API key passed in the Authorization header. Format: `<api-key>`"},"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"OAuth 2 Bearer token obtained from POST /fabric/api/login"}},"schemas":{"FlowVersionsResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/FlowVersions"}}},"FlowVersions":{"type":"object","properties":{"id":{"type":"integer","description":"Unique identifier"},"virtual_environment_id":{"type":"string"},"flow_version_id":{"type":"string"},"priority":{"type":"integer"},"cron_string":{"type":"string"},"microservice":{"type":"string"},"config":{"type":"string"},"flow_step_route_id":{"type":"integer"},"variables":{"type":"string","items":{"type":"object"}},"parent_id":{"type":"integer"},"type":{"type":"string"},"key":{"type":"string"},"value":{"type":"string"},"date_format":{"type":"string"},"secret":{"type":"string"},"enabled_at":{"type":"string"},"created_at":{"type":"string","format":"date-time","items":{"type":"object"}},"updated_at":{"type":"string","format":"date-time","items":{"type":"object"}},"flow_id":{"type":"integer"},"flow_name":{"type":"string"},"flow_priority":{"type":"string"},"iteration":{"type":"string"},"status":{"type":"string","enum":["Draft","Inactive","Deployed"]},"is_deployed":{"type":"boolean"},"is_editable":{"type":"boolean"},"deployed_at":{"type":"object","format":"date-time"},"deployed_by":{"type":"object"},"deployed_by_user":{"type":"object"},"deployments":{"type":"array","items":{"type":"object"}},"has_callback_step":{"type":"array","items":{"type":"object"}},"steps":{"type":"array","items":{"type":"object"}},"runs":{"type":"string"},"latest_run":{"type":"string"},"schedules":{"type":"string"},"filters":{"type":"array","items":{"type":"object"}},"steps_count":{"type":"array","items":{"type":"object"}},"pivot":{"type":"string"},"saved_at":{"type":"string","format":"date-time"},"saved_by":{"type":"string"},"saved_by_user":{"type":"object"}}},"ErrorResponse":{"type":"object","properties":{"message":{"type":"string"},"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}}},"FlowVersionsStoreSchedulesRequest":{"type":"object","properties":{"cron_string":{"type":"string"},"deployed_at":{"type":"string","format":"date-time","nullable":true}},"required":["cron_string"]}}},"paths":{"/api/v1/flow-versions/{flow_version}/schedules":{"post":{"summary":"Create Flow Version Schedule","description":"Creates a new schedule for a flow version using a `cron_string`.","parameters":[{"name":"flow_version","in":"path","required":true,"schema":{"type":"string"},"description":"The flow version identifier."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlowVersionsResponse"}}}},"401":{"description":"Unauthenticated"},"403":{"description":"Unauthorized"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlowVersionsStoreSchedulesRequest"}}}},"tags":["Flow Versions"]}}}}
```

## Update Flow Version Schedule

> Updates the \`cron\_string\` for an existing flow version schedule.

```json
{"openapi":"3.0.0","info":{"title":"Patchworks Core API","version":"1.0.0"},"tags":[{"name":"Flow Versions"}],"servers":[{"url":"https://core.wearepatchworks.com"}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"Authorization","description":"API key passed in the Authorization header. Format: `<api-key>`"},"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"OAuth 2 Bearer token obtained from POST /fabric/api/login"}},"schemas":{"FlowVersionsResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/FlowVersions"}}},"FlowVersions":{"type":"object","properties":{"id":{"type":"integer","description":"Unique identifier"},"virtual_environment_id":{"type":"string"},"flow_version_id":{"type":"string"},"priority":{"type":"integer"},"cron_string":{"type":"string"},"microservice":{"type":"string"},"config":{"type":"string"},"flow_step_route_id":{"type":"integer"},"variables":{"type":"string","items":{"type":"object"}},"parent_id":{"type":"integer"},"type":{"type":"string"},"key":{"type":"string"},"value":{"type":"string"},"date_format":{"type":"string"},"secret":{"type":"string"},"enabled_at":{"type":"string"},"created_at":{"type":"string","format":"date-time","items":{"type":"object"}},"updated_at":{"type":"string","format":"date-time","items":{"type":"object"}},"flow_id":{"type":"integer"},"flow_name":{"type":"string"},"flow_priority":{"type":"string"},"iteration":{"type":"string"},"status":{"type":"string","enum":["Draft","Inactive","Deployed"]},"is_deployed":{"type":"boolean"},"is_editable":{"type":"boolean"},"deployed_at":{"type":"object","format":"date-time"},"deployed_by":{"type":"object"},"deployed_by_user":{"type":"object"},"deployments":{"type":"array","items":{"type":"object"}},"has_callback_step":{"type":"array","items":{"type":"object"}},"steps":{"type":"array","items":{"type":"object"}},"runs":{"type":"string"},"latest_run":{"type":"string"},"schedules":{"type":"string"},"filters":{"type":"array","items":{"type":"object"}},"steps_count":{"type":"array","items":{"type":"object"}},"pivot":{"type":"string"},"saved_at":{"type":"string","format":"date-time"},"saved_by":{"type":"string"},"saved_by_user":{"type":"object"}}},"ErrorResponse":{"type":"object","properties":{"message":{"type":"string"},"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}}},"FlowVersionsUpdateSchedulesRequest":{"type":"object","properties":{"cron_string":{"type":"string"},"deployed_at":{"type":"string","format":"date-time","nullable":true}}}}},"paths":{"/api/v1/flow-versions/{flow_version}/schedules/{schedule}":{"put":{"summary":"Update Flow Version Schedule","description":"Updates the `cron_string` for an existing flow version schedule.","parameters":[{"name":"flow_version","in":"path","required":true,"schema":{"type":"string"},"description":"The flow version identifier."},{"name":"schedule","in":"path","required":true,"schema":{"type":"string"},"description":"The schedule identifier."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlowVersionsResponse"}}}},"401":{"description":"Unauthenticated"},"403":{"description":"Unauthorized"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlowVersionsUpdateSchedulesRequest"}}}},"tags":["Flow Versions"]}}}}
```

## Delete Flow Version Schedule

> Permanently deletes a specific flow version schedule.

```json
{"openapi":"3.0.0","info":{"title":"Patchworks Core API","version":"1.0.0"},"tags":[{"name":"Flow Versions"}],"servers":[{"url":"https://core.wearepatchworks.com"}],"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"Authorization","description":"API key passed in the Authorization header. Format: `<api-key>`"},"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"OAuth 2 Bearer token obtained from POST /fabric/api/login"}},"schemas":{"MessageResponse":{"type":"object","properties":{"message":{"type":"string"}}}}},"paths":{"/api/v1/flow-versions/{flow_version}/schedules/{schedule}":{"delete":{"summary":"Delete Flow Version Schedule","description":"Permanently deletes a specific flow version schedule.","parameters":[{"name":"flow_version","in":"path","required":true,"schema":{"type":"string"},"description":"The flow version identifier."},{"name":"schedule","in":"path","required":true,"schema":{"type":"string"},"description":"The schedule identifier."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"401":{"description":"Unauthenticated"},"403":{"description":"Unauthorized"}},"tags":["Flow Versions"]}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://doc.wearepatchworks.com/product-documentation/api-reference/flow-actions/flow-versions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
