Auth0 Home Blog Docs

Custom Database Connection Script Settings - Automation?

Custom Database scripts have a Settings feature in the UI which allows the storage of secrets via key/value pairs, exposing them to any scripts you add (Login, Forgot Password, etc). This is great, but is there a way to set these key/values via the Management API?

Rules have a similar Settings feature and the Management API and Deploy CLI have support for it, but those settings seem to be separate from Custom Database scripts settings.

Is this possible, but not documented? If not, is there any plans to add this?

Hi @mattm,

Welcome to the Community!

It looks like you should be able to make a PATCH request to the /api/v2/connections/{id} endpoint

"options":{
 //your current options
  "configuration": {
        "newKey":"newVal"
       }
}

I think this will overwrite your current options, so you may need to add them in the request.

Hopefully this helps,
Dan

Thanks @dan.woda!

FYI for others in the future: This also works in the Auth0 Deploy CLI

databases:
  - name: foo
    options:
      configuration:
        foo: 'bar'
1 Like