Skip to content

Cloud SQL Admin API API

by googleapis.com

OAuthHTTPSAnalytics
Open documentation ↗

Overview

API for Cloud SQL database instance management

Cloud SQL Admin API is an analytics API from googleapis.com. Requests are authenticated with OAuth. It is served over HTTPS. Its OpenAPI description documents 106 endpoints.

At a glance

Authentication
OAuth
HTTPS
Yes
CORS
Unknown
Category
Analytics
Base URL
https://sqladmin.googleapis.com/
Version
v1
Endpoints
106
Spec updated
2023-04-21

Make a first request

Replace the placeholders; the documentation says exactly where credentials go.

cURL
curl -X GET "https://sqladmin.googleapis.com/sql/v1beta4/flags" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer YOUR_TOKEN"
JavaScript
const response = await fetch("https://sqladmin.googleapis.com/sql/v1beta4/flags", {
  method: "GET",
  headers: {
    "Accept": "application/json",
    "Authorization": "Bearer YOUR_TOKEN",
  },
});
const data = await response.json();
console.log(data);
Python
import requests

response = requests.request(
    "GET",
    "https://sqladmin.googleapis.com/sql/v1beta4/flags",
    headers={
    "Accept": "application/json",
    "Authorization": "Bearer YOUR_TOKEN",
    },
    timeout=30,
)
print(response.json())

Endpoints

