---
title: "POST /v1/projects/{project}/instances/{instance}:generateEphemeralCert"
method: POST
path: "/v1/projects/{project}/instances/{instance}:generateEphemeralCert"
tags: ["connect"]
---

# POST /v1/projects/{project}/instances/{instance}:generateEphemeralCert

`POST /v1/projects/{project}/instances/{instance}:generateEphemeralCert`

Generates 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 certificate to authenticate as themselves when connecting to the database.

## Path parameters

- `project` string, required
- `instance` string, required

## Request body

- GenerateEphemeralCertRequest — Ephemeral certificate creation request.
  - `public_key` string — PEM encoded public key to include in the signed certificate.
  - `access_token` string — Optional. Access token to include in the signed certificate.
  - `readTime` string, google-datetime — Optional. Optional snapshot read timestamp to trade freshness for performance.
  - `validDuration` string, google-duration — Optional. If set, it will contain the cert valid duration.

## Response `200`

Successful response

---

[API](https://skmtc.net/google/apis/sqladmin.md) · [All operations](https://skmtc.net/google/apis/sqladmin/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/google/sqladmin/versions/e9eef8a2afcd/schema)
