Max size of Value for consul /txn API

I ran into some interesting issue today. We know that (for all good reason) consul kv store has a limitation of 512 KB for Value. If we use the /v1/kv end point we don’t have to encode the config file, however, if we use the /txn end point, then as per the documentation, we are required to pass the base64-encoded blob of config file. And we know that such base64 encoding generally increases the overall size of the blob.

E.g., I have a config file whose size is 394 KB (plain text format). However, when I encode this file, the size becomes more than 512 KB and the /txn end point fails to upload the file. The regular /v1/kv end point works fine though.
Since, in our project, we have the requirement to use /txn end point only, can somebody shed some light as to how to overcome this size issue?

The transaction endpoint is normally used for simultaneously performing operations against multiple keys. Are you attempting to modify multiple values in a single request, or are you using the /txn endpoint for some other reason?

If you truly need to use this API endpoint, and want to raise the 512KB limit, you can do so using the limits.txn_max_req_len agent configuration option.

limits {
  txn_max_req_len = <value in bytes>