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

# Attach protection to a CDN distribution



## OpenAPI

````yaml /openapi-shield.json post /shield/domains
openapi: 3.1.0
info:
  title: Aptranet Cloud Shield API
  version: 1.0.0
  description: >-
    Public project-scoped API. Use the access key and secret together.
    Browser-only organization administration is documented separately. Request
    schemas and query parameters follow the service operation allowlist. Plan
    entitlements apply in addition to API permissions. Some analytics and action
    responses have operation-specific JSON shapes; where the implementation
    provides no stable response contract, the reference deliberately does not
    invent one.
servers:
  - url: https://api.aptranet.com
security:
  - bearerAuth: []
    apiSecret: []
paths:
  /shield/domains:
    post:
      tags:
        - Cloud Shield setup
      summary: Attach protection to a CDN distribution
      operationId: POST_shield_domains
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                distribution_id:
                  type: integer
                  minimum: 1
              required:
                - distribution_id
      responses:
        '200':
          description: Existing attachment.
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type:
                      - integer
                      - 'null'
                  distribution_id:
                    type: integer
                    minimum: 1
                  name:
                    type: string
                  status:
                    type: string
                required:
                  - id
                  - distribution_id
                  - name
                  - status
        '201':
          description: Attachment created; setup may still be pending.
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type:
                      - integer
                      - 'null'
                  distribution_id:
                    type: integer
                    minimum: 1
                  name:
                    type: string
                  status:
                    type: string
                required:
                  - id
                  - distribution_id
                  - name
                  - status
        default:
          description: Service, ownership, quota, or attachment failure.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Error:
      type: object
      properties:
        error:
          type: string
        error_description:
          type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Project API access key.
    apiSecret:
      type: apiKey
      in: header
      name: Aptranet-Secret
      description: Current secret for the access key.

````

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