openapi: 3.0.0
info:
  license:
    name: MIT
    url: https://github.com/aziontech/azionapi-openapi/blob/main/LICENSE.md
  title: Purge API
  version: 1.0.0
servers:
- description: Production
  url: https://api.azionapi.net
security:
- tokenAuth: []
paths:
  /purge/url:
    post:
      description: |-
        List of URLs you want to remove from the Azion Edge Servers cache.
        urls (array): list of up to 50 URLs to be expired from the cache, per request.
        method (choice): purge method, use the “delete” value for removal.
      operationId: purgeUrl
      parameters:
      - example: application/json; version=3
        explode: false
        in: header
        name: Accept
        required: false
        schema:
          type: string
        style: simple
      - example: application/json
        explode: false
        in: header
        name: Content-Type
        required: false
        schema:
          type: string
        style: simple
      requestBody:
        content:
          application/json; version=3:
            schema:
              $ref: '#/components/schemas/PurgeUrlRequest'
      responses:
        "200":
          content:
            application/json; version=3: {}
          description: Successful response
        "201":
          content:
            application/json; version=3: {}
          description: Created
        "204":
          content:
            application/json; version=3: {}
          description: No Content
        "207":
          content:
            application/json; version=3: {}
          description: Multi Status
        "400":
          content:
            application/json; version=3: {}
          description: Bad Request
        "401":
          content:
            application/json; version=3: {}
          description: Unauthorized
        "403":
          content:
            application/json; version=3: {}
          description: Forbidden
        "404":
          content:
            application/json; version=3: {}
          description: Not Found
        "405":
          content:
            application/json; version=3: {}
          description: Method Not Allowed
        "406":
          content:
            application/json; version=3: {}
          description: Not Acceptable
        "409":
          content:
            application/json; version=3: {}
          description: Conflict
        "429":
          content:
            application/json; version=3: {}
          description: Too Many Requests
        "500":
          content:
            application/json; version=3: {}
          description: Internal Server Error
      summary: /purge/url
      tags:
      - Real-Time Purge
  /purge/cachekey:
    post:
      description: |-
        List of Cache Keys you want to remove from the Azion Edge Servers cache.
        urls (array): list of up to 50 Cache Keys to be expired from the cache, per request.
        method (choice): purge method, use the “delete” value for removal.
        Layer (choice): layer where the purge will be done. Use the value “edge_caching” (default value if not informed) to purge on the Edge Caching layer and the value “l2_caching” to purge on L2 Caching.
      operationId: purgeCacheKey
      parameters:
      - example: application/json; version=3
        explode: false
        in: header
        name: Accept
        required: false
        schema:
          type: string
        style: simple
      - example: application/json
        explode: false
        in: header
        name: Content-Type
        required: false
        schema:
          type: string
        style: simple
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PurgeCacheKeyRequest'
      responses:
        "200":
          content:
            application/json: {}
          description: Successful response
        "201":
          content:
            application/json; version=3: {}
          description: Created
        "204":
          content:
            application/json; version=3: {}
          description: No Content
        "207":
          content:
            application/json; version=3: {}
          description: Multi Status
        "400":
          content:
            application/json; version=3: {}
          description: Bad Request
        "401":
          content:
            application/json; version=3: {}
          description: Unauthorized
        "403":
          content:
            application/json; version=3: {}
          description: Forbidden
        "404":
          content:
            application/json; version=3: {}
          description: Not Found
        "405":
          content:
            application/json; version=3: {}
          description: Method Not Allowed
        "406":
          content:
            application/json; version=3: {}
          description: Not Acceptable
        "409":
          content:
            application/json; version=3: {}
          description: Conflict
        "429":
          content:
            application/json; version=3: {}
          description: Too Many Requests
        "500":
          content:
            application/json; version=3: {}
          description: Internal Server Error
      summary: /purge/cachekey
      tags:
      - Real-Time Purge
  /purge/wildcard:
    post:
      description: |-
        The Wildcard expression that represents the list of objects that you want to remove from the Azion Edge Servers cache.
        urls (array):the Wildcard URL or Wildcard Cache Key that represents the list of objects you want to expire. You can only use one Wildcard expression per request.
        method (choice): purge method, use the “delete” value for removal.
      operationId: purgeWildcard
      parameters:
      - example: application/json; version=3
        explode: false
        in: header
        name: Accept
        required: false
        schema:
          type: string
        style: simple
      - example: application/json
        explode: false
        in: header
        name: Content-Type
        required: false
        schema:
          type: string
        style: simple
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PurgeWildcardRequest'
      responses:
        "200":
          content:
            application/json: {}
          description: Successful response
        "201":
          content:
            application/json; version=3: {}
          description: Created
        "204":
          content:
            application/json; version=3: {}
          description: No Content
        "207":
          content:
            application/json; version=3: {}
          description: Multi Status
        "400":
          content:
            application/json; version=3: {}
          description: Bad Request
        "401":
          content:
            application/json; version=3: {}
          description: Unauthorized
        "403":
          content:
            application/json; version=3: {}
          description: Forbidden
        "404":
          content:
            application/json; version=3: {}
          description: Not Found
        "405":
          content:
            application/json; version=3: {}
          description: Method Not Allowed
        "406":
          content:
            application/json; version=3: {}
          description: Not Acceptable
        "409":
          content:
            application/json; version=3: {}
          description: Conflict
        "429":
          content:
            application/json; version=3: {}
          description: Too Many Requests
        "500":
          content:
            application/json; version=3: {}
          description: Internal Server Error
      summary: /purge/wildcard
      tags:
      - Real-Time Purge
components:
  schemas:
    PurgeUrlRequest:
      additionalProperties: false
      example:
        urls:
        - http://www.domain.com/
        - http://www.domain.com/test.js
        - http://static.mistaken-domain.com/image1.jpg
        method: delete
      properties:
        urls:
          items:
            type: string
          type: array
        method:
          type: string
      required:
      - method
      - urls
      type: object
    PurgeCacheKeyRequest:
      additionalProperties: false
      example:
        urls:
        - http://www.domain.com/@@cookie_name=cookie_value
        - http://www.domain.com/test.js
        - http://static.domain.com/image1.jpg?ims=arguments@@variants
        method: delete
        layer: l2_caching
      properties:
        urls:
          items:
            type: string
          type: array
        method:
          type: string
        layer:
          type: string
      required:
      - layer
      - method
      - urls
      type: object
    PurgeWildcardRequest:
      additionalProperties: false
      example:
        urls:
        - http://www.domain.com/path/image.jpg*
        method: delete
      properties:
        urls:
          items:
            type: string
          type: array
        method:
          type: string
      required:
      - method
      - urls
      type: object
  securitySchemes:
    tokenAuth:
      description: |
        You must inform a token to auth.
        Usage format: `Token <TOKEN>`
      in: header
      name: Authorization
      type: apiKey
