# Flow Templates

## List Flow Templates

> Retrieves a paginated list of flow templates included in marketplace blueprints.

```json
{"openapi":"3.0.0","info":{"title":"Patchworks Core API","version":"1.0.0"},"tags":[{"name":"Flow Templates"}],"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":{"FlowTemplatesListResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/FlowTemplates"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"},"links":{"$ref":"#/components/schemas/PaginationLinks"}}},"FlowTemplates":{"type":"object","properties":{"id":{"type":"integer","description":"Unique identifier"},"created_at":{"type":"string","format":"date-time","items":{"type":"object"}},"updated_at":{"type":"string","format":"date-time"},"name":{"type":"string"},"description":{"type":"string"},"step_count":{"type":"integer"},"cross_ref_count":{"type":"integer"},"script_count":{"type":"integer"},"system_count":{"type":"integer"},"webhook_count":{"type":"array","items":{"type":"object"}},"advanced":{"type":"array","items":{"type":"object"}},"system_templates":{"type":"array","items":{"type":"object"}},"steps":{"type":"array","items":{"type":"object"}},"schedules":{"type":"object"},"marketplace_company_id":{"type":"object"},"marketplace_company":{"type":"object"},"public_company_id":{"type":"object"},"public_company":{"type":"object"},"blueprint_id":{"type":"array","items":{"type":"object"}},"blueprint_version_number":{"type":"array","items":{"type":"object"}},"labels":{"type":"array","items":{"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/patchworks/flow-templates":{"get":{"summary":"List Flow Templates","description":"Retrieves a paginated list of flow templates included in marketplace blueprints.","parameters":[{"name":"filter[name]","in":"query","required":false,"schema":{"type":"string"},"description":"Filter results by name."},{"name":"filter[hidden_from_marketplace]","in":"query","required":false,"schema":{"type":"string"},"description":"Filter results by hidden_from_marketplace."},{"name":"filter[visible_for_marketplace]","in":"query","required":false,"schema":{"type":"string"},"description":"Filter results by visible_for_marketplace."},{"name":"filter[id]","in":"query","required":false,"schema":{"type":"string"},"description":"Filter results by id."},{"name":"filter[blueprint_id]","in":"query","required":false,"schema":{"type":"string"},"description":"Filter results by blueprint_id."},{"name":"filter[,]","in":"query","required":false,"schema":{"type":"string"},"description":"Filter results by ,."},{"name":"filter[marketplaceApps]","in":"query","required":false,"schema":{"type":"string"},"description":"Filter results by marketplaceApps."},{"name":"filter[marketplace_apps.blueprint_id]","in":"query","required":false,"schema":{"type":"string"},"description":"Filter results by marketplace_apps.blueprint_id."},{"name":"filter[blueprint_version_number]","in":"query","required":false,"schema":{"type":"string"},"description":"Filter results by blueprint_version_number."},{"name":"filter[marketplace_apps.version]","in":"query","required":false,"schema":{"type":"string"},"description":"Filter results by marketplace_apps.version."},{"name":"filter[private]","in":"query","required":false,"schema":{"type":"string"},"description":"Filter results by private."},{"name":"filter[visibility]","in":"query","required":false,"schema":{"type":"string"},"description":"Filter results by visibility."},{"name":"include","in":"query","required":false,"schema":{"type":"string"},"description":"Comma-separated list of relationships to include. Available: systemTemplates.logo, flowStepTemplates, flowStepTemplates.children, flowStepTemplates.parentFlowStep, flowTemplateSchedules, marketplaceCompany, publicCompany, marketplaceApps"},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1},"description":"Page number for pagination."},{"name":"per_page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100},"description":"Number of results per page."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlowTemplatesListResponse"}}}},"401":{"description":"Unauthenticated"},"403":{"description":"Unauthorized"}},"tags":["Flow Templates"]}}}}
```

## Get Flow Template

> Retrieves the details of a specific flow template included in a marketplace blueprint.

