# Upsert organization messaging config

`PUT /organization-configs/messaging`



[Auth Administration API guide](https://docs.contextual.io/tenants/tenant-apis/auth-administration-api.md)

```json
{
  "openapi": "3.0.3",
  "info": {
    "title": "Contextual Auth API",
    "description": " "
  },
  "security": [
    {
      "jwt": []
    }
  ],
  "servers": [
    {
      "url": "https://auth.{tenantId}.my.contextual.io/api/v1",
      "variables": {
        "tenantId": {
          "default": "YOUR-TENANT-ID"
        }
      }
    }
  ],
  "paths": {
    "/organization-configs/messaging": {
      "put": {
        "tags": [
          "Organization configs"
        ],
        "summary": "Upsert organization messaging config",
        "parameters": [
          {
            "name": "x-org-id",
            "in": "header",
            "required": false
          }
        ],
        "deprecated": false,
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "const": "messaging"
                      },
                      "topicTemplate": {
                        "type": "string",
                        "pattern": "%s"
                      },
                      "topics": {
                        "type": "object",
                        "properties": {
                          "agentControlEvents": {
                            "type": "string"
                          },
                          "aiSearchEmbedding": {
                            "type": "string"
                          },
                          "aiSearchFilter": {
                            "type": "string"
                          },
                          "logs": {
                            "type": "string"
                          },
                          "triggers": {
                            "type": "string"
                          },
                          "triggersControl": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "agentControlEvents",
                          "aiSearchEmbedding",
                          "aiSearchFilter",
                          "logs",
                          "triggers",
                          "triggersControl"
                        ],
                        "additionalProperties": false
                      },
                      "brokers": {
                        "type": "array",
                        "items": {
                          "type": "string",
                          "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*(?:\\.[a-z0-9]+(?:-[a-z0-9]+)*)+(?::[0-9]+)?$"
                        }
                      },
                      "saslConfig": {
                        "anyOf": [
                          {
                            "type": "object",
                            "properties": {
                              "mechanism": {
                                "type": "string",
                                "const": "plain"
                              },
                              "username": {
                                "type": "string"
                              },
                              "password": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "mechanism",
                              "username",
                              "password"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "mechanism": {
                                "type": "string",
                                "const": "scram-sha-256"
                              },
                              "username": {
                                "type": "string"
                              },
                              "password": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "mechanism",
                              "username",
                              "password"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "mechanism": {
                                "type": "string",
                                "const": "scram-sha-512"
                              },
                              "username": {
                                "type": "string"
                              },
                              "password": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "mechanism",
                              "username",
                              "password"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "mechanism": {
                                "type": "string",
                                "const": "oauthbearer"
                              },
                              "authEndpoint": {
                                "type": "string"
                              },
                              "clientId": {
                                "type": "string"
                              },
                              "clientSecret": {
                                "type": "string"
                              },
                              "audience": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "mechanism",
                              "authEndpoint",
                              "clientId",
                              "clientSecret",
                              "audience"
                            ],
                            "additionalProperties": false
                          }
                        ]
                      },
                      "type": {
                        "type": "string",
                        "const": "kafka"
                      },
                      "provider": {
                        "type": "string",
                        "const": "confluent"
                      },
                      "confluentConfig": {
                        "type": "object",
                        "properties": {
                          "environmentId": {
                            "type": "string"
                          },
                          "environmentName": {
                            "type": "string"
                          },
                          "clusterId": {
                            "type": "string"
                          },
                          "clusterName": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "environmentId",
                          "environmentName",
                          "clusterId",
                          "clusterName"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "required": [
                      "id",
                      "topicTemplate",
                      "topics",
                      "brokers",
                      "saslConfig",
                      "type",
                      "provider",
                      "confluentConfig"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "const": "messaging"
                      },
                      "topicTemplate": {
                        "type": "string",
                        "pattern": "%s"
                      },
                      "topics": {
                        "type": "object",
                        "properties": {
                          "agentControlEvents": {
                            "type": "string"
                          },
                          "aiSearchEmbedding": {
                            "type": "string"
                          },
                          "aiSearchFilter": {
                            "type": "string"
                          },
                          "logs": {
                            "type": "string"
                          },
                          "triggers": {
                            "type": "string"
                          },
                          "triggersControl": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "agentControlEvents",
                          "aiSearchEmbedding",
                          "aiSearchFilter",
                          "logs",
                          "triggers",
                          "triggersControl"
                        ],
                        "additionalProperties": false
                      },
                      "brokers": {
                        "type": "array",
                        "items": {
                          "type": "string",
                          "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*(?:\\.[a-z0-9]+(?:-[a-z0-9]+)*)+(?::[0-9]+)?$"
                        }
                      },
                      "saslConfig": {
                        "anyOf": [
                          {
                            "type": "object",
                            "properties": {
                              "mechanism": {
                                "type": "string",
                                "const": "plain"
                              },
                              "username": {
                                "type": "string"
                              },
                              "password": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "mechanism",
                              "username",
                              "password"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "mechanism": {
                                "type": "string",
                                "const": "scram-sha-256"
                              },
                              "username": {
                                "type": "string"
                              },
                              "password": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "mechanism",
                              "username",
                              "password"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "mechanism": {
                                "type": "string",
                                "const": "scram-sha-512"
                              },
                              "username": {
                                "type": "string"
                              },
                              "password": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "mechanism",
                              "username",
                              "password"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "mechanism": {
                                "type": "string",
                                "const": "oauthbearer"
                              },
                              "authEndpoint": {
                                "type": "string"
                              },
                              "clientId": {
                                "type": "string"
                              },
                              "clientSecret": {
                                "type": "string"
                              },
                              "audience": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "mechanism",
                              "authEndpoint",
                              "clientId",
                              "clientSecret",
                              "audience"
                            ],
                            "additionalProperties": false
                          }
                        ]
                      },
                      "type": {
                        "type": "string",
                        "const": "pulsar"
                      },
                      "serviceUrl": {
                        "type": "string",
                        "format": "uri"
                      },
                      "authConfig": {
                        "anyOf": [
                          {
                            "type": "object",
                            "properties": {
                              "mode": {
                                "type": "string",
                                "const": "oauth"
                              },
                              "issuerUrl": {
                                "type": "string",
                                "format": "uri"
                              },
                              "type": {
                                "type": "string",
                                "const": "client_credentials"
                              },
                              "clientId": {
                                "type": "string"
                              },
                              "clientSecret": {
                                "type": "string"
                              },
                              "audience": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "mode",
                              "issuerUrl",
                              "type",
                              "clientId",
                              "clientSecret",
                              "audience"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "mode": {
                                "type": "string",
                                "const": "bearer"
                              },
                              "bearerToken": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "mode",
                              "bearerToken"
                            ],
                            "additionalProperties": false
                          }
                        ]
                      },
                      "adminServiceUrl": {
                        "type": "string",
                        "format": "uri"
                      },
                      "provider": {
                        "type": "string",
                        "const": "streamnative"
                      }
                    },
                    "required": [
                      "id",
                      "topicTemplate",
                      "topics",
                      "brokers",
                      "saslConfig",
                      "type",
                      "serviceUrl",
                      "authConfig",
                      "adminServiceUrl",
                      "provider"
                    ],
                    "additionalProperties": false
                  }
                ],
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "oneOf": [
                        {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "const": "messaging"
                            },
                            "topicTemplate": {
                              "type": "string",
                              "pattern": "%s"
                            },
                            "topics": {
                              "type": "object",
                              "properties": {
                                "agentControlEvents": {
                                  "type": "string"
                                },
                                "aiSearchEmbedding": {
                                  "type": "string"
                                },
                                "aiSearchFilter": {
                                  "type": "string"
                                },
                                "logs": {
                                  "type": "string"
                                },
                                "triggers": {
                                  "type": "string"
                                },
                                "triggersControl": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "agentControlEvents",
                                "aiSearchEmbedding",
                                "aiSearchFilter",
                                "logs",
                                "triggers",
                                "triggersControl"
                              ],
                              "additionalProperties": false
                            },
                            "brokers": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*(?:\\.[a-z0-9]+(?:-[a-z0-9]+)*)+(?::[0-9]+)?$"
                              }
                            },
                            "saslConfig": {
                              "anyOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "mechanism": {
                                      "type": "string",
                                      "const": "plain"
                                    },
                                    "username": {
                                      "type": "string"
                                    },
                                    "password": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "mechanism",
                                    "username",
                                    "password"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "mechanism": {
                                      "type": "string",
                                      "const": "scram-sha-256"
                                    },
                                    "username": {
                                      "type": "string"
                                    },
                                    "password": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "mechanism",
                                    "username",
                                    "password"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "mechanism": {
                                      "type": "string",
                                      "const": "scram-sha-512"
                                    },
                                    "username": {
                                      "type": "string"
                                    },
                                    "password": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "mechanism",
                                    "username",
                                    "password"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "mechanism": {
                                      "type": "string",
                                      "const": "oauthbearer"
                                    },
                                    "authEndpoint": {
                                      "type": "string"
                                    },
                                    "clientId": {
                                      "type": "string"
                                    },
                                    "clientSecret": {
                                      "type": "string"
                                    },
                                    "audience": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "mechanism",
                                    "authEndpoint",
                                    "clientId",
                                    "clientSecret",
                                    "audience"
                                  ],
                                  "additionalProperties": false
                                }
                              ]
                            },
                            "type": {
                              "type": "string",
                              "const": "kafka"
                            },
                            "provider": {
                              "type": "string",
                              "const": "confluent"
                            },
                            "confluentConfig": {
                              "type": "object",
                              "properties": {
                                "environmentId": {
                                  "type": "string"
                                },
                                "environmentName": {
                                  "type": "string"
                                },
                                "clusterId": {
                                  "type": "string"
                                },
                                "clusterName": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "environmentId",
                                "environmentName",
                                "clusterId",
                                "clusterName"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "required": [
                            "id",
                            "topicTemplate",
                            "topics",
                            "brokers",
                            "saslConfig",
                            "type",
                            "provider",
                            "confluentConfig"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "const": "messaging"
                            },
                            "topicTemplate": {
                              "type": "string",
                              "pattern": "%s"
                            },
                            "topics": {
                              "type": "object",
                              "properties": {
                                "agentControlEvents": {
                                  "type": "string"
                                },
                                "aiSearchEmbedding": {
                                  "type": "string"
                                },
                                "aiSearchFilter": {
                                  "type": "string"
                                },
                                "logs": {
                                  "type": "string"
                                },
                                "triggers": {
                                  "type": "string"
                                },
                                "triggersControl": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "agentControlEvents",
                                "aiSearchEmbedding",
                                "aiSearchFilter",
                                "logs",
                                "triggers",
                                "triggersControl"
                              ],
                              "additionalProperties": false
                            },
                            "brokers": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*(?:\\.[a-z0-9]+(?:-[a-z0-9]+)*)+(?::[0-9]+)?$"
                              }
                            },
                            "saslConfig": {
                              "anyOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "mechanism": {
                                      "type": "string",
                                      "const": "plain"
                                    },
                                    "username": {
                                      "type": "string"
                                    },
                                    "password": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "mechanism",
                                    "username",
                                    "password"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "mechanism": {
                                      "type": "string",
                                      "const": "scram-sha-256"
                                    },
                                    "username": {
                                      "type": "string"
                                    },
                                    "password": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "mechanism",
                                    "username",
                                    "password"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "mechanism": {
                                      "type": "string",
                                      "const": "scram-sha-512"
                                    },
                                    "username": {
                                      "type": "string"
                                    },
                                    "password": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "mechanism",
                                    "username",
                                    "password"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "mechanism": {
                                      "type": "string",
                                      "const": "oauthbearer"
                                    },
                                    "authEndpoint": {
                                      "type": "string"
                                    },
                                    "clientId": {
                                      "type": "string"
                                    },
                                    "clientSecret": {
                                      "type": "string"
                                    },
                                    "audience": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "mechanism",
                                    "authEndpoint",
                                    "clientId",
                                    "clientSecret",
                                    "audience"
                                  ],
                                  "additionalProperties": false
                                }
                              ]
                            },
                            "type": {
                              "type": "string",
                              "const": "pulsar"
                            },
                            "serviceUrl": {
                              "type": "string",
                              "format": "uri"
                            },
                            "authConfig": {
                              "anyOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "mode": {
                                      "type": "string",
                                      "const": "oauth"
                                    },
                                    "issuerUrl": {
                                      "type": "string",
                                      "format": "uri"
                                    },
                                    "type": {
                                      "type": "string",
                                      "const": "client_credentials"
                                    },
                                    "clientId": {
                                      "type": "string"
                                    },
                                    "clientSecret": {
                                      "type": "string"
                                    },
                                    "audience": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "mode",
                                    "issuerUrl",
                                    "type",
                                    "clientId",
                                    "clientSecret",
                                    "audience"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "mode": {
                                      "type": "string",
                                      "const": "bearer"
                                    },
                                    "bearerToken": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "mode",
                                    "bearerToken"
                                  ],
                                  "additionalProperties": false
                                }
                              ]
                            },
                            "adminServiceUrl": {
                              "type": "string",
                              "format": "uri"
                            },
                            "provider": {
                              "type": "string",
                              "const": "streamnative"
                            }
                          },
                          "required": [
                            "id",
                            "topicTemplate",
                            "topics",
                            "brokers",
                            "saslConfig",
                            "type",
                            "serviceUrl",
                            "authConfig",
                            "adminServiceUrl",
                            "provider"
                          ],
                          "additionalProperties": false
                        }
                      ],
                      "type": "object"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "_metaData": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "createdAt": {
                              "type": "string",
                              "pattern": "^(?:\\d+(?:\\.\\d+?)?|(?:\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(?:\\.\\d+)?Z))$",
                              "description": "An ISO 8601 date time string",
                              "format": "date-time"
                            },
                            "updatedAt": {
                              "type": "string",
                              "pattern": "^(?:\\d+(?:\\.\\d+?)?|(?:\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(?:\\.\\d+)?Z))$",
                              "description": "An ISO 8601 date time string",
                              "format": "date-time"
                            }
                          },
                          "required": [
                            "id",
                            "createdAt"
                          ],
                          "additionalProperties": false
                        }
                      },
                      "required": [
                        "_metaData"
                      ],
                      "additionalProperties": false
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid payload provided",
            "content": {}
          },
          "401": {
            "description": "Missing or invalid authorization header",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/$ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Invalid permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/$ErrorResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "jwt": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      }
    },
    "schemas": {
      "$ErrorResponse": {
        "type": "object",
        "properties": {
          "code": {
            "type": [
              "string",
              "number"
            ]
          },
          "message": {
            "type": "string"
          },
          "errors": {
            "type": "array",
            "items": {}
          }
        },
        "required": [
          "code",
          "message"
        ],
        "additionalProperties": false
      }
    }
  }
}
```