---
title: "Add a write-only agent credential"
method: POST
path: "/v1/agent-secrets"
tags: ["Secrets"]
---

# Add a write-only agent credential

`POST /v1/agent-secrets`

## Request

- Base URL: `https://api.shardflux.dev`
- URL: `https://api.shardflux.dev/v1/agent-secrets`
- Auth: HTTP bearer

## Request body

- object
  - `scope` 'agents' | 'project' | 'conversation', required
  - `organization_id` string, uuid: UUIDv7, lowercase canonical form.
  - `project_id` string, uuid: UUIDv7, lowercase canonical form.
  - `conversation_id` string
  - `name` string, required
  - `value` string, required: Write-only UTF-8 secret, using the existing secret store.
  - `description` string

## Response `201`

Default Response

- object
  - `id` string, uuid, required: UUIDv7, lowercase canonical form.
  - `organization_id` string, uuid, required: UUIDv7, lowercase canonical form.
  - `project_id` string, uuid, nullable, required: UUIDv7, lowercase canonical form.
  - `conversation_id` string, nullable, required
  - `user_id` string, uuid, nullable, required: UUIDv7, lowercase canonical form.
  - `scope` 'agents' | 'project' | 'conversation', required
  - `name` string, required
  - `description` string, required
  - `current_version` integer, required
  - `created_at` string, date-time, required: RFC 3339 UTC timestamp with Z.
  - `updated_at` string, date-time, required: RFC 3339 UTC timestamp with Z.
  - `last_used_at` string, date-time, nullable, required: RFC 3339 UTC timestamp with Z.

## Other responses

- `4XX`: Default Response
- `5XX`: Default Response

---

[API](https://skmtc.dev/shardflux/apis/shardflux-api.md) · [All operations](https://skmtc.dev/shardflux/apis/shardflux-api/llms.txt) · [OpenAPI document](https://skmtc.dev/shardflux/apis/shardflux-api/revisions/ea685f7b39c4?raw)