MethodPathWhat it does
GET/sql/v1beta4/flagsLists all available database flags for Cloud SQL instances.
GET/sql/v1beta4/projects/{project}/instancesLists instances under a given project.
POST/sql/v1beta4/projects/{project}/instancesCreates a new Cloud SQL instance.
GET/sql/v1beta4/projects/{project}/instances/{instance}Retrieves a resource containing information about a Cloud SQL instance.
PUT/sql/v1beta4/projects/{project}/instances/{instance}Updates settings of a Cloud SQL instance. Using this operation might cause your instance to restart.
PATCH/sql/v1beta4/projects/{project}/instances/{instance}Partially updates settings of a Cloud SQL instance by merging the request with the current configuration. This method supports patch semantics.
DELETE/sql/v1beta4/projects/{project}/instances/{instance}Deletes a Cloud SQL instance.
POST/sql/v1beta4/projects/{project}/instances/{instance}/addServerCaAdd a new trusted Certificate Authority (CA) version for the specified instance. Required to prepare for a certificate rotation. If a CA version was previously
GET/sql/v1beta4/projects/{project}/instances/{instance}/backupRunsLists all backup runs associated with the project or a given instance and configuration in the reverse chronological order of the backup initiation time.
POST/sql/v1beta4/projects/{project}/instances/{instance}/backupRunsCreates a new backup run on demand.
GET/sql/v1beta4/projects/{project}/instances/{instance}/backupRuns/{id}Retrieves a resource containing information about a backup run.
DELETE/sql/v1beta4/projects/{project}/instances/{instance}/backupRuns/{id}Deletes the backup taken by a backup run.
POST/sql/v1beta4/projects/{project}/instances/{instance}/cloneCreates a Cloud SQL instance as a clone of the source instance. Using this operation might cause your instance to restart.
GET/sql/v1beta4/projects/{project}/instances/{instance}/connectSettingsRetrieves connect settings about a Cloud SQL instance.
POST/sql/v1beta4/projects/{project}/instances/{instance}/createEphemeralGenerates a short-lived X509 certificate containing the provided public key and signed by a private key specific to the target instance. Users may use the certi
GET/sql/v1beta4/projects/{project}/instances/{instance}/databasesLists databases in the specified Cloud SQL instance.
POST/sql/v1beta4/projects/{project}/instances/{instance}/databasesInserts a resource containing information about a database inside a Cloud SQL instance.
GET/sql/v1beta4/projects/{project}/instances/{instance}/databases/{database}Retrieves a resource containing information about a database inside a Cloud SQL instance.
PUT/sql/v1beta4/projects/{project}/instances/{instance}/databases/{database}Updates a resource containing information about a database inside a Cloud SQL instance.
PATCH/sql/v1beta4/projects/{project}/instances/{instance}/databases/{database}Partially updates a resource containing information about a database inside a Cloud SQL instance. This method supports patch semantics.
DELETE/sql/v1beta4/projects/{project}/instances/{instance}/databases/{database}Deletes a database from a Cloud SQL instance.
POST/sql/v1beta4/projects/{project}/instances/{instance}/demoteMasterDemotes the stand-alone instance to be a Cloud SQL read replica for an external database server.
POST/sql/v1beta4/projects/{project}/instances/{instance}/exportExports data from a Cloud SQL instance to a Cloud Storage bucket as a SQL dump or CSV file.
POST/sql/v1beta4/projects/{project}/instances/{instance}/failoverInitiates a manual failover of a high availability (HA) primary instance to a standby instance, which becomes the primary instance. Users are then rerouted to t
GET/sql/v1beta4/projects/{project}/instances/{instance}/getDiskShrinkConfigGet Disk Shrink Config for a given instance.
POST/sql/v1beta4/projects/{project}/instances/{instance}/importImports data into a Cloud SQL instance from a SQL dump or CSV file in Cloud Storage.
GET/sql/v1beta4/projects/{project}/instances/{instance}/listServerCasLists all of the trusted Certificate Authorities (CAs) for the specified instance. There can be up to three CAs listed: the CA that was used to sign the certifi
POST/sql/v1beta4/projects/{project}/instances/{instance}/performDiskShrinkPerform Disk Shrink on primary instance.
POST/sql/v1beta4/projects/{project}/instances/{instance}/promoteReplicaPromotes the read replica instance to be a stand-alone Cloud SQL instance. Using this operation might cause your instance to restart.
POST/sql/v1beta4/projects/{project}/instances/{instance}/rescheduleMaintenanceReschedules the maintenance on the given instance.
POST/sql/v1beta4/projects/{project}/instances/{instance}/resetReplicaSizeReset Replica Size to primary instance disk size.
POST/sql/v1beta4/projects/{project}/instances/{instance}/resetSslConfigDeletes all client certificates and generates a new server SSL certificate for the instance.
POST/sql/v1beta4/projects/{project}/instances/{instance}/restartRestarts a Cloud SQL instance.
POST/sql/v1beta4/projects/{project}/instances/{instance}/restoreBackupRestores a backup of a Cloud SQL instance. Using this operation might cause your instance to restart.
POST/sql/v1beta4/projects/{project}/instances/{instance}/rotateServerCaRotates the server certificate to one signed by the Certificate Authority (CA) version previously added with the addServerCA method.
GET/sql/v1beta4/projects/{project}/instances/{instance}/sslCertsLists all of the current SSL certificates for the instance.
POST/sql/v1beta4/projects/{project}/instances/{instance}/sslCertsCreates an SSL certificate and returns it along with the private key and server certificate authority. The new certificate will not be usable until the instance
GET/sql/v1beta4/projects/{project}/instances/{instance}/sslCerts/{sha1Fingerprint}Retrieves a particular SSL certificate. Does not include the private key (required for usage). The private key must be saved from the response to initial creati
DELETE/sql/v1beta4/projects/{project}/instances/{instance}/sslCerts/{sha1Fingerprint}Deletes the SSL certificate. For First Generation instances, the certificate remains valid until the instance is restarted.
POST/sql/v1beta4/projects/{project}/instances/{instance}/startExternalSyncStart External primary instance migration.
POST/sql/v1beta4/projects/{project}/instances/{instance}/startReplicaStarts the replication in the read replica instance.
POST/sql/v1beta4/projects/{project}/instances/{instance}/stopReplicaStops the replication in the read replica instance.
POST/sql/v1beta4/projects/{project}/instances/{instance}/truncateLogTruncate MySQL general and slow query log tables MySQL only.
GET/sql/v1beta4/projects/{project}/instances/{instance}/usersLists users in the specified Cloud SQL instance.
POST/sql/v1beta4/projects/{project}/instances/{instance}/usersCreates a new user in a Cloud SQL instance.
PUT/sql/v1beta4/projects/{project}/instances/{instance}/usersUpdates an existing user in a Cloud SQL instance.
DELETE/sql/v1beta4/projects/{project}/instances/{instance}/usersDeletes a user from a Cloud SQL instance.
GET/sql/v1beta4/projects/{project}/instances/{instance}/users/{name}Retrieves a resource containing information about a user.
POST/sql/v1beta4/projects/{project}/instances/{instance}/verifyExternalSyncSettingsVerify External primary instance external sync settings.
POST/sql/v1beta4/projects/{project}/instances/{instance}:generateEphemeralCertGenerates a short-lived X509 certificate containing the provided public key and signed by a private key specific to the target instance. Users may use the certi
GET/sql/v1beta4/projects/{project}/operationsLists all instance operations that have been performed on the given Cloud SQL instance in the reverse chronological order of the start time.
GET/sql/v1beta4/projects/{project}/operations/{operation}Retrieves an instance operation that has been performed on an instance.
GET/sql/v1beta4/projects/{project}/tiersLists all available machine types (tiers) for Cloud SQL, for example, `db-custom-1-3840`. For related information, see [Pricing](/sql/pricing).
GET/v1/flagsLists all available database flags for Cloud SQL instances.
GET/v1/projects/{project}/instancesLists instances under a given project.
POST/v1/projects/{project}/instancesCreates a new Cloud SQL instance.
GET/v1/projects/{project}/instances/{instance}Retrieves a resource containing information about a Cloud SQL instance.
PUT/v1/projects/{project}/instances/{instance}Updates settings of a Cloud SQL instance. Using this operation might cause your instance to restart.
PATCH/v1/projects/{project}/instances/{instance}Partially updates settings of a Cloud SQL instance by merging the request with the current configuration. This method supports patch semantics.
DELETE/v1/projects/{project}/instances/{instance}Deletes a Cloud SQL instance.
POST/v1/projects/{project}/instances/{instance}/addServerCaAdds a new trusted Certificate Authority (CA) version for the specified instance. Required to prepare for a certificate rotation. If a CA version was previously
GET/v1/projects/{project}/instances/{instance}/backupRunsLists all backup runs associated with the project or a given instance and configuration in the reverse chronological order of the backup initiation time.
POST/v1/projects/{project}/instances/{instance}/backupRunsCreates a new backup run on demand.
GET/v1/projects/{project}/instances/{instance}/backupRuns/{id}Retrieves a resource containing information about a backup run.
DELETE/v1/projects/{project}/instances/{instance}/backupRuns/{id}Deletes the backup taken by a backup run.
POST/v1/projects/{project}/instances/{instance}/cloneCreates a Cloud SQL instance as a clone of the source instance. Using this operation might cause your instance to restart.
GET/v1/projects/{project}/instances/{instance}/connectSettingsRetrieves connect settings about a Cloud SQL instance.
POST/v1/projects/{project}/instances/{instance}/createEphemeralGenerates a short-lived X509 certificate containing the provided public key and signed by a private key specific to the target instance. Users may use the certi
GET/v1/projects/{project}/instances/{instance}/databasesLists databases in the specified Cloud SQL instance.
POST/v1/projects/{project}/instances/{instance}/databasesInserts a resource containing information about a database inside a Cloud SQL instance.
GET/v1/projects/{project}/instances/{instance}/databases/{database}Retrieves a resource containing information about a database inside a Cloud SQL instance.
PUT/v1/projects/{project}/instances/{instance}/databases/{database}Updates a resource containing information about a database inside a Cloud SQL instance.
PATCH/v1/projects/{project}/instances/{instance}/databases/{database}Partially updates a resource containing information about a database inside a Cloud SQL instance. This method supports patch semantics.
DELETE/v1/projects/{project}/instances/{instance}/databases/{database}Deletes a database from a Cloud SQL instance.
POST/v1/projects/{project}/instances/{instance}/demoteMasterDemotes the stand-alone instance to be a Cloud SQL read replica for an external database server.
POST/v1/projects/{project}/instances/{instance}/exportExports data from a Cloud SQL instance to a Cloud Storage bucket as a SQL dump or CSV file.
POST/v1/projects/{project}/instances/{instance}/failoverInitiates a manual failover of a high availability (HA) primary instance to a standby instance, which becomes the primary instance. Users are then rerouted to t
GET/v1/projects/{project}/instances/{instance}/getDiskShrinkConfigGet Disk Shrink Config for a given instance.
POST/v1/projects/{project}/instances/{instance}/importImports data into a Cloud SQL instance from a SQL dump or CSV file in Cloud Storage.
GET/v1/projects/{project}/instances/{instance}/listServerCasLists all of the trusted Certificate Authorities (CAs) for the specified instance. There can be up to three CAs listed: the CA that was used to sign the certifi
POST/v1/projects/{project}/instances/{instance}/performDiskShrinkPerform Disk Shrink on primary instance.
POST/v1/projects/{project}/instances/{instance}/promoteReplicaPromotes the read replica instance to be a stand-alone Cloud SQL instance. Using this operation might cause your instance to restart.
POST/v1/projects/{project}/instances/{instance}/rescheduleMaintenanceReschedules the maintenance on the given instance.
POST/v1/projects/{project}/instances/{instance}/resetReplicaSizeReset Replica Size to primary instance disk size.
POST/v1/projects/{project}/instances/{instance}/resetSslConfigDeletes all client certificates and generates a new server SSL certificate for the instance.
POST/v1/projects/{project}/instances/{instance}/restartRestarts a Cloud SQL instance.
POST/v1/projects/{project}/instances/{instance}/restoreBackupRestores a backup of a Cloud SQL instance. Using this operation might cause your instance to restart.
POST/v1/projects/{project}/instances/{instance}/rotateServerCaRotates the server certificate to one signed by the Certificate Authority (CA) version previously added with the addServerCA method.
GET/v1/projects/{project}/instances/{instance}/sslCertsLists all of the current SSL certificates for the instance.
POST/v1/projects/{project}/instances/{instance}/sslCertsCreates an SSL certificate and returns it along with the private key and server certificate authority. The new certificate will not be usable until the instance
GET/v1/projects/{project}/instances/{instance}/sslCerts/{sha1Fingerprint}Retrieves a particular SSL certificate. Does not include the private key (required for usage). The private key must be saved from the response to initial creati
DELETE/v1/projects/{project}/instances/{instance}/sslCerts/{sha1Fingerprint}Deletes the SSL certificate. For First Generation instances, the certificate remains valid until the instance is restarted.
POST/v1/projects/{project}/instances/{instance}/startExternalSyncStart External primary instance migration.
POST/v1/projects/{project}/instances/{instance}/startReplicaStarts the replication in the read replica instance.
POST/v1/projects/{project}/instances/{instance}/stopReplicaStops the replication in the read replica instance.
POST/v1/projects/{project}/instances/{instance}/truncateLogTruncate MySQL general and slow query log tables MySQL only.
GET/v1/projects/{project}/instances/{instance}/usersLists users in the specified Cloud SQL instance.
POST/v1/projects/{project}/instances/{instance}/usersCreates a new user in a Cloud SQL instance.
PUT/v1/projects/{project}/instances/{instance}/usersUpdates an existing user in a Cloud SQL instance.
DELETE/v1/projects/{project}/instances/{instance}/usersDeletes a user from a Cloud SQL instance.

