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

Crear una nueva Action Connection

POSThttps://api.datadoghq.com/api/v2/actions/connectionshttps://api.us3.datadoghq.com/api/v2/actions/connectionshttps://api.us5.datadoghq.com/api/v2/actions/connectionshttps://api.datadoghq.eu/api/v2/actions/connectionshttps://api.ap1.datadoghq.com/api/v2/actions/connectionshttps://api.ap2.datadoghq.com/api/v2/actions/connectionshttps://api.uk1.datadoghq.com/api/v2/actions/connectionshttps://api.ddog-gov.com/api/v2/actions/connectionshttps://api.us2.ddog-gov.com/api/v2/actions/connections

Descripción general

Crea una nueva Action Connection. Esta API requiere una clave de aplicación registrada.

Solicitud

Body Data (required)

Campo
Type
Descripción
data [required]
object

Solicitud utilizada para crear una conexión de acción.

Respuesta

Successfully created Action Connection

The response for a created connection

Campo
Type
Descripción
data
object

Data related to the connection.

Ejemplo de código

Create a GCP Action Connection with AWS Secrets Manager references
# 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 POST "https://api.${DD_SITE}/api/v2/actions/connections" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "type": "action_connection",
    "attributes": {
      "name": "GCP Secrets Manager Connection exampleactionconnection",
      "external_secrets_manager": {
        "type": "aws_secrets_manager",
        "connection_id": "string",
        "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"
          },
          "service_account_email": {
            "type": "aws_secrets_manager",
            "secret_id": "example/gcp/service-account",
            "key": "client_email"
          }
        }
      }
    }
  }
}
EOF
# 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 POST "https://api.${DD_SITE}/api/v2/actions/connections" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "type": "action_connection",
    "attributes": {
      "name": "GCP Secrets Manager Connection exampleactionconnection",
      "external_secrets_manager": {
        "type": "aws_secrets_manager",
        "connection_id": "string",
        "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"
          },
          "service_account_email": {
            "type": "aws_secrets_manager",
            "secret_id": "example/gcp/service-account",
            "key": "client_email"
          }
        }
      }
    }
  }
}
EOF
# 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 POST "https://api.${DD_SITE}/api/v2/actions/connections" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "type": "action_connection",
    "attributes": {
      "name": "GCP Secrets Manager Connection exampleactionconnection",
      "external_secrets_manager": {
        "type": "aws_secrets_manager",
        "connection_id": "string",
        "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"
          },
          "service_account_email": {
            "type": "aws_secrets_manager",
            "secret_id": "example/gcp/service-account",
            "key": "client_email"
          }
        }
      }
    }
  }
}
EOF
# 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 POST "https://api.${DD_SITE}/api/v2/actions/connections" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "type": "action_connection",
    "attributes": {
      "name": "GCP Secrets Manager Connection exampleactionconnection",
      "external_secrets_manager": {
        "type": "aws_secrets_manager",
        "connection_id": "string",
        "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"
          },
          "service_account_email": {
            "type": "aws_secrets_manager",
            "secret_id": "example/gcp/service-account",
            "key": "client_email"
          }
        }
      }
    }
  }
}
EOF
# 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 POST "https://api.${DD_SITE}/api/v2/actions/connections" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "type": "action_connection",
    "attributes": {
      "name": "GCP Secrets Manager Connection exampleactionconnection",
      "external_secrets_manager": {
        "type": "aws_secrets_manager",
        "connection_id": "string",
        "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"
          },
          "service_account_email": {
            "type": "aws_secrets_manager",
            "secret_id": "example/gcp/service-account",
            "key": "client_email"
          }
        }
      }
    }
  }
}
EOF
# 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 POST "https://api.${DD_SITE}/api/v2/actions/connections" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "type": "action_connection",
    "attributes": {
      "name": "GCP Secrets Manager Connection exampleactionconnection",
      "external_secrets_manager": {
        "type": "aws_secrets_manager",
        "connection_id": "string",
        "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"
          },
          "service_account_email": {
            "type": "aws_secrets_manager",
            "secret_id": "example/gcp/service-account",
            "key": "client_email"
          }
        }
      }
    }
  }
}
EOF
# 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 POST "https://api.${DD_SITE}/api/v2/actions/connections" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "type": "action_connection",
    "attributes": {
      "name": "GCP Secrets Manager Connection exampleactionconnection",
      "external_secrets_manager": {
        "type": "aws_secrets_manager",
        "connection_id": "string",
        "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"
          },
          "service_account_email": {
            "type": "aws_secrets_manager",
            "secret_id": "example/gcp/service-account",
            "key": "client_email"
          }
        }
      }
    }
  }
}
EOF
# 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 POST "https://api.${DD_SITE}/api/v2/actions/connections" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "type": "action_connection",
    "attributes": {
      "name": "GCP Secrets Manager Connection exampleactionconnection",
      "external_secrets_manager": {
        "type": "aws_secrets_manager",
        "connection_id": "string",
        "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"
          },
          "service_account_email": {
            "type": "aws_secrets_manager",
            "secret_id": "example/gcp/service-account",
            "key": "client_email"
          }
        }
      }
    }
  }
}
EOF
# 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 POST "https://api.${DD_SITE}/api/v2/actions/connections" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "type": "action_connection",
    "attributes": {
      "name": "GCP Secrets Manager Connection exampleactionconnection",
      "external_secrets_manager": {
        "type": "aws_secrets_manager",
        "connection_id": "string",
        "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"
          },
          "service_account_email": {
            "type": "aws_secrets_manager",
            "secret_id": "example/gcp/service-account",
            "key": "client_email"
          }
        }
      }
    }
  }
}
EOF
Create a GitHub App Action Connection
# 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 POST "https://api.${DD_SITE}/api/v2/actions/connections" \
-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 Connection exampleactionconnection",
      "integration": {
        "type": "Github",
        "credentials": {
          "type": "GithubApp",
          "github_app_id": "123456",
          "github_installation_id": "789012",
          "private_key": "example-private-key",
          "hostname": "github.example.com"
        }
      }
    }
  }
}
EOF
# 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 POST "https://api.${DD_SITE}/api/v2/actions/connections" \
-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 Connection exampleactionconnection",
      "integration": {
        "type": "Github",
        "credentials": {
          "type": "GithubApp",
          "github_app_id": "123456",
          "github_installation_id": "789012",
          "private_key": "example-private-key",
          "hostname": "github.example.com"
        }
      }
    }
  }
}
EOF
# 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 POST "https://api.${DD_SITE}/api/v2/actions/connections" \
-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 Connection exampleactionconnection",
      "integration": {
        "type": "Github",
        "credentials": {
          "type": "GithubApp",
          "github_app_id": "123456",
          "github_installation_id": "789012",
          "private_key": "example-private-key",
          "hostname": "github.example.com"
        }
      }
    }
  }
}
EOF
# 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 POST "https://api.${DD_SITE}/api/v2/actions/connections" \
-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 Connection exampleactionconnection",
      "integration": {
        "type": "Github",
        "credentials": {
          "type": "GithubApp",
          "github_app_id": "123456",
          "github_installation_id": "789012",
          "private_key": "example-private-key",
          "hostname": "github.example.com"
        }
      }
    }
  }
}
EOF
# 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 POST "https://api.${DD_SITE}/api/v2/actions/connections" \
-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 Connection exampleactionconnection",
      "integration": {
        "type": "Github",
        "credentials": {
          "type": "GithubApp",
          "github_app_id": "123456",
          "github_installation_id": "789012",
          "private_key": "example-private-key",
          "hostname": "github.example.com"
        }
      }
    }
  }
}
EOF
# 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 POST "https://api.${DD_SITE}/api/v2/actions/connections" \
-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 Connection exampleactionconnection",
      "integration": {
        "type": "Github",
        "credentials": {
          "type": "GithubApp",
          "github_app_id": "123456",
          "github_installation_id": "789012",
          "private_key": "example-private-key",
          "hostname": "github.example.com"
        }
      }
    }
  }
}
EOF
# 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 POST "https://api.${DD_SITE}/api/v2/actions/connections" \
-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 Connection exampleactionconnection",
      "integration": {
        "type": "Github",
        "credentials": {
          "type": "GithubApp",
          "github_app_id": "123456",
          "github_installation_id": "789012",
          "private_key": "example-private-key",
          "hostname": "github.example.com"
        }
      }
    }
  }
}
EOF
# 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 POST "https://api.${DD_SITE}/api/v2/actions/connections" \
-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 Connection exampleactionconnection",
      "integration": {
        "type": "Github",
        "credentials": {
          "type": "GithubApp",
          "github_app_id": "123456",
          "github_installation_id": "789012",
          "private_key": "example-private-key",
          "hostname": "github.example.com"
        }
      }
    }
  }
}
EOF
# 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 POST "https://api.${DD_SITE}/api/v2/actions/connections" \
-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 Connection exampleactionconnection",
      "integration": {
        "type": "Github",
        "credentials": {
          "type": "GithubApp",
          "github_app_id": "123456",
          "github_installation_id": "789012",
          "private_key": "example-private-key",
          "hostname": "github.example.com"
        }
      }
    }
  }
}
EOF
Create a GitHub personal access token Action Connection
# 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 POST "https://api.${DD_SITE}/api/v2/actions/connections" \
-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 Connection exampleactionconnection",
      "integration": {
        "type": "Github",
        "credentials": {
          "type": "GithubPersonalAccessToken",
          "access_token": "example-token",
          "hostname": "github.example.com"
        }
      }
    }
  }
}
EOF
# 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 POST "https://api.${DD_SITE}/api/v2/actions/connections" \
-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 Connection exampleactionconnection",
      "integration": {
        "type": "Github",
        "credentials": {
          "type": "GithubPersonalAccessToken",
          "access_token": "example-token",
          "hostname": "github.example.com"
        }
      }
    }
  }
}
EOF
# 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 POST "https://api.${DD_SITE}/api/v2/actions/connections" \
-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 Connection exampleactionconnection",
      "integration": {
        "type": "Github",
        "credentials": {
          "type": "GithubPersonalAccessToken",
          "access_token": "example-token",
          "hostname": "github.example.com"
        }
      }
    }
  }
}
EOF
# 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 POST "https://api.${DD_SITE}/api/v2/actions/connections" \
-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 Connection exampleactionconnection",
      "integration": {
        "type": "Github",
        "credentials": {
          "type": "GithubPersonalAccessToken",
          "access_token": "example-token",
          "hostname": "github.example.com"
        }
      }
    }
  }
}
EOF
# 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 POST "https://api.${DD_SITE}/api/v2/actions/connections" \
-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 Connection exampleactionconnection",
      "integration": {
        "type": "Github",
        "credentials": {
          "type": "GithubPersonalAccessToken",
          "access_token": "example-token",
          "hostname": "github.example.com"
        }
      }
    }
  }
}
EOF
# 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 POST "https://api.${DD_SITE}/api/v2/actions/connections" \
-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 Connection exampleactionconnection",
      "integration": {
        "type": "Github",
        "credentials": {
          "type": "GithubPersonalAccessToken",
          "access_token": "example-token",
          "hostname": "github.example.com"
        }
      }
    }
  }
}
EOF
# 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 POST "https://api.${DD_SITE}/api/v2/actions/connections" \
-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 Connection exampleactionconnection",
      "integration": {
        "type": "Github",
        "credentials": {
          "type": "GithubPersonalAccessToken",
          "access_token": "example-token",
          "hostname": "github.example.com"
        }
      }
    }
  }
}
EOF
# 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 POST "https://api.${DD_SITE}/api/v2/actions/connections" \
-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 Connection exampleactionconnection",
      "integration": {
        "type": "Github",
        "credentials": {
          "type": "GithubPersonalAccessToken",
          "access_token": "example-token",
          "hostname": "github.example.com"
        }
      }
    }
  }
}
EOF
# 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 POST "https://api.${DD_SITE}/api/v2/actions/connections" \
-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 Connection exampleactionconnection",
      "integration": {
        "type": "Github",
        "credentials": {
          "type": "GithubPersonalAccessToken",
          "access_token": "example-token",
          "hostname": "github.example.com"
        }
      }
    }
  }
}
EOF