> ## Documentation Index
> Fetch the complete documentation index at: https://docs.niadra.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create a secret reference

> Registers the reference of a secret kept in the cell vault.



## OpenAPI

````yaml openapi/en/control.json POST /v1/secret-refs
openapi: 3.1.0
info:
  title: Niadra control API
  version: '1'
  description: >-
    Tenants, projects, sources, keys, people, configuration and usage. It never
    receives customer content.
servers:
  - url: https://control.api.niadra.com
security: []
paths:
  /v1/secret-refs:
    post:
      summary: Create a secret reference
      description: >-
        Registers the reference of a secret the Console wrote straight into the
        cell vault, such as a webhook signing secret. Only metadata travels
        here. Needs the admin, integration or security role.


        **Authentication.** Person token issued by the control plane
        (`Authorization: Bearer <JWT>`), with the role the operation needs.
      operationId: put_secret_ref_v1_secret_refs_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SecretRefIn'
            example:
              space_id: 0192f0a0-3d4e-7f50-8b61-7c8d9e0f1a23
              ref: spaces/0192f0a0-3d4e-7f50-8b61-7c8d9e0f1a23/webhook/whsec-crm
              kind: webhook
              version: 2
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SecretRefOut'
              example:
                space_id: 0192f0a0-3d4e-7f50-8b61-7c8d9e0f1a23
                ref: spaces/0192f0a0-3d4e-7f50-8b61-7c8d9e0f1a23/webhook/whsec-crm
                kind: webhook
                version: 2
                rotated_by: 0192f0a0-4e5f-7061-9c72-8d9e0f1a2b35
                rotated_at: '2026-09-20T15:30:00Z'
          description: The reference.
        '422':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
          description: The request does not match the contract.
      security:
        - personToken: []
components:
  schemas:
    SecretRefIn:
      additionalProperties: false
      properties:
        kind:
          maxLength: 256
          minLength: 1
          title: Kind
          type: string
          description: >-
            `webhook` for a webhook signing secret, `model` for a model
            credential.
        ref:
          maxLength: 256
          minLength: 1
          title: Ref
          type: string
          description: >-
            The path of the secret in the cell vault, such as
            `spaces/<space_id>/webhook/whsec-crm`.
        space_id:
          format: uuid
          title: Space Id
          type: string
        version:
          minimum: 1
          title: Version
          type: integer
      required:
        - space_id
        - ref
        - kind
        - version
      title: SecretRefIn
      type: object
    SecretRefOut:
      additionalProperties: false
      properties:
        kind:
          maxLength: 256
          minLength: 1
          title: Kind
          type: string
        ref:
          maxLength: 256
          minLength: 1
          title: Ref
          type: string
        rotated_at:
          format: date-time
          title: Rotated At
          type: string
        rotated_by:
          format: uuid
          title: Rotated By
          type: string
        space_id:
          format: uuid
          title: Space Id
          type: string
        version:
          minimum: 1
          title: Version
          type: integer
      required:
        - space_id
        - ref
        - kind
        - version
        - rotated_by
        - rotated_at
      title: SecretRefOut
      type: object
    Problem:
      additionalProperties: false
      description: RFC 9457 problem details; `code` comes from the versioned error catalog.
      properties:
        code:
          title: Code
          type: string
        detail:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: Detail
        request_id:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: Request Id
        status:
          title: Status
          type: integer
        title:
          title: Title
          type: string
        type:
          default: about:blank
          title: Type
          type: string
      required:
        - title
        - status
        - code
      title: Problem
      type: object
  securitySchemes:
    personToken:
      type: http
      scheme: bearer
      bearerFormat: JWT

````