Check out our free resources, like our pganalyze eBooks and sign up to our newsletter.

updateServer - Update a server on pganalyze Enterprise Server

Use case

This API is only supported for pganalyze Enterprise Server when utilizing the collector inside the central installation, and is used to configure the connections to your database servers.

This API requires a read-write API key.


Arguments for updateServer (only pass arguments for the fields that need to be updated):

  • serverId (String)
    ID of the server (returned as humanId in the addServer API call)
  • name (String)
    Display name for the server in pganalyze (optional)
  • dbHost (String)
    Hostname of the database server (optional)
  • dbPort (Integer)
    Port of the database server (optional)
  • dbUsername (String)
    Username for the database server (optional)
  • dbPassword (String)
    Password for the database server (optional)
  • dbName (String)
    Database name to connect to (optional)
  • dbSslmode (String)
    Postgres SSL mode to be used when connecting (optional)
  • dbUseIamAuth (String)
    For Amazon RDS: Whether to use AWS IAM authentication (optional)
  • awsRegion (String)
    For Amazon RDS: Region the database runs in (optional)
  • awsDbInstanceId (String)
    For Amazon RDS: Instance ID of the database instance (optional)
  • awsDbClusterId (String)
    For Amazon RDS: Cluster ID of the Aurora Cluster (optional)
  • awsAssumeRole (String)
    For Amazon RDS: IAM role to be assumed for AWS API access (optional)
  • enableLogs (Boolean)
    Determines whether log collection is enabled (optional, defaults to false, works with Amazon RDS and self-managed servers)
  • enableActivity (Boolean)
    Determines whether activity snapshots for Connection Tracing and Vacuum Monitoring are enabled (optional, defaults to false)

Fields returned:

  • server (ServerType)
    Server that was updated using this endpoint (null if an error occurred)
    • humanId (String)
      Public "human" ID that can be used to refer to this server in URLs and API calls
  • errors (Array of String)
    Errors that occurred during updating the server (if any)


GraphQL mutation:

mutation {
  updateServer(serverId: "bdp4m73ysjgefke7i2dgkenzi4", dbPassword: "new-password") {
    server {

Using curl, replace pganalyze.internal with the hostname or IP of your pganalyze installation:

curl -XPOST -H 'Authorization: Token XXXXXXX' \
  -F 'query=mutation { updateServer(serverId: "bdp4m73ysjgefke7i2dgkenzi4", dbPassword: "new-password") { server { humanId }, errors } }' \
  "data": {
    "updateServer": {
      "server": {
        "humanId": "bdp4m73ysjgefke7i2dgkenzi4"
      "errors": []

Couldn't find what you were looking for or want to talk about something specific?
Start a conversation with us →