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

# Create or update a settings profile

> Create the profile, or append a new version when it exists (whole-body
replace). Returns ``{ok: true, version}`` — NEVER the stored body, so a secret
never re-emits on the write path. A reserved ``@``-prefixed name is a loud 400.
The profile's DECLARED env is run through the shared boundary validator
(``ConfigService._validate_replace``): a payload carrying an X-band key or leaving
a manifest ``!ENV`` marker dangling is refused at save time, naming the key.



## OpenAPI

````yaml /openapi.json put /api/config/profiles/{name}
openapi: 3.1.0
info:
  description: The operator HTTP surface served under /api/*.
  title: tai42-skeleton API
  version: 14.0.2
servers: []
security: []
paths:
  /api/config/profiles/{name}:
    put:
      tags:
        - config
      summary: Create or update a settings profile
      description: >-
        Create the profile, or append a new version when it exists (whole-body

        replace). Returns ``{ok: true, version}`` — NEVER the stored body, so a
        secret

        never re-emits on the write path. A reserved ``@``-prefixed name is a
        loud 400.

        The profile's DECLARED env is run through the shared boundary validator

        (``ConfigService._validate_replace``): a payload carrying an X-band key
        or leaving

        a manifest ``!ENV`` marker dangling is refused at save time, naming the
        key.
      operationId: put_api_config_profiles_name
      parameters:
        - in: path
          name: name
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SettingsProfileBody'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  data:
                    $ref: '#/components/schemas/ProfileWriteResult'
                required:
                  - data
                type: object
          description: Success.
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Malformed request.
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Missing or invalid api key.
        '501':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Error.
      security:
        - ApiKeyAuth: []
components:
  schemas:
    SettingsProfileBody:
      description: >-
        The persisted body of a versioned settings profile.


        ``env`` is the whole profile-managed env band (values verbatim, secrets

        included — the store rides the ``secret=True`` versioned-documents
        backup

        section); applying the profile REPLACES the stored env with it (a key
        the

        profile does not name is deleted, save the carried X-band).
        ``secret_keys`` are

        the per-profile secret marks (which ``env`` keys are secret) folded into
        the

        display mask union. ``description`` is the profile's human description.
      properties:
        description:
          default: ''
          title: Description
          type: string
        env:
          additionalProperties:
            type: string
          title: Env
          type: object
        secret_keys:
          items:
            type: string
          title: Secret Keys
          type: array
      title: SettingsProfileBody
      type: object
    ProfileWriteResult:
      description: >-
        A profile write/rollback confirmation — the new active version, never
        the body

        (so a secret never re-emits on the write path).
      properties:
        ok:
          title: Ok
          type: boolean
        version:
          title: Version
          type: integer
      required:
        - ok
        - version
      title: ProfileWriteResult
      type: object
    Error:
      properties:
        code:
          description: >-
            Stable machine-readable reason a client keys a dedicated error state
            on, present on refusals that opt in (e.g. a 501 not-configured
            refusal). Optional: absent when the error carries only a
            human-readable message.
          type: string
        error:
          type: string
      required:
        - error
      type: object
  securitySchemes:
    ApiKeyAuth:
      in: header
      name: x-api-key
      type: apiKey

````