---
title: "Create a secret"
method: POST
path: "/secrets"
tags: ["secrets"]
---

# Create a secret

`POST /secrets`

Creates a new secret.

Required scope: \`secrets:write\`

## Request body

- CreateSecretRequest
  - `name` string, required — Name of the secret
  - `secret` string, required — The secret value
  - `type` 'google_drive' | 'github' | 'notion' | 'x' | 'xai' | 'chartmetric', required — The type of the secret
  - `description` string — Description of the secret
  - `chartmetric_consent` ChartmetricConsent, nullable — Explicit consent for the Chartmetric plan and build-embedded data-use profile. This object is required only when creating a Chartmetric secret.
    - `plan_profile` string, required
    - `data_use_profile` string, required
    - `enable_for_all_agents` true, required
    - `accept_quota_rate_cost` true, required
    - `accept_llm_processing` true, required
    - `accept_history_storage` true, required
    - `accept_retention_deletion` true, required

## Response `200`

Successfully created secret

- Secret
  - `id` string, required — Secret ID
  - `name` string, required — Name of the secret
  - `type` 'google_drive' | 'github' | 'notion' | 'x' | 'xai' | 'chartmetric', required — The type of the secret
  - `description` string — Description of the secret
  - `last_update_time` integer, required — Last updated time (Unix timestamp in seconds)
  - `creation_time` integer, required — Creation time (Unix timestamp in seconds)
  - `chartmetric_lifecycle_state` 'pending_create' | 'active' | 'pending_update' | 'pending_delete' — Persistent lifecycle state of a Chartmetric credential
  - `chartmetric_consent` ChartmetricConsentSummary, nullable
    - `plan_profile` string, required
    - `data_use_profile` string, required
    - `accepted_at` integer, required — Consent acceptance time (Unix timestamp in seconds)

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `403` — Plan limit reached
- `409` — Conflict - The secret already exists or a concurrent revision conflict occurred
- `412` — Precondition Failed - The Chartmetric registration or lifecycle state does not allow this operation
- `500` — Internal Server Error
- `503` — Service Unavailable - The credential store is temporarily unavailable

## Changes

> 71 revisions in range; 18 not diffed.

- **2026-03-17** `b50a49abec5e` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/qlonolink/apis/qaip-apis/changes/secrets/post.md)

---

[API](https://skmtc.dev/qlonolink/apis/qaip-apis.md) · [All operations](https://skmtc.dev/qlonolink/apis/qaip-apis/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/qlonolink/qaip-apis/revisions/61dc40676905/schema)
