---
title: "Ensure a log forwarding public key"
method: POST
path: "/public-keys/log-forwarding/ensure"
tags: ["Public Keys"]
---

# Ensure a log forwarding public key

`POST /public-keys/log-forwarding/ensure`

## Request

- Base URL: `https://api.sazabi.com/v1`
- URL: `https://api.sazabi.com/v1/public-keys/log-forwarding/ensure`
- Auth: none declared

Ensure a reusable project-scoped public key exists for CLI log forwarding.

## Request body

- object
  - `projectId` string, uuid: Project to ensure the log forwarding key for. Auto-filled from CLI and SDK context when omitted.

## Response `200`

OK

- object
  - `publicKey` object, required
    - `id` string, uuid, required
    - `name` string, required
    - `expiresAt` string, date-time, nullable, required
    - `lastUsedAt` string, date-time, nullable, required
    - `createdAt` string, date-time, required
    - `projectId` string, uuid, required
    - `dataSourceConnectionId` string, uuid, nullable, required: Linked data source connection ID when this key is scoped to one data source.
    - `deactivatedAt` string, date-time, nullable, required: Timestamp when this public key was deactivated.
    - `value` string, required

---

[API](https://skmtc.dev/sazabi/apis/sazabi-public-api.md) - [All operations](https://skmtc.dev/sazabi/apis/sazabi-public-api/llms.txt) - [OpenAPI document](https://skmtc.dev/sazabi/apis/sazabi-public-api/revisions/965b6230cf45?raw)
