Skip to content

Create a new database connection

Request

OPA roles:
  • resource_admin

Creates a new database connection for the specified team

Security
bearerAuth
Path
team_namestringrequired

The name of your team

Bodyapplication/jsonrequired
auth_detailsanyrequired
auth_typestring(DatabaseAuthType)required

The authentication type for the database connection

Enum ValueDescription
postgres_basic_auth

Username and password for PostgreSQL database connection

mysql_basic_auth

Username and password for MySQL database connection

mongodb_basic_auth

Username and password for MongoDB database connection

mariadb_basic_auth

Username and password for MariaDB database connection

mssql_basic_auth

Username and password for Microsoft SQL Server database connection

oracledb_basic_auth

Username and password for Oracle database connection

descriptionstring, <= 1024 characters

A description of the database connection

infrastructure_orchestratorobject(NamedObject)required

The infrastructure orchestrator to associate with this database connection

namestring, [ 3 .. 100 ] charactersrequired

The name for the database connection

curl -i -X POST \
  'https://{org_name}.pam-okta.login.adsbillinghub.com/v1/teams/{team_name}/connections/databases' \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "Production PostgreSQL",
    "description": "Primary production database",
    "auth_type": "postgres_basic_auth",
    "auth_details": {
      "_type": "postgres_basic_auth",
      "username": "admin_user",
      "host": "db.example.com",
      "port": 5432,
      "password_jwe": "eyJhbGciOiJSU0EtT0FFUC0yNTYiLCJlbmMiOiJBMjU2R0NNIn0..."
    },
    "infrastructure_orchestrator": {
      "id": "550e8400-e29b-41d4-a716-446655440000"
    }
  }'

Responses

Created

Bodyapplication/json
auth_detailsanyread-onlyrequired
auth_typestring(DatabaseAuthType)required

The authentication type for the database connection

Enum ValueDescription
postgres_basic_auth

Username and password for PostgreSQL database connection

mysql_basic_auth

Username and password for MySQL database connection

mongodb_basic_auth

Username and password for MongoDB database connection

mariadb_basic_auth

Username and password for MariaDB database connection

mssql_basic_auth

Username and password for Microsoft SQL Server database connection

oracledb_basic_auth

Username and password for Oracle database connection

created_atstring, (date-time)read-onlyrequired

A UTC timestamp that indicates when the database connection was created

descriptionstringread-only

A description of the database connection

external_scopestring or null(OracleIntegrationScope)read-only

The Oracle integration scope, populated after the connection is created. Absent for non-Oracle integrations.

Enum ValueDescription
CDB

A container database that manages one or more pluggable databases and common users under CDB$ROOT

PDB

A single pluggable database within a container database

NON_CDB

A classic, non-multitenant Oracle database instance

health_issuesArray of objects(IntegrationHealthIssue)read-onlyrequired

The list of active health issues that roll up into the status. The array is empty when the connection is healthy. Exception: for marked_for_deletion connections the status field is authoritative and overrides the rollup. It reflects the result of the last completed health check and may lag a recent configuration change (for example, updating credentials) until the next health-check cycle runs.

idstring, (regex)(UUID)^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-...read-onlyrequired

The UUID of the database connection

Example:"a747a818-a4c4-4446-8a87-704216495a08"
last_discovery_run_atstring or null, (date-time)read-only

A UTC timestamp that indicates when the last discovery scan was performed

last_health_check_atstring or null, (date-time)read-only

A UTC timestamp that indicates when the last health check ran. The status and health_issues fields reflect the result of this check. The value is null if a health check has never run for the connection.

last_status_change_atstring, (date-time)read-only

A UTC timestamp that indicates when the status was last changed

namestringread-onlyrequired

The name for the database connection

statusstring(DatabaseConnectionStatus)read-onlyrequired

The current status of the database connection. This is the rolled-up health, the worst of the connection's lifecycle state and its active health issues (see the health_issues property). A status of warning or failed with an empty issues list reflects a lifecycle condition (such as a failed rotation or an inconclusive health check) that doesn't yet map to a specific issue.

Enum ValueDescription
active

No active health issues; the connection is healthy and operational

warning

At least one warning-severity issue and no error-severity issues; or a lifecycle condition (such as an inconclusive health check) that does not yet map to a specific issue

failed

At least one error-severity issue, such as invalid credentials or no network connectivity

marked_for_deletion

The connection has been marked for deletion and is pending cleanup

updated_atstring, (date-time)read-onlyrequired

A UTC timestamp that indicates when the database connection was last updated

infrastructure_orchestratorobject(NamedObject)read-onlyrequired

The infrastructure orchestrator associated with this database connection

Response
{ "id": "a747a818-a4c4-4446-8a87-704216495a08", "name": "Production PostgreSQL", "description": "Primary production database", "auth_type": "postgres_basic_auth", "auth_details": { "_type": "postgres_basic_auth", "username": "admin_user", "host": "db.example.com", "port": 5432 }, "status": "active", "last_status_change_at": "2024-01-15T10:30:00Z", "last_discovery_run_at": "2024-01-15T11:00:00Z", "health_issues": [], "last_health_check_at": "2024-01-15T11:05:00Z", "created_at": "2024-01-01T00:00:00Z", "updated_at": "2024-01-15T10:30:00Z", "infrastructure_orchestrator": { "id": "550e8400-e29b-41d4-a716-446655440000", "name": "rg-1" } }