Get a MySQL instance

Get a MySQL instance. Get its password via betterstack mysql credentials.

GET https://{availability_zone}.betterstackcloud.com/v1/mysql/{id}
id string required

The ID of the MySQL instance to get.

Authorization string required

Bearer $TOKEN

200 OK
{
  "id": "example",
  "name": "Example MySQL instance",
  "type": "MY1",
  "usable_disk_gb": 1,
  "max_connections": 1,
  "engine_version": "1.4.2",
  "engine_patch_version": "1.4.2",
  "available_engine_versions": [
    "1.4.2"
  ],
  "status": "provisioning",
  "status_message": "example",
  "sql_mode": "example",
  "sql_require_primary_key": false,
  "default_time_zone": "UTC",
  "max_allowed_packet": 67108864,
  "public_access": false,
  "replica_count": 0,
  "read_only": false,
  "endpoint": {
    "hostname": "proxy.example.com",
    "public_hostname": "proxy.example.com",
    "port": 443,
    "private_ips": [
      {
        "network_id": "123456789",
        "ip_address": "example"
      }
    ],
    "public_ips": [
      {
        "ip": "example",
        "type": "example"
      }
    ]
  },
  "members": [
    {
      "id": "example",
      "role": "primary",
      "status": "provisioning",
      "replication_lag_seconds": 1.5,
      "disk_used_bytes": 1,
      "private_ips": [
        {
          "network_id": "123456789",
          "ip_address": "example"
        }
      ],
      "created_at": "2026-07-01T12:00:00.000Z"
    }
  ],
  "network_ids": [
    "123456789"
  ],
  "firewall_ids": [
    "123456789"
  ],
  "latest_snapshot_at": "2026-07-01T12:00:00.000Z",
  "term": "monthly",
  "created_at": "2026-07-01T12:00:00.000Z",
  "updated_at": "2026-07-01T12:00:00.000Z",
  "team_id": "t123",
  "metadata": {
    "example": "value"
  }
}

Returns the MySQL instance.

id string

The instance's ID, a UUID.

name string

The instance's name, at most 255 characters.

type string

The instance's type, such as MY1. List the types with betterstack mysql-type list.

usable_disk_gb integer

The disk space for your data, in GiB.

max_connections integer

The most connections the instance accepts at once.

engine_version string

The MySQL version, as major and minor, such as 9.7. List the versions with betterstack mysql-version list.

engine_patch_version string or null

The exact MySQL release installed, or null until it's known.

available_engine_versions array of strings

The versions you can upgrade the instance to. An upgrade can't be undone.

status string

The instance's state.
Valid values:
provisioning: We're starting the members and installing MySQL.
running: The instance is ready.
degraded: A member is down, replication is broken or the disk is almost full. status_message says which.
rescaling: We're changing the instance's type.
upgrading: We're upgrading the instance to a newer MySQL version.
restoring: We're restoring the instance from a snapshot.
failed: We couldn't create the instance. status_message says why. Create a new one instead.
destroyed: The instance is destroyed.

status_message string or null

Why the instance is in its current state, such as what failed or which operation didn't finish. Is null when there's nothing to report.

sql_mode string or null

The SQL modes, separated by commas, such as STRICT_TRANS_TABLES,NO_ZERO_DATE. Is null for MySQL's default modes.

sql_require_primary_key boolean

Whether new tables must have a primary key.

default_time_zone string

The default time zone. Accepts SYSTEM, UTC, an offset from -13:59 to +14:00, or an IANA time zone name such as Europe/Prague.

max_allowed_packet integer

The largest packet MySQL accepts, in bytes, from 16777216 to 1073741824.

public_access boolean

Whether the instance is also reachable on public IP addresses. Clients must connect with TLS.

replica_count integer

The number of read replicas, from 0 to 2.

read_only boolean

Whether the instance accepts only reads because its disk is almost full.

endpoint object

Where clients connect to the current primary.

endpoint.hostname string

The hostname to connect to from your networks. Resolves to the primary's addresses in your networks.

endpoint.public_hostname string or null

The hostname to connect to from the internet, or null when public_access is off. Resolves to the primary's public addresses.

endpoint.port integer

The port to connect to, 3306.

endpoint.private_ips array of objects

The primary's addresses in your networks.

endpoint.private_ips[].network_id string

The ID of the network.

endpoint.private_ips[].ip_address string

The address in that network.

endpoint.public_ips array of objects

The primary's public addresses, empty when public_access is off.

endpoint.public_ips[].ip string

The public address.

endpoint.public_ips[].type string

Whether it's an ipv4 or ipv6 address.

members array of objects

The instance's members, the primary and its replicas. A replica's replication_lag_seconds says how far behind the primary it is, and it's null on the primary.

members[].id string

The id.

members[].role string

Possible values: primary, replica.

members[].status string

Possible values: provisioning, syncing, running, down.

members[].replication_lag_seconds number or null

The replication lag seconds.

members[].disk_used_bytes integer

The disk used bytes.

members[].private_ips array of objects

The private ips.

members[].private_ips[].network_id string

The network id.

members[].private_ips[].ip_address string

The ip address.

members[].created_at datetime

In ISO 8601 format, such as 2026-07-01T12:00:00Z.

network_ids array of strings

The IDs of your networks attached to every member. Order doesn't matter.

firewall_ids array of strings

The ID of the firewall attached to every member. An instance can have one firewall. Order doesn't matter.

latest_snapshot_at datetime or null

When the newest available snapshot was taken, or null when there's none. In ISO 8601 format, such as 2026-07-01T12:00:00Z.

term string

The billing term. Defaults to monthly.
Valid values:
monthly: Billed every month.
annual: Paid for a year.

created_at datetime

When the instance was created. In ISO 8601 format, such as 2026-07-01T12:00:00Z.

updated_at datetime

When the instance was last updated. In ISO 8601 format, such as 2026-07-01T12:00:00Z.

team_id string

The ID of the team that owns the instance. betterstack team list shows it.

metadata object

Your tags, as an object of string keys and values.