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

# Replace header configuration



## OpenAPI

````yaml /openapi.yaml put /cloud-cdn/distributions/configurations/headers
openapi: 3.1.0
info:
  title: Aptranet API
  version: 1.0.0
  summary: Public Cloud CDN and Cloud DNS control-plane API
  description: |
    Automate project-scoped Aptranet Cloud CDN and Cloud DNS resources.
    Every endpoint requires an active API key access key and its current secret.
  contact:
    name: Aptranet Support
    email: support@aptranet.com
  license:
    name: Proprietary
servers:
  - url: https://api.aptranet.com
    description: Production
security:
  - bearerAuth: []
    apiSecret: []
tags:
  - name: CDN distributions
    description: Create and manage Cloud CDN distributions.
  - name: CDN configuration
    description: Read and replace distribution delivery configuration.
  - name: CDN origin groups
    description: Manage primary, backup, HTTP, and object-storage origins.
  - name: CDN cache tools
    description: Purge and prefetch distribution content.
  - name: CDN analytics
    description: Read traffic, cache, geography, region, and protocol analytics.
  - name: DNS zones
    description: Manage authoritative zones and SOA settings.
  - name: DNS record sets
    description: Manage DNS record sets, routing metadata, and resource records.
  - name: DNS analytics
    description: Read zone query analytics and project DNS checks.
paths:
  /cloud-cdn/distributions/configurations/headers:
    put:
      tags:
        - CDN configuration
      summary: Replace header configuration
      operationId: updateHeadersConfiguration
      parameters:
        - $ref: '#/components/parameters/DistributionId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/HeadersConfiguration'
      responses:
        '200':
          description: Header configuration updated.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/ValidationError'
components:
  parameters:
    DistributionId:
      name: distribution
      in: query
      required: true
      description: Distribution identifier.
      schema:
        type: integer
        minimum: 1
  schemas:
    HeadersConfiguration:
      type: object
      required:
        - cors_headers
        - custom_host_header
        - static_request_headers
        - static_response_headers
        - response_headers_hiding_policy
      properties:
        cors_headers:
          type: object
          required:
            - enabled
            - mode
            - add_always
          properties:
            enabled:
              type: boolean
            mode:
              type: string
              enum:
                - all_origins
                - http_origin_for_listed_origins
                - http_origin_for_all_origins
            origins:
              type: array
              items:
                type: string
            value:
              type: string
            add_always:
              type: boolean
        custom_host_header:
          type: object
          required:
            - enabled
            - mode
          properties:
            enabled:
              type: boolean
            mode:
              type: string
              enum:
                - custom
                - forward
            value:
              type: string
        static_request_headers:
          type: object
          required:
            - enabled
            - headers
          properties:
            enabled:
              type: boolean
            headers:
              type: array
              items:
                $ref: '#/components/schemas/HeaderNameValue'
        static_response_headers:
          type: object
          required:
            - enabled
            - headers
          properties:
            enabled:
              type: boolean
            headers:
              type: array
              items:
                allOf:
                  - $ref: '#/components/schemas/HeaderNameValue'
                  - type: object
                    required:
                      - always
                    properties:
                      always:
                        type: boolean
        response_headers_hiding_policy:
          type: object
          required:
            - enabled
            - mode
            - excepted
          properties:
            enabled:
              type: boolean
            mode:
              type: string
              enum:
                - hide
                - show
            excepted:
              type: array
              items:
                type: string
    HeaderNameValue:
      type: object
      required:
        - name
        - value
      properties:
        name:
          type: string
        value:
          type: string
    Error:
      type: object
      properties:
        error_code:
          type: string
        error:
          type: string
        error_description:
          type: string
        trace_id:
          type: string
      additionalProperties: true
  responses:
    BadRequest:
      description: The request is invalid or required context is missing.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: Authentication credentials are missing or invalid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Forbidden:
      description: >-
        The API key is disabled, the secret is wrong, or permission is
        insufficient.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: The resource does not exist in the API key's project.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    ValidationError:
      description: The configuration document failed semantic validation.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: Aptranet access key
      description: Access key beginning with `APTRANET_`.
    apiSecret:
      type: apiKey
      in: header
      name: Aptranet-Secret
      description: Current secret paired with the access key.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.