```json
{"openapi":"3.0.0","info":{"title":"Patchworks Core API","version":"1.0.0"},"tags":[{"name":"Flow Templates"}],"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":{"FlowTemplatesResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/FlowTemplates"}}},"FlowTemplates":{"type":"object","properties":{"id":{"type":"integer","description":"Unique identifier"},"created_at":{"type":"string","format":"date-time","items":{"type":"object"}},"updated_at":{"type":"string","format":"date-time"},"name":{"type":"string"},"description":{"type":"string"},"step_count":{"type":"integer"},"cross_ref_count":{"type":"integer"},"script_count":{"type":"integer"},"system_count":{"type":"integer"},"webhook_count":{"type":"array","items":{"type":"object"}},"advanced":{"type":"array","items":{"type":"object"}},"system_templates":{"type":"array","items":{"type":"object"}},"steps":{"type":"array","items":{"type":"object"}},"schedules":{"type":"object"},"marketplace_company_id":{"type":"object"},"marketplace_company":{"type":"object"},"public_company_id":{"type":"object"},"public_company":{"type":"object"},"blueprint_id":{"type":"array","items":{"type":"object"}},"blueprint_version_number":{"type":"array","items":{"type":"object"}},"labels":{"type":"array","items":{"type":"object"}}}}}},"paths":{"/api/v1/patchworks/flow-templates/{flow_template}":{"get":{"summary":"Get Flow Template","description":"Retrieves the details of a specific flow template included in a marketplace blueprint.","parameters":[{"name":"flow_template","in":"path","required":true,"schema":{"type":"string"},"description":"The flow template identifier."},{"name":"filter[name]","in":"query","required":false,"schema":{"type":"string"},"description":"Filter results by name."},{"name":"filter[hidden_from_marketplace]","in":"query","required":false,"schema":{"type":"string"},"description":"Filter results by hidden_from_marketplace."},{"name":"filter[visible_for_marketplace]","in":"query","required":false,"schema":{"type":"string"},"description":"Filter results by visible_for_marketplace."},{"name":"filter[id]","in":"query","required":false,"schema":{"type":"string"},"description":"Filter results by id."},{"name":"filter[blueprint_id]","in":"query","required":false,"schema":{"type":"string"},"description":"Filter results by blueprint_id."},{"name":"filter[,]","in":"query","required":false,"schema":{"type":"string"},"description":"Filter results by ,."},{"name":"filter[marketplaceApps]","in":"query","required":false,"schema":{"type":"string"},"description":"Filter results by marketplaceApps."},{"name":"filter[marketplace_apps.blueprint_id]","in":"query","required":false,"schema":{"type":"string"},"description":"Filter results by marketplace_apps.blueprint_id."},{"name":"filter[blueprint_version_number]","in":"query","required":false,"schema":{"type":"string"},"description":"Filter results by blueprint_version_number."},{"name":"filter[marketplace_apps.version]","in":"query","required":false,"schema":{"type":"string"},"description":"Filter results by marketplace_apps.version."},{"name":"filter[private]","in":"query","required":false,"schema":{"type":"string"},"description":"Filter results by private."},{"name":"filter[visibility]","in":"query","required":false,"schema":{"type":"string"},"description":"Filter results by visibility."},{"name":"include","in":"query","required":false,"schema":{"type":"string"},"description":"Comma-separated list of relationships to include. Available: systemTemplates.logo, flowStepTemplates, flowStepTemplates.children, flowStepTemplates.parentFlowStep, flowTemplateSchedules, marketplaceCompany, publicCompany, marketplaceApps"},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1},"description":"Page number for pagination."},{"name":"per_page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100},"description":"Number of results per page."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlowTemplatesResponse"}}}},"401":{"description":"Unauthenticated"},"403":{"description":"Unauthorized"}},"tags":["Flow Templates"]}}}}
```

## Delete Flow Template

> Permanently deletes a specific flow template.

```json
{"openapi":"3.0.0","info":{"title":"Patchworks Core API","version":"1.0.0"},"tags":[{"name":"Flow Templates"}],"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/patchworks/flow-templates/{flow_template}":{"delete":{"summary":"Delete Flow Template","description":"Permanently deletes a specific flow template.","parameters":[{"name":"flow_template","in":"path","required":true,"schema":{"type":"string"},"description":"The flow template identifier."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"401":{"description":"Unauthenticated"},"403":{"description":"Unauthorized"}},"tags":["Flow Templates"]}}}}
```

## List Flow Template Steps

> Retrieves a paginated list of steps for a specific flow template.

```json
{"openapi":"3.0.0","info":{"title":"Patchworks Core API","version":"1.0.0"},"tags":[{"name":"Flow Templates"}],"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":{"PatchworksListResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Patchworks"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"},"links":{"$ref":"#/components/schemas/PaginationLinks"}}},"Patchworks":{"type":"object","properties":{"id":{"type":"integer","description":"Unique identifier"},"label":{"type":"string"},"colour":{"type":"string","enum":["blue","blue_inverted","cyan","cyan_inverted","gray","gray_inverted","green","green_inverted","orange","orange_inverted","pink","pink_inverted","purple","purple_inverted","red","red_inverted","yellow","yellow_inverted"]},"logo_url":{"type":"string"},"version":{"type":"integer"},"version_name":{"type":"string"},"rate_limit_unit":{"type":"string","enum":["second","minute","hour","day"]},"rate_limit_duration":{"type":"integer"},"system_type_id":{"type":"string"},"protocol":{"type":"string","enum":["HTTP","FTP","SFTP","FTPS","S3","MySQL","PGSQL","SQLSRV"]},"company_id":{"type":"string"},"date_format":{"type":"string"},"help_link":{"type":"string"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}},"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/patchworks/flow-templates/{flow_template}/steps":{"get":{"summary":"List Flow Template Steps","description":"Retrieves a paginated list of steps for a specific flow template.","parameters":[{"name":"flow_template","in":"path","required":true,"schema":{"type":"string"},"description":"The flow template identifier."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PatchworksListResponse"}}}},"401":{"description":"Unauthenticated"},"403":{"description":"Unauthorized"}},"tags":["Flow Templates"]}}}}
```

## Install Flow Template

> Installs a specific flow template from a marketplace blueprint.

```json
{"openapi":"3.0.0","info":{"title":"Patchworks Core API","version":"1.0.0"},"tags":[{"name":"Flow Templates"}],"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/flow-templates/{flow_template}/install":{"post":{"summary":"Install Flow Template","description":"Installs a specific flow template from a marketplace blueprint.","parameters":[{"name":"flow_template","in":"path","required":true,"schema":{"type":"string"},"description":"The flow template 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 Templates"]}}}}
```
