# Message Broker Queues

## Create Message Broker Queue Flow

> Assigns a flow to a specific message broker queue.

```json
{"openapi":"3.0.0","info":{"title":"Patchworks Core API","version":"1.0.0"},"tags":[{"name":"Message Broker Queues"}],"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"}}}}},"MessageBrokerQueuesStoreFlowsRequest":{"type":"object","properties":{"flow_id":{"type":"integer"}},"required":["flow_id"]}}},"paths":{"/api/v1/message-broker-queues/{message_broker_queue}/flows":{"post":{"summary":"Create Message Broker Queue Flow","description":"Assigns a flow to a specific message broker queue.","parameters":[{"name":"message_broker_queue","in":"path","required":true,"schema":{"type":"string"},"description":"The message broker queue 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/MessageBrokerQueuesStoreFlowsRequest"}}}},"tags":["Message Broker Queues"]}}}}
```

## Delete Message Broker Queue Flow

> Removes a flow from a specific message broker queue.

```json
{"openapi":"3.0.0","info":{"title":"Patchworks Core API","version":"1.0.0"},"tags":[{"name":"Message Broker Queues"}],"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/message-broker-queues/{message_broker_queue}/flows/{flow}":{"delete":{"summary":"Delete Message Broker Queue Flow","description":"Removes a flow from a specific message broker queue.","parameters":[{"name":"message_broker_queue","in":"path","required":true,"schema":{"type":"string"},"description":"The message broker queue identifier."},{"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/MessageResponse"}}}},"401":{"description":"Unauthenticated"},"403":{"description":"Unauthorized"}},"tags":["Message Broker Queues"]}}}}
```

## List Message Brokers

> Retrieves a paginated list of queues for a specific message broker.

```json
{"openapi":"3.0.0","info":{"title":"Patchworks Core API","version":"1.0.0"},"tags":[{"name":"Message Broker Queues"}],"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":{"MessageBrokerQueuesListResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/MessageBrokerQueues"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"},"links":{"$ref":"#/components/schemas/PaginationLinks"}}},"MessageBrokerQueues":{"type":"object","properties":{"id":{"type":"integer","description":"Unique identifier","items":{"type":"object"}},"flow_id":{"type":"integer"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"name":{"type":"array","items":{"type":"object"}},"message_broker_id":{"type":"array","items":{"type":"object"}},"flows":{"type":"array","items":{"type":"object"}},"message_broker":{"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/message-brokers/{message_broker}/message-broker-queues":{"get":{"summary":"List Message Brokers","description":"Retrieves a paginated list of queues for a specific message broker.","parameters":[{"name":"message_broker","in":"path","required":true,"schema":{"type":"string"},"description":"The message broker identifier."},{"name":"filter[name]","in":"query","required":false,"schema":{"type":"string"},"description":"Filter results by name."},{"name":"filter[message_broker_id]","in":"query","required":false,"schema":{"type":"string"},"description":"Filter results by message_broker_id."},{"name":"include","in":"query","required":false,"schema":{"type":"string"},"description":"Comma-separated list of relationships to include. Available: flows, messageBroker"},{"name":"sort","in":"query","required":false,"schema":{"type":"string"},"description":"Sort field. Prefix with - for descending. Available: name, message_broker_id"},{"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/MessageBrokerQueuesListResponse"}}}},"401":{"description":"Unauthenticated"},"403":{"description":"Unauthorized"}},"tags":["Message Broker Queues"]}}}}
```

## Create Message Broker

> Creates a new queue for a specific message broker.

```json
{"openapi":"3.0.0","info":{"title":"Patchworks Core API","version":"1.0.0"},"tags":[{"name":"Message Broker Queues"}],"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":{"MessageBrokerQueuesResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/MessageBrokerQueues"}}},"MessageBrokerQueues":{"type":"object","properties":{"id":{"type":"integer","description":"Unique identifier","items":{"type":"object"}},"flow_id":{"type":"integer"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"name":{"type":"array","items":{"type":"object"}},"message_broker_id":{"type":"array","items":{"type":"object"}},"flows":{"type":"array","items":{"type":"object"}},"message_broker":{"type":"object"}}},"ErrorResponse":{"type":"object","properties":{"message":{"type":"string"},"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}}}}},"paths":{"/api/v1/message-brokers/{message_broker}/message-broker-queues":{"post":{"summary":"Create Message Broker","description":"Creates a new queue for a specific message broker.","parameters":[{"name":"message_broker","in":"path","required":true,"schema":{"type":"string"},"description":"The message broker identifier."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageBrokerQueuesResponse"}}}},"401":{"description":"Unauthenticated"},"403":{"description":"Unauthorized"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"tags":["Message Broker Queues"]}}}}
```

## Get Message Broker

> Retrieves the details of a specific message broker queue.

```json
{"openapi":"3.0.0","info":{"title":"Patchworks Core API","version":"1.0.0"},"tags":[{"name":"Message Broker Queues"}],"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":{"MessageBrokerQueuesResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/MessageBrokerQueues"}}},"MessageBrokerQueues":{"type":"object","properties":{"id":{"type":"integer","description":"Unique identifier","items":{"type":"object"}},"flow_id":{"type":"integer"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"name":{"type":"array","items":{"type":"object"}},"message_broker_id":{"type":"array","items":{"type":"object"}},"flows":{"type":"array","items":{"type":"object"}},"message_broker":{"type":"object"}}}}},"paths":{"/api/v1/message-brokers/{message_broker}/message-broker-queues/{message_broker_queue}":{"get":{"summary":"Get Message Broker","description":"Retrieves the details of a specific message broker queue.","parameters":[{"name":"message_broker","in":"path","required":true,"schema":{"type":"string"},"description":"The message broker identifier."},{"name":"message_broker_queue","in":"path","required":true,"schema":{"type":"string"},"description":"The message broker queue identifier."},{"name":"filter[name]","in":"query","required":false,"schema":{"type":"string"},"description":"Filter results by name."},{"name":"filter[message_broker_id]","in":"query","required":false,"schema":{"type":"string"},"description":"Filter results by message_broker_id."},{"name":"include","in":"query","required":false,"schema":{"type":"string"},"description":"Comma-separated list of relationships to include. Available: flows, messageBroker"},{"name":"sort","in":"query","required":false,"schema":{"type":"string"},"description":"Sort field. Prefix with - for descending. Available: name, message_broker_id"},{"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/MessageBrokerQueuesResponse"}}}},"401":{"description":"Unauthenticated"},"403":{"description":"Unauthorized"}},"tags":["Message Broker Queues"]}}}}
```

## Update Message Broker

> Updates an existing message broker queue.

```json
{"openapi":"3.0.0","info":{"title":"Patchworks Core API","version":"1.0.0"},"tags":[{"name":"Message Broker Queues"}],"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":{"MessageBrokerQueuesResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/MessageBrokerQueues"}}},"MessageBrokerQueues":{"type":"object","properties":{"id":{"type":"integer","description":"Unique identifier","items":{"type":"object"}},"flow_id":{"type":"integer"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"name":{"type":"array","items":{"type":"object"}},"message_broker_id":{"type":"array","items":{"type":"object"}},"flows":{"type":"array","items":{"type":"object"}},"message_broker":{"type":"object"}}},"ErrorResponse":{"type":"object","properties":{"message":{"type":"string"},"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}}}}},"paths":{"/api/v1/message-brokers/{message_broker}/message-broker-queues/{message_broker_queue}":{"put":{"summary":"Update Message Broker","description":"Updates an existing message broker queue.","parameters":[{"name":"message_broker","in":"path","required":true,"schema":{"type":"string"},"description":"The message broker identifier."},{"name":"message_broker_queue","in":"path","required":true,"schema":{"type":"string"},"description":"The message broker queue identifier."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageBrokerQueuesResponse"}}}},"401":{"description":"Unauthenticated"},"403":{"description":"Unauthorized"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"tags":["Message Broker Queues"]}}}}
```

## Delete Message Broker

> Permanently deletes a specific message broker queue.

```json
{"openapi":"3.0.0","info":{"title":"Patchworks Core API","version":"1.0.0"},"tags":[{"name":"Message Broker Queues"}],"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/message-brokers/{message_broker}/message-broker-queues/{message_broker_queue}":{"delete":{"summary":"Delete Message Broker","description":"Permanently deletes a specific message broker queue.","parameters":[{"name":"message_broker","in":"path","required":true,"schema":{"type":"string"},"description":"The message broker identifier."},{"name":"message_broker_queue","in":"path","required":true,"schema":{"type":"string"},"description":"The message broker queue identifier."}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"401":{"description":"Unauthenticated"},"403":{"description":"Unauthorized"}},"tags":["Message Broker Queues"]}}}}
```
