> ## 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.

# Customer key of a space

> Niadra operations only, under contract: the customer's KMS key under which the space's new data keys are generated; null returns to the cell's key.



## OpenAPI

````yaml openapi/en/control.json PUT /v1/spaces/{space_id}/kms-key
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/spaces/{space_id}/kms-key:
    put:
      summary: Customer key of a space
      description: >-
        Operators only: a customer-managed key is a contract, never a tenant
        setting.


        **Authentication.** Operator credential (`X-Niadra-Operator-Token`).
        Used by Niadra operations, not by your code.
      operationId: set_space_key_v1_spaces__space_id__kms_key_put
      parameters:
        - in: path
          name: space_id
          required: true
          schema:
            format: uuid
            title: Space Id
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SpaceKeyIn'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SpaceKeyOut'
          description: The space and the key named.
        '422':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
          description: The request does not match the contract.
      security:
        - operatorToken: []
components:
  schemas:
    SpaceKeyIn:
      additionalProperties: false
      description: >-
        The customer's KMS key of a space, under contract (10, D.1); null
        returns new data keys to the

        cell's own key.
      properties:
        kms_key_arn:
          anyOf:
            - maxLength: 256
              type: string
            - type: 'null'
          title: Kms Key Arn
      title: SpaceKeyIn
      type: object
    SpaceKeyOut:
      additionalProperties: false
      properties:
        kms_key_arn:
          anyOf:
            - type: string
            - type: 'null'
          title: Kms Key Arn
        space_id:
          format: uuid
          title: Space Id
          type: string
      required:
        - space_id
      title: SpaceKeyOut
      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:
    operatorToken:
      type: apiKey
      in: header
      name: X-Niadra-Operator-Token

````