For AI agents: A markdown version of this page is available at https://docs.datadoghq.com/api/latest/action-connection/update-an-existing-action-connection.md. A documentation index is available at /llms.txt.
Language
Datadog site

Update an existing Action Connection

PATCHhttps://api.datadoghq.com/api/v2/actions/connections/{connection_id}https://api.us3.datadoghq.com/api/v2/actions/connections/{connection_id}https://api.us5.datadoghq.com/api/v2/actions/connections/{connection_id}https://api.datadoghq.eu/api/v2/actions/connections/{connection_id}https://api.ap1.datadoghq.com/api/v2/actions/connections/{connection_id}https://api.ap2.datadoghq.com/api/v2/actions/connections/{connection_id}https://api.uk1.datadoghq.com/api/v2/actions/connections/{connection_id}https://api.ddog-gov.com/api/v2/actions/connections/{connection_id}https://api.us2.ddog-gov.com/api/v2/actions/connections/{connection_id}

Overview

Update an existing Action Connection. This API requires a registered application key.

Arguments

Path Parameters

Name
Type
Description
connection_id [required]
string

The ID of the action connection

Request

Body Data (required)

Update an existing Action Connection request body

Field
Type
Description
data [required]
object

Data related to the connection update.

Response

Successfully updated Action Connection

The response for an updated connection.

Field
Type
Description
data
object

Data related to the connection.

Code Example

Update a GCP Action Connection with a versioned AWS Secrets Manager reference
# Path parameters
export connection_id="CHANGE_ME"

# Set your Datadog site and credentials
export DD_SITE="datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PATCH "https://api.${DD_SITE}/api/v2/actions/connections/${connection_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "type": "action_connection",
    "attributes": {
      "external_secrets_manager": {
        "type": "aws_secrets_manager",
        "connection_id": "b0511f47-29f5-55de-bdcb-c209b05eadc3",
        "region": "us-east-1"
      },
      "integration": {
        "type": "GCP",
        "credentials": {
          "type": "GCPServiceAccount",
          "private_key": {
            "type": "aws_secrets_manager",
            "secret_id": "example/gcp/service-account",
            "key": "private_key",
            "version_stage": "AWSCURRENT"
          },
          "service_account_email": {
            "type": "aws_secrets_manager",
            "secret_id": "example/gcp/service-account",
            "key": "client_email"
          }
        }
      }
    }
  }
}
EOF
# Path parameters
export connection_id="CHANGE_ME"

# Set your Datadog site and credentials
export DD_SITE="us3.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PATCH "https://api.${DD_SITE}/api/v2/actions/connections/${connection_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "type": "action_connection",
    "attributes": {
      "external_secrets_manager": {
        "type": "aws_secrets_manager",
        "connection_id": "b0511f47-29f5-55de-bdcb-c209b05eadc3",
        "region": "us-east-1"
      },
      "integration": {
        "type": "GCP",
        "credentials": {
          "type": "GCPServiceAccount",
          "private_key": {
            "type": "aws_secrets_manager",
            "secret_id": "example/gcp/service-account",
            "key": "private_key",
            "version_stage": "AWSCURRENT"
          },
          "service_account_email": {
            "type": "aws_secrets_manager",
            "secret_id": "example/gcp/service-account",
            "key": "client_email"
          }
        }
      }
    }
  }
}
EOF
# Path parameters
export connection_id="CHANGE_ME"

# Set your Datadog site and credentials
export DD_SITE="us5.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PATCH "https://api.${DD_SITE}/api/v2/actions/connections/${connection_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "type": "action_connection",
    "attributes": {
      "external_secrets_manager": {
        "type": "aws_secrets_manager",
        "connection_id": "b0511f47-29f5-55de-bdcb-c209b05eadc3",
        "region": "us-east-1"
      },
      "integration": {
        "type": "GCP",
        "credentials": {
          "type": "GCPServiceAccount",
          "private_key": {
            "type": "aws_secrets_manager",
            "secret_id": "example/gcp/service-account",
            "key": "private_key",
            "version_stage": "AWSCURRENT"
          },
          "service_account_email": {
            "type": "aws_secrets_manager",
            "secret_id": "example/gcp/service-account",
            "key": "client_email"
          }
        }
      }
    }
  }
}
EOF
# Path parameters
export connection_id="CHANGE_ME"

