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

# Attach DNS Policy to a Site

> Attaches a DNS Content Filtering policy to a specific site, activating its rules for all traffic from that site.



## OpenAPI

````yaml /api/en/utm-ips.yaml post /content/{siteId}
openapi: 3.0.3
info:
  title: Altostrat UTM & IPS API
  version: 1.0.0
  description: >-
    Manage DNS filtering, BGP threat mitigation, content categories, and site
    policy attachment through the public `/content` gateway path.
servers:
  - url: https://v1.api.altostrat.io
security:
  - bearerAuth: []
tags:
  - name: DNS Content Filtering
    description: Manage DNS-based content filtering policies and their components.
  - name: BGP Threat Intelligence
    description: Manage BGP-based IP reputation policies and threat feeds.
  - name: Site Security Configuration
    description: View and manage security policy attachments for specific sites.
paths:
  /content/{siteId}:
    post:
      tags:
        - Site Security Configuration
      summary: Attach DNS Policy to a Site
      description: >-
        Attaches a DNS Content Filtering policy to a specific site, activating
        its rules for all traffic from that site.
      operationId: attachDnsPolicyToSite
      parameters:
        - name: siteId
          in: path
          required: true
          description: The unique identifier of the site.
          schema:
            type: string
            format: uuid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - policy_id
                - ip_address
              properties:
                policy_id:
                  type: string
                  format: uuid
                  description: The ID of the DNS policy to attach.
                  example: 9a9a3e6a-5c3a-4f1e-9a0a-2b2a1e1d8e8a
                ip_address:
                  type: string
                  format: ipv4
                  description: The management IP address of the site's tunnel.
                  example: 100.64.10.5
      responses:
        '201':
          description: DNS policy attached successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SiteSecurityStatus'
        '400':
          $ref: '#/components/responses/BadRequest'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  schemas:
    SiteSecurityStatus:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: The unique identifier of the site.
          example: 9a9d3e6a-5c3a-4f1e-9a0a-2b2a1e1d8e8d
        ip_address:
          type: string
          format: ipv4
          description: The management IP address of the site's tunnel.
          example: 100.64.10.5
        policy_id:
          type: string
          format: uuid
          nullable: true
          description: The ID of the DNS policy attached to this site, if any.
        policy_name:
          type: string
          nullable: true
          description: The name of the attached DNS policy.
        dnr_policy_id:
          type: string
          format: uuid
          nullable: true
          description: The ID of the BGP policy attached to this site, if any.
        dnr_policy_name:
          type: string
          nullable: true
          description: The name of the attached BGP policy.
        dns_online:
          type: boolean
          description: The operational status of the DNS filtering service for this site.
        dnr_online:
          type: boolean
          description: The operational status of the BGP filtering service for this site.
    ErrorResponse:
      type: object
      properties:
        type:
          type: string
          description: A broad category for the error (e.g., 'invalid_request_error').
          example: invalid_request_error
        code:
          type: string
          description: A short, unique string identifying the specific error.
          example: parameter_invalid
        message:
          type: string
          description: A human-readable description of what went wrong.
          example: The 'name' parameter cannot be empty.
        doc_url:
          type: string
          description: >-
            A direct link to the documentation page for this specific error
            code.
          example: https://docs.altostrat.io/errors/parameter_invalid
  responses:
    BadRequest:
      description: Bad Request - The request was malformed or invalid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Forbidden:
      description: Forbidden - You do not have permission to perform this action.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    NotFound:
      description: Not Found - The requested resource could not be found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    InternalServerError:
      description: Internal Server Error - An unexpected error occurred on the server.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````