Showing the first 100 of 106 endpoints; the full list is in the documentation.

Questions

Does the Cloud SQL Admin API API need an API key?

Yes. The Cloud SQL Admin API API uses OAuth authentication; the documentation explains how to get credentials.

Does the Cloud SQL Admin API API support HTTPS?

Yes, the Cloud SQL Admin API API is served over HTTPS.

How many endpoints does the Cloud SQL Admin API API have?

Its OpenAPI description lists 106 endpoints in version v1. The first 100 are shown on this page.

What are alternatives to the Cloud SQL Admin API API?

Other Analytics APIs include Google Play Integrity API, versionhistory.googleapis.com API, Doc Converter, Perspective Comment Analyzer API, Safe Browsing API.

Compare alternatives →

Google Play Integrity API

Analytics

The Play Integrity API helps you check that you're interacting with your genuine app on a genuine Android device powered by Google Play services. The Play Integrity API has replaced SafetyNet Attestation and Android Device Verification.

OAuth1 endpoints

versionhistory.googleapis.com API

Analytics

Version History API - Prod

No auth4 endpoints

Doc Converter

Analytics

This api converts file formats of OpenXml and OpenOffice documents formats to vector files (e.g., svg)

No auth1 endpoints

Perspective Comment Analyzer API

Analytics

The Perspective Comment Analyzer API provides information about the potential impact of a comment on a conversation (e.g. it can provide a score for the "toxicity" of a comment). Users can leverage the "SuggestCommentScore" method to submit corrections to improve Perspective over time. Users can set the "doNotStore" flag to ensure that all submitted comments are automatically deleted after scores are returned.

OAuth2 endpoints

Safe Browsing API

Analytics

Enables client applications to check web resources (most commonly URLs) against Google-generated lists of unsafe web resources. The Safe Browsing APIs are for non-commercial use only. If you need to use APIs to detect malicious URLs for commercial purposes – meaning “for sale or revenue-generating purposes” – please refer to the Web Risk API.

No auth7 endpoints

Web Fonts Developer API

Analytics

The Google Web Fonts Developer API lets you retrieve information about web fonts served by Google.

No auth1 endpoints

Listed from APIs.guru (CC0).