- [HTTP request](https://docs.cloud.google.com/sql/docs/sqlserver/admin-api/rest/v1/sslCerts/insert#body.HTTP_TEMPLATE)
- [Path parameters](https://docs.cloud.google.com/sql/docs/sqlserver/admin-api/rest/v1/sslCerts/insert#body.PATH_PARAMETERS)
- [Request body](https://docs.cloud.google.com/sql/docs/sqlserver/admin-api/rest/v1/sslCerts/insert#body.request_body)
- [Response body](https://docs.cloud.google.com/sql/docs/sqlserver/admin-api/rest/v1/sslCerts/insert#body.response_body)
  - [JSON representation](https://docs.cloud.google.com/sql/docs/sqlserver/admin-api/rest/v1/sslCerts/insert#body.SslCertsInsertResponse.SCHEMA_REPRESENTATION)
- [Authorization scopes](https://docs.cloud.google.com/sql/docs/sqlserver/admin-api/rest/v1/sslCerts/insert#body.aspect)
- [SslCertsInsertRequest](https://docs.cloud.google.com/sql/docs/sqlserver/admin-api/rest/v1/sslCerts/insert#SslCertsInsertRequest)
  - [JSON representation](https://docs.cloud.google.com/sql/docs/sqlserver/admin-api/rest/v1/sslCerts/insert#SslCertsInsertRequest.SCHEMA_REPRESENTATION)
- [SslCertDetail](https://docs.cloud.google.com/sql/docs/sqlserver/admin-api/rest/v1/sslCerts/insert#SslCertDetail)
  - [JSON representation](https://docs.cloud.google.com/sql/docs/sqlserver/admin-api/rest/v1/sslCerts/insert#SslCertDetail.SCHEMA_REPRESENTATION)
- [Examples](https://docs.cloud.google.com/sql/docs/sqlserver/admin-api/rest/v1/sslCerts/insert#examples)
- [Try it!](https://docs.cloud.google.com/sql/docs/sqlserver/admin-api/rest/v1/sslCerts/insert#try-it)

Creates 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 is restarted.

### HTTP request

`POST https://sqladmin.googleapis.com/v1/projects/{project}/instances/{instance}/sslCerts`

The URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.

### Path parameters

| Parameters ||
|---|---|
| `project` | `string` Project ID of the project that contains the instance. |
| `instance` | `string` Cloud SQL instance ID. This does not include the project ID. |

### Request body

The request body contains an instance of `https://docs.cloud.google.com/sql/docs/sqlserver/admin-api/rest/v1/sslCerts/insert#SslCertsInsertRequest`.

### Response body

SslCert insert response.

If successful, the response body contains data with the following structure:

| JSON representation |
|---|
| ``` { "kind": string, "operation": { object (`https://docs.cloud.google.com/sql/docs/sqlserver/admin-api/rest/v1/operations#Operation`) }, "serverCaCert": { object (`https://docs.cloud.google.com/sql/docs/sqlserver/admin-api/rest/v1/sslCerts#SslCert`) }, "clientCert": { object (`https://docs.cloud.google.com/sql/docs/sqlserver/admin-api/rest/v1/sslCerts/insert#SslCertDetail`) } } ``` |

| Fields ||
|---|---|
| `kind` | `string` This is always `sql#sslCertsInsert`. |
| `operation` | ``object (`https://docs.cloud.google.com/sql/docs/sqlserver/admin-api/rest/v1/operations#Operation`)`` The operation to track the ssl certs insert request. |
| `serverCaCert` | ``object (`https://docs.cloud.google.com/sql/docs/sqlserver/admin-api/rest/v1/sslCerts#SslCert`)`` The server Certificate Authority's certificate. If this is missing you can force a new one to be generated by calling resetSslConfig method on instances resource. |
| `clientCert` | ``object (`https://docs.cloud.google.com/sql/docs/sqlserver/admin-api/rest/v1/sslCerts/insert#SslCertDetail`)`` The new client certificate and private key. |

### Authorization scopes

Requires one of the following OAuth scopes:

- `https://www.googleapis.com/auth/cloudsql`
- `
  https://www.googleapis.com/auth/cloud-platform`
- `
  https://www.googleapis.com/auth/sqlservice.admin`

For more information, see the [Authentication Overview](https://docs.cloud.google.com/docs/authentication#authorization-gcp).

## SslCertsInsertRequest

SslCerts insert request.

| JSON representation |
|---|
| ``` { "commonName": string } ``` |

| Fields ||
|---|---|
| `commonName` | `string` User supplied name. Must be a distinct name from the other certificates for this instance. |

## SslCertDetail

SslCertDetail.

| JSON representation |
|---|
| ``` { "certInfo": { object (`https://docs.cloud.google.com/sql/docs/sqlserver/admin-api/rest/v1/sslCerts#SslCert`) }, "certPrivateKey": string } ``` |

| Fields ||
|---|---|
| `certInfo` | ``object (`https://docs.cloud.google.com/sql/docs/sqlserver/admin-api/rest/v1/sslCerts#SslCert`)`` The public information about the cert. |
| `certPrivateKey` | `string` The private key for the client cert, in pem format. Keep private in order to protect your security. |