DNSFilter Scheduled Policies API

The Scheduled Policies API from DNSFilter — 3 operation(s) for scheduled policies.

OpenAPI Specification

dnsfilter-scheduled-policies-api-openapi.yml Raw ↑
openapi: 3.0.0
info:
  title: DNSFilter Agent Local User Bulk Deletes Scheduled Policies API
  description: "\n**Note:** If you are a distributor integrating with DNSFilter, please check\n          out our [Distributors Development Guide](/docs/distributors).\n\n### Authentication\n\n- Authentication is required for most, but not all, endpoints.\n\n- Authentication is done by setting the `Authorization` request header.\n  The header value is the API key itself.\n  For example: `Authorization: eyJ...`\n\n- An API key can be obtained through the DNSFilter dashboard under\n  Account Settings. For additional information see\n  [this KB article](https://help.dnsfilter.com/hc/en-us/articles/21169189058323-API-Tokens).\n\n### Rate Limiting\n\n- All endpoints are rate limited.\n\n- The limits may vary by endpoint, but are generally consistent.\n\n- When the rate limit is exceeded the API will return the standard `429` HTTP status.\n\n- The following headers will also be provided in the response:\n  `Retry-After`, `RateLimit-Policy`, `RateLimit`, `RateLimit-Limit`, `RateLimit-Remaining`, `RateLimit-Reset`.\n  For details on the values of these headers, see the following articles\n  [here](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Retry-After),\n  [here](https://www.ietf.org/archive/id/draft-ietf-httpapi-ratelimit-headers-08.html),\n  and [here](https://www.ietf.org/archive/id/draft-polli-ratelimit-headers-05.html).\n\n- For additional information see [this KB article](https://help.dnsfilter.com/hc/en-us/articles/38202811088403-API-Rate-Limits).\n\n### Error Handling\n\n- The API uses standard HTTP status codes to indicate success or failure.\n\n- For _V1_ endpoints the response format is:\n  ```json\n  { \"error\": \"string\", \"type\": \"string(optional)\" }\n  ```\n- For _V2_ endpoints the response format is:\n  ```json\n  { \"error\": { \"message\": \"string\", \"type\": \"string(optional)\" } }\n  ```\n\n### Pagination\n\nFor the _V1_ endpoints, the pagination parameters are nested. That is to say,\nif passed as JSON they look like this: `{\"page[number]\": 1, \"page[size]\": 10}`.\n\nTo pass this information in the URL query string, it would be formatted like\nthis: `...?page%5Bnumber%5D=1&page%5Bsize%5D=10`.\n\nIn this guide, the UI will indicate that `page` is an `object` and if you\nwant to set values when trying the request, you must enter it as if it was\nthe JSON above.\n\n### A Quick Example\n\nThe following will return information about the currently\nauthenticated user.\n\n```bash\n% curl -H 'Authorization: ***' https://api.dnsfilter.com/v1/users/self\n\n{ \"data\": {\n    \"id\": \"12345\",\n    \"type\": \"users\",\n    \"attributes\": {\n      \"name\": \"John Doe\",\n      \"email\": \"john@example.com\",\n      ...additional fields...\n}}}\n```\n"
  version: '2026-07-13'
servers:
- url: https://api.dnsfilter.com
  description: Production
tags:
- name: Scheduled Policies
  description: ''
paths:
  /v1/scheduled_policies:
    get:
      tags:
      - Scheduled Policies
      operationId: V1_Scheduled_Policies-index
      parameters:
      - name: page
        description: Page number and size
        required: false
        in: query
        schema:
          type: object
          properties:
            number:
              type: integer
            size:
              type: integer
      responses:
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '200':
          description: Scheduled policies
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ScheduledPolicy'
      description: Gets the list of scheduled policies associated with the current user.
      summary: Get extant
      security:
      - header_authorization: []
      x-controller: v1/scheduled_policies
      x-action: index
    post:
      tags:
      - Scheduled Policies
      operationId: V1_Scheduled_Policies-create
      parameters: []
      responses:
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Can not create scheduled_policy with the specified data
        '201':
          description: The created scheduled policy
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ScheduledPolicy'
      description: Creates a new scheduled policy.
      summary: Create
      security:
      - header_authorization: []
      x-controller: v1/scheduled_policies
      x-action: create
      requestBody:
        description: The scheduled policy details
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ScheduledPolicy'
  /v1/scheduled_policies/all:
    get:
      tags:
      - Scheduled Policies
      operationId: V1_Scheduled_Policies-all
      parameters:
      - name: page
        description: Page number and size
        required: false
        in: query
        schema:
          type: object
          properties:
            number:
              type: integer
            size:
              type: integer
      responses:
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '200':
          description: Scheduled policies
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ScheduledPolicy'
      description: Gets ALL scheduled policies associated with the current user.
      summary: Get all
      security:
      - header_authorization: []
      x-controller: v1/scheduled_policies
      x-action: all
  /v1/scheduled_policies/{id}:
    get:
      tags:
      - Scheduled Policies
      operationId: V1_Scheduled_Policies-show
      parameters:
      - name: id
        description: ScheduledPolicy ID
        required: true
        in: path
        schema:
          type: integer
      responses:
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '200':
          description: The scheduled policy data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ScheduledPolicy'
      description: Gets the specified scheduled policy.
      summary: Show policy
      security:
      - header_authorization: []
      x-controller: v1/scheduled_policies
      x-action: show
    patch:
      tags:
      - Scheduled Policies
      operationId: V1_Scheduled_Policies-update
      parameters:
      - name: id
        description: ScheduledPolicy ID
        required: true
        in: path
        schema:
          type: integer
      responses:
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Can not update scheduled policy with the specified data
        '200':
          description: Updated scheduled policy
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ScheduledPolicy'
      description: Updates a scheduled policy in the database with the specified data.
      summary: Update
      security:
      - header_authorization: []
      x-controller: v1/scheduled_policies
      x-action: update
      requestBody:
        description: The scheduled policy details
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ScheduledPolicy'
    delete:
      tags:
      - Scheduled Policies
      operationId: V1_Scheduled_Policies-destroy
      parameters:
      - name: id
        description: ScheduledPolicy ID
        required: true
        in: path
        schema:
          type: integer
      responses:
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '204':
          description: No Content
      description: Removes a scheduled policy from the database.
      summary: Delete
      security:
      - header_authorization: []
      x-controller: v1/scheduled_policies
      x-action: destroy
components:
  schemas:
    Error:
      type: object
      properties:
        error:
          type: string
          description: 'Error message (e.x.: Not Authorized)'
      description: Error basic representation
    ScheduledPolicy:
      type: object
      properties:
        name:
          type: string
          description: Name
        organization_id:
          type: integer
          description: The organization that owns the block page
        policy_ids:
          type: array
          items:
            type: integer
          description: 672 ids representing 15 minute blocks starting Monday morning 12:01am
        timezone:
          type: string
          description: The timezone string (e.g. America/New_York) for localizing the policy
      description: Represents a time based policy
  securitySchemes:
    header_authorization:
      type: apiKey
      name: Authorization
      in: header