# Message Brokers

## List Message Brokers

> Retrieves a paginated list of message brokers.

```json
{"openapi":"3.0.0","info":{"title":"Patchworks Core API","version":"1.0.0"},"tags":[{"name":"Message Brokers"}],"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":{"MessageBrokersListResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/MessageBrokers"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"},"links":{"$ref":"#/components/schemas/PaginationLinks"}}},"MessageBrokers":{"type":"object","properties":{"id":{"type":"integer","description":"Unique identifier"},"description":{"type":"string"},"host":{"type":"string","items":{"type":"object"}},"port":{"type":"integer","items":{"type":"object"}},"protocol":{"type":"string","enum":["HTTP","FTP","SFTP","FTPS","S3","MySQL","PGSQL","SQLSRV"],"items":{"type":"object"}},"auth_type":{"type":"string","items":{"type":"object"}},"variables":{"type":"string","items":{"type":"object"}},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"name":{"type":"string"},"flows":{"type":"array","items":{"type":"object"}},"message_broker_queues":{"type":"array","items":{"type":"object"}},"message_broker_queues_count":{"type":"array","items":{"type":"object"}},"flow_message_broker_queues":{"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/message-brokers":{"get":{"summary":"List Message Brokers","description":"Retrieves a paginated list of message brokers.","parameters":[{"name":"filter[name]","in":"query","required":false,"schema":{"type":"string"},"description":"Filter results by name."},{"name":"filter[description]","in":"query","required":false,"schema":{"type":"string"},"description":"Filter results by description."},{"name":"filter[host]","in":"query","required":false,"schema":{"type":"string"},"description":"Filter results by host."},{"name":"filter[protocol]","in":"query","required":false,"schema":{"type":"string"},"description":"Filter results by protocol."},{"name":"filter[auth_type]","in":"query","required":false,"schema":{"type":"string"},"description":"Filter results by auth_type."},{"name":"filter[port]","in":"query","required":false,"schema":{"type":"string"},"description":"Filter results by port."},{"name":"include","in":"query","required":false,"schema":{"type":"string"},"description":"Comma-separated list of relationships to include. Available: flows, messageBrokerQueues, variables, flowMessageBrokerQueues"},{"name":"sort","in":"query","required":false,"schema":{"type":"string"},"description":"Sort field. Prefix with - for descending. Available: name, description, host, port, protocol, auth_type"},{"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/MessageBrokersListResponse"}}}},"401":{"description":"Unauthenticated"},"403":{"description":"Unauthorized"}},"tags":["Message Brokers"]}}}}
```

## Create Message Broker

> Creates a new message broker.

```json
{"openapi":"3.0.0","info":{"title":"Patchworks Core API","version":"1.0.0"},"tags":[{"name":"Message Brokers"}],"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":{"MessageBrokersResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/MessageBrokers"}}},"MessageBrokers":{"type":"object","properties":{"id":{"type":"integer","description":"Unique identifier"},"description":{"type":"string"},"host":{"type":"string","items":{"type":"object"}},"port":{"type":"integer","items":{"type":"object"}},"protocol":{"type":"string","enum":["HTTP","FTP","SFTP","FTPS","S3","MySQL","PGSQL","SQLSRV"],"items":{"type":"object"}},"auth_type":{"type":"string","items":{"type":"object"}},"variables":{"type":"string","items":{"type":"object"}},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"name":{"type":"string"},"flows":{"type":"array","items":{"type":"object"}},"message_broker_queues":{"type":"array","items":{"type":"object"}},"message_broker_queues_count":{"type":"array","items":{"type":"object"}},"flow_message_broker_queues":{"type":"array","items":{"type":"object"}}}},"ErrorResponse":{"type":"object","properties":{"message":{"type":"string"},"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}}},"MessageBrokersStoreRequest":{"type":"object","properties":{"description":{"type":"string","maxLength":100},"host":{"type":"string"},"port":{"type":"integer"},"protocol":{"type":"string","enum":["HTTP","FTP","SFTP","FTPS","S3","MySQL","PGSQL","SQLSRV"]},"auth_type":{"type":"string"},"name":{"type":"string","maxLength":40,"pattern":"^[a-zA-Z0-9 -]+$"}},"required":["auth_type","description","host","name","port","protocol"]}}},"paths":{"/api/v1/message-brokers":{"post":{"summary":"Create Message Broker","description":"Creates a new message broker.","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageBrokersResponse"}}}},"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/MessageBrokersStoreRequest"}}}},"tags":["Message Brokers"],"parameters":[]}}}}
```

## Get Message Broker

> Retrieves the details of a specific message broker.

```json
{"openapi":"3.0.0","info":{"title":"Patchworks Core API","version":"1.0.0"},"tags":[{"name":"Message Brokers"}],"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":{"MessageBrokersResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/MessageBrokers"}}},"MessageBrokers":{"type":"object","properties":{"id":{"type":"integer","description":"Unique identifier"},"description":{"type":"string"},"host":{"type":"string","items":{"type":"object"}},"port":{"type":"integer","items":{"type":"object"}},"protocol":{"type":"string","enum":["HTTP","FTP","SFTP","FTPS","S3","MySQL","PGSQL","SQLSRV"],"items":{"type":"object"}},"auth_type":{"type":"string","items":{"type":"object"}},"variables":{"type":"string","items":{"type":"object"}},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"name":{"type":"string"},"flows":{"type":"array","items":{"type":"object"}},"message_broker_queues":{"type":"array","items":{"type":"object"}},"message_broker_queues_count":{"type":"array","items":{"type":"object"}},"flow_message_broker_queues":{"type":"array","items":{"type":"object"}}}}}},"paths":{"/api/v1/message-brokers/{message_broker}":{"get":{"summary":"Get Message Broker","description":"Retrieves the details of 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[description]","in":"query","required":false,"schema":{"type":"string"},"description":"Filter results by description."},{"name":"filter[host]","in":"query","required":false,"schema":{"type":"string"},"description":"Filter results by host."},{"name":"filter[protocol]","in":"query","required":false,"schema":{"type":"string"},"description":"Filter results by protocol."},{"name":"filter[auth_type]","in":"query","required":false,"schema":{"type":"string"},"description":"Filter results by auth_type."},{"name":"filter[port]","in":"query","required":false,"schema":{"type":"string"},"description":"Filter results by port."},{"name":"include","in":"query","required":false,"schema":{"type":"string"},"description":"Comma-separated list of relationships to include. Available: flows, messageBrokerQueues, variables, flowMessageBrokerQueues"},{"name":"sort","in":"query","required":false,"schema":{"type":"string"},"description":"Sort field. Prefix with - for descending. Available: name, description, host, port, protocol, auth_type"},{"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/MessageBrokersResponse"}}}},"401":{"description":"Unauthenticated"},"403":{"description":"Unauthorized"}},"tags":["Message Brokers"]}}}}
```

## Update Message Broker

> Updates an existing message broker.

```json
{"openapi":"3.0.0","info":{"title":"Patchworks Core API","version":"1.0.0"},"tags":[{"name":"Message Brokers"}],"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":{"MessageBrokersResponse":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/MessageBrokers"}}},"MessageBrokers":{"type":"object","properties":{"id":{"type":"integer","description":"Unique identifier"},"description":{"type":"string"},"host":{"type":"string","items":{"type":"object"}},"port":{"type":"integer","items":{"type":"object"}},"protocol":{"type":"string","enum":["HTTP","FTP","SFTP","FTPS","S3","MySQL","PGSQL","SQLSRV"],"items":{"type":"object"}},"auth_type":{"type":"string","items":{"type":"object"}},"variables":{"type":"string","items":{"type":"object"}},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"name":{"type":"string"},"flows":{"type":"array","items":{"type":"object"}},"message_broker_queues":{"type":"array","items":{"type":"object"}},"message_broker_queues_count":{"type":"array","items":{"type":"object"}},"flow_message_broker_queues":{"type":"array","items":{"type":"object"}}}},"ErrorResponse":{"type":"object","properties":{"message":{"type":"string"},"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}}},"MessageBrokersUpdateRequest":{"type":"object","properties":{"description":{"type":"string","maxLength":100},"host":{"type":"string"},"port":{"type":"integer"},"protocol":{"type":"string","enum":["HTTP","FTP","SFTP","FTPS","S3","MySQL","PGSQL","SQLSRV"]},"auth_type":{"type":"string"},"variables":{"type":"string","properties":{"*":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string"},"value":{"type":"string","nullable":true},"label":{"type":"string"},"secret":{"type":"boolean","nullable":true},"locked":{"type":"boolean","nullable":true},"pivot":{"type":"object","properties":{"alias":{"type":"string","nullable":true},"configurable":{"type":"boolean","nullable":true},"required":{"type":"boolean","nullable":true},"advanced":{"type":"boolean","nullable":true}}}}}}},"name":{"type":"string","maxLength":40,"pattern":"^[a-zA-Z0-9 -]+$"}},"required":["variables"]}}},"paths":{"/api/v1/message-brokers/{message_broker}":{"put":{"summary":"Update Message Broker","description":"Updates an existing 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/MessageBrokersResponse"}}}},"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/MessageBrokersUpdateRequest"}}}},"tags":["Message Brokers"]}}}}
```

## Delete Message Broker

> Permanently deletes a specific message broker.

```json
{"openapi":"3.0.0","info":{"title":"Patchworks Core API","version":"1.0.0"},"tags":[{"name":"Message Brokers"}],"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}":{"delete":{"summary":"Delete Message Broker","description":"Permanently deletes 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/MessageResponse"}}}},"401":{"description":"Unauthenticated"},"403":{"description":"Unauthorized"}},"tags":["Message Brokers"]}}}}
```


---

# 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/message-broker/message-brokers.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.