# Set your Datadog site and credentials
export DD_SITE="datadoghq.eu"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PATCH "https://api.${DD_SITE}/api/v2/actions/connections/${connection_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "type": "action_connection",
    "attributes": {
      "external_secrets_manager": {
        "type": "aws_secrets_manager",
        "connection_id": "b0511f47-29f5-55de-bdcb-c209b05eadc3",
        "region": "us-east-1"
      },
      "integration": {
        "type": "GCP",
        "credentials": {
          "type": "GCPServiceAccount",
          "private_key": {
            "type": "aws_secrets_manager",
            "secret_id": "example/gcp/service-account",
            "key": "private_key",
            "version_stage": "AWSCURRENT"
          },
          "service_account_email": {
            "type": "aws_secrets_manager",
            "secret_id": "example/gcp/service-account",
            "key": "client_email"
          }
        }
      }
    }
  }
}
EOF
# Path parameters
export connection_id="CHANGE_ME"

# Set your Datadog site and credentials
export DD_SITE="ap1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PATCH "https://api.${DD_SITE}/api/v2/actions/connections/${connection_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "type": "action_connection",
    "attributes": {
      "external_secrets_manager": {
        "type": "aws_secrets_manager",
        "connection_id": "b0511f47-29f5-55de-bdcb-c209b05eadc3",
        "region": "us-east-1"
      },
      "integration": {
        "type": "GCP",
        "credentials": {
          "type": "GCPServiceAccount",
          "private_key": {
            "type": "aws_secrets_manager",
            "secret_id": "example/gcp/service-account",
            "key": "private_key",
            "version_stage": "AWSCURRENT"
          },
          "service_account_email": {
            "type": "aws_secrets_manager",
            "secret_id": "example/gcp/service-account",
            "key": "client_email"
          }
        }
      }
    }
  }
}
EOF
# Path parameters
export connection_id="CHANGE_ME"

# Set your Datadog site and credentials
export DD_SITE="ap2.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PATCH "https://api.${DD_SITE}/api/v2/actions/connections/${connection_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "type": "action_connection",
    "attributes": {
      "external_secrets_manager": {
        "type": "aws_secrets_manager",
        "connection_id": "b0511f47-29f5-55de-bdcb-c209b05eadc3",
        "region": "us-east-1"
      },
      "integration": {
        "type": "GCP",
        "credentials": {
          "type": "GCPServiceAccount",
          "private_key": {
            "type": "aws_secrets_manager",
            "secret_id": "example/gcp/service-account",
            "key": "private_key",
            "version_stage": "AWSCURRENT"
          },
          "service_account_email": {
            "type": "aws_secrets_manager",
            "secret_id": "example/gcp/service-account",
            "key": "client_email"
          }
        }
      }
    }
  }
}
EOF
# Path parameters
export connection_id="CHANGE_ME"

# Set your Datadog site and credentials
export DD_SITE="uk1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PATCH "https://api.${DD_SITE}/api/v2/actions/connections/${connection_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "type": "action_connection",
    "attributes": {
      "external_secrets_manager": {
        "type": "aws_secrets_manager",
        "connection_id": "b0511f47-29f5-55de-bdcb-c209b05eadc3",
        "region": "us-east-1"
      },
      "integration": {
        "type": "GCP",
        "credentials": {
          "type": "GCPServiceAccount",
          "private_key": {
            "type": "aws_secrets_manager",
            "secret_id": "example/gcp/service-account",
            "key": "private_key",
            "version_stage": "AWSCURRENT"
          },
          "service_account_email": {
            "type": "aws_secrets_manager",
            "secret_id": "example/gcp/service-account",
            "key": "client_email"
          }
        }
      }
    }
  }
}
EOF
# Path parameters
export connection_id="CHANGE_ME"

# Set your Datadog site and credentials
export DD_SITE="ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PATCH "https://api.${DD_SITE}/api/v2/actions/connections/${connection_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "type": "action_connection",
    "attributes": {
      "external_secrets_manager": {
        "type": "aws_secrets_manager",
        "connection_id": "b0511f47-29f5-55de-bdcb-c209b05eadc3",
        "region": "us-east-1"
      },
      "integration": {
        "type": "GCP",
        "credentials": {
          "type": "GCPServiceAccount",
          "private_key": {
            "type": "aws_secrets_manager",
            "secret_id": "example/gcp/service-account",
            "key": "private_key",
            "version_stage": "AWSCURRENT"
          },
          "service_account_email": {
            "type": "aws_secrets_manager",
            "secret_id": "example/gcp/service-account",
            "key": "client_email"
          }
        }
      }
    }
  }
}
EOF
# Path parameters
export connection_id="CHANGE_ME"

# Set your Datadog site and credentials
export DD_SITE="us2.ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PATCH "https://api.${DD_SITE}/api/v2/actions/connections/${connection_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "type": "action_connection",
    "attributes": {
      "external_secrets_manager": {
        "type": "aws_secrets_manager",
        "connection_id": "b0511f47-29f5-55de-bdcb-c209b05eadc3",
        "region": "us-east-1"
      },
      "integration": {
        "type": "GCP",
        "credentials": {
          "type": "GCPServiceAccount",
          "private_key": {
            "type": "aws_secrets_manager",
            "secret_id": "example/gcp/service-account",
            "key": "private_key",
            "version_stage": "AWSCURRENT"
          },
          "service_account_email": {
            "type": "aws_secrets_manager",
            "secret_id": "example/gcp/service-account",
            "key": "client_email"
          }
        }
      }
    }
  }
}
EOF
Update a GitHub App Action Connection without replacing its secret
# Path parameters
export connection_id="CHANGE_ME"

# Set your Datadog site and credentials
export DD_SITE="datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PATCH "https://api.${DD_SITE}/api/v2/actions/connections/${connection_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "type": "action_connection",
    "attributes": {
      "name": "GitHub App Updated exampleactionconnection",
      "integration": {
        "type": "Github",
        "credentials": {
          "type": "GithubApp",
          "hostname": "github.updated.example.com"
        }
      }
    }
  }
}
EOF
# Path parameters
export connection_id="CHANGE_ME"

# Set your Datadog site and credentials
export DD_SITE="us3.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PATCH "https://api.${DD_SITE}/api/v2/actions/connections/${connection_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "type": "action_connection",
    "attributes": {
      "name": "GitHub App Updated exampleactionconnection",
      "integration": {
        "type": "Github",
        "credentials": {
          "type": "GithubApp",
          "hostname": "github.updated.example.com"
        }
      }
    }
  }
}
EOF
# Path parameters
export connection_id="CHANGE_ME"

# Set your Datadog site and credentials
export DD_SITE="us5.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PATCH "https://api.${DD_SITE}/api/v2/actions/connections/${connection_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "type": "action_connection",
    "attributes": {
      "name": "GitHub App Updated exampleactionconnection",
      "integration": {
        "type": "Github",
        "credentials": {
          "type": "GithubApp",
          "hostname": "github.updated.example.com"
        }
      }
    }
  }
}
EOF
# Path parameters
export connection_id="CHANGE_ME"

# Set your Datadog site and credentials
export DD_SITE="datadoghq.eu"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PATCH "https://api.${DD_SITE}/api/v2/actions/connections/${connection_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "type": "action_connection",
    "attributes": {
      "name": "GitHub App Updated exampleactionconnection",
      "integration": {
        "type": "Github",
        "credentials": {
          "type": "GithubApp",
          "hostname": "github.updated.example.com"
        }
      }
    }
  }
}
EOF
# Path parameters
export connection_id="CHANGE_ME"

# Set your Datadog site and credentials
export DD_SITE="ap1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PATCH "https://api.${DD_SITE}/api/v2/actions/connections/${connection_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "type": "action_connection",
    "attributes": {
      "name": "GitHub App Updated exampleactionconnection",
      "integration": {
        "type": "Github",
        "credentials": {
          "type": "GithubApp",
          "hostname": "github.updated.example.com"
        }
      }
    }
  }
}
EOF
# Path parameters
export connection_id="CHANGE_ME"

# Set your Datadog site and credentials
export DD_SITE="ap2.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PATCH "https://api.${DD_SITE}/api/v2/actions/connections/${connection_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "type": "action_connection",
    "attributes": {
      "name": "GitHub App Updated exampleactionconnection",
      "integration": {
        "type": "Github",
        "credentials": {
          "type": "GithubApp",
          "hostname": "github.updated.example.com"
        }
      }
    }
  }
}
EOF
# Path parameters
export connection_id="CHANGE_ME"

# Set your Datadog site and credentials
export DD_SITE="uk1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PATCH "https://api.${DD_SITE}/api/v2/actions/connections/${connection_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "type": "action_connection",
    "attributes": {
      "name": "GitHub App Updated exampleactionconnection",
      "integration": {
        "type": "Github",
        "credentials": {
          "type": "GithubApp",
          "hostname": "github.updated.example.com"
        }
      }
    }
  }
}
EOF
# Path parameters
export connection_id="CHANGE_ME"

# Set your Datadog site and credentials
export DD_SITE="ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PATCH "https://api.${DD_SITE}/api/v2/actions/connections/${connection_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "type": "action_connection",
    "attributes": {
      "name": "GitHub App Updated exampleactionconnection",
      "integration": {
        "type": "Github",
        "credentials": {
          "type": "GithubApp",
          "hostname": "github.updated.example.com"
        }
      }
    }
  }
}
EOF
# Path parameters
export connection_id="CHANGE_ME"

# Set your Datadog site and credentials
export DD_SITE="us2.ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PATCH "https://api.${DD_SITE}/api/v2/actions/connections/${connection_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "type": "action_connection",
    "attributes": {
      "name": "GitHub App Updated exampleactionconnection",
      "integration": {
        "type": "Github",
        "credentials": {
          "type": "GithubApp",
          "hostname": "github.updated.example.com"
        }
      }
    }
  }
}
EOF
Update a GitHub personal access token Action Connection without replacing its secret
# Path parameters
export connection_id="CHANGE_ME"

# Set your Datadog site and credentials
export DD_SITE="datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PATCH "https://api.${DD_SITE}/api/v2/actions/connections/${connection_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "type": "action_connection",
    "attributes": {
      "name": "GitHub personal access token Updated exampleactionconnection",
      "integration": {
        "type": "Github",
        "credentials": {
          "type": "GithubPersonalAccessToken",
          "hostname": "github.updated.example.com"
        }
      }
    }
  }
}
EOF
# Path parameters
export connection_id="CHANGE_ME"

# Set your Datadog site and credentials
export DD_SITE="us3.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PATCH "https://api.${DD_SITE}/api/v2/actions/connections/${connection_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "type": "action_connection",
    "attributes": {
      "name": "GitHub personal access token Updated exampleactionconnection",
      "integration": {
        "type": "Github",
        "credentials": {
          "type": "GithubPersonalAccessToken",
          "hostname": "github.updated.example.com"
        }
      }
    }
  }
}
EOF
# Path parameters
export connection_id="CHANGE_ME"

# Set your Datadog site and credentials
export DD_SITE="us5.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PATCH "https://api.${DD_SITE}/api/v2/actions/connections/${connection_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "type": "action_connection",
    "attributes": {
      "name": "GitHub personal access token Updated exampleactionconnection",
      "integration": {
        "type": "Github",
        "credentials": {
          "type": "GithubPersonalAccessToken",
          "hostname": "github.updated.example.com"
        }
      }
    }
  }
}
EOF
# Path parameters
export connection_id="CHANGE_ME"

# Set your Datadog site and credentials
export DD_SITE="datadoghq.eu"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PATCH "https://api.${DD_SITE}/api/v2/actions/connections/${connection_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "type": "action_connection",
    "attributes": {
      "name": "GitHub personal access token Updated exampleactionconnection",
      "integration": {
        "type": "Github",
        "credentials": {
          "type": "GithubPersonalAccessToken",
          "hostname": "github.updated.example.com"
        }
      }
    }
  }
}
EOF
# Path parameters
export connection_id="CHANGE_ME"

# Set your Datadog site and credentials
export DD_SITE="ap1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PATCH "https://api.${DD_SITE}/api/v2/actions/connections/${connection_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "type": "action_connection",
    "attributes": {
      "name": "GitHub personal access token Updated exampleactionconnection",
      "integration": {
        "type": "Github",
        "credentials": {
          "type": "GithubPersonalAccessToken",
          "hostname": "github.updated.example.com"
        }
      }
    }
  }
}
EOF
# Path parameters
export connection_id="CHANGE_ME"

# Set your Datadog site and credentials
export DD_SITE="ap2.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PATCH "https://api.${DD_SITE}/api/v2/actions/connections/${connection_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "type": "action_connection",
    "attributes": {
      "name": "GitHub personal access token Updated exampleactionconnection",
      "integration": {
        "type": "Github",
        "credentials": {
          "type": "GithubPersonalAccessToken",
          "hostname": "github.updated.example.com"
        }
      }
    }
  }
}
EOF
# Path parameters
export connection_id="CHANGE_ME"

# Set your Datadog site and credentials
export DD_SITE="uk1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PATCH "https://api.${DD_SITE}/api/v2/actions/connections/${connection_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "type": "action_connection",
    "attributes": {
      "name": "GitHub personal access token Updated exampleactionconnection",
      "integration": {
        "type": "Github",
        "credentials": {
          "type": "GithubPersonalAccessToken",
          "hostname": "github.updated.example.com"
        }
      }
    }
  }
}
EOF
# Path parameters
export connection_id="CHANGE_ME"

# Set your Datadog site and credentials
export DD_SITE="ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PATCH "https://api.${DD_SITE}/api/v2/actions/connections/${connection_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "type": "action_connection",
    "attributes": {
      "name": "GitHub personal access token Updated exampleactionconnection",
      "integration": {
        "type": "Github",
        "credentials": {
          "type": "GithubPersonalAccessToken",
          "hostname": "github.updated.example.com"
        }
      }
    }
  }
}
EOF
# Path parameters
export connection_id="CHANGE_ME"

# Set your Datadog site and credentials
export DD_SITE="us2.ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X PATCH "https://api.${DD_SITE}/api/v2/actions/connections/${connection_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "type": "action_connection",
    "attributes": {
      "name": "GitHub personal access token Updated exampleactionconnection",
      "integration": {
        "type": "Github",
        "credentials": {
          "type": "GithubPersonalAccessToken",
          "hostname": "github.updated.example.com"
        }
      }
    }
  }
}
EOF