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

# Schedule automatic refresh of a dashboard via an agent

> Create a cron-based schedule that triggers an agent to refresh a dashboard.



## OpenAPI

````yaml /api-reference/openapi.json post /api/v1/dashboards/{dashboard_id}/schedule-refresh
openapi: 3.1.0
info:
  title: apowerb API
  description: REST API of the apowerb agentic framework (open-source edition).
  version: 0.1.2
  license:
    name: MIT
    url: https://github.com/apowerb/apowerb/blob/main/LICENSE
servers:
  - url: https://api.example.com
    description: Your apowerb instance
  - url: http://localhost:8000
    description: Local stack
security: []
paths:
  /api/v1/dashboards/{dashboard_id}/schedule-refresh:
    post:
      tags:
        - dashboard-refresh
      summary: Schedule automatic refresh of a dashboard via an agent
      description: >-
        Create a cron-based schedule that triggers an agent to refresh a
        dashboard.
      operationId: >-
        schedule_dashboard_refresh_api_v1_dashboards__dashboard_id__schedule_refresh_post
      parameters:
        - name: dashboard_id
          in: path
          required: true
          schema:
            type: string
            title: Dashboard Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ScheduleRefreshRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ScheduleRefreshResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    ScheduleRefreshRequest:
      properties:
        agent_id:
          type: integer
          title: Agent Id
        interval:
          type: string
          title: Interval
          description: 'Cron expression or preset: @hourly, @daily, @weekly, @monthly'
          examples:
            - '@daily'
            - 0 8 * * *
            - '@hourly'
        start_time:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Start Time
        message_template:
          anyOf:
            - type: string
            - type: 'null'
          title: Message Template
          description: >-
            Custom message sent to the agent. Default: 'Refresh dashboard
            {title}'
      type: object
      required:
        - agent_id
        - interval
      title: ScheduleRefreshRequest
    ScheduleRefreshResponse:
      properties:
        success:
          type: boolean
          title: Success
        schedule_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Schedule Id
        dashboard_id:
          type: string
          title: Dashboard Id
        agent_id:
          type: integer
          title: Agent Id
        interval:
          type: string
          title: Interval
        message:
          type: string
          title: Message
      type: object
      required:
        - success
        - dashboard_id
        - agent_id
        - interval
        - message
      title: ScheduleRefreshResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````

## Related topics

- [Schedule automatic refresh of a chart via an agent](/api-reference/chart-refresh/schedule-automatic-refresh-of-a-chart-via-an-agent.md)
- [List refresh schedules for a dashboard](/api-reference/dashboard-refresh/list-refresh-schedules-for-a-dashboard.md)
- [Delete a dashboard refresh schedule](/api-reference/dashboard-refresh/delete-a-dashboard-refresh-schedule.md)
- [Schedule Agent Run Endpoint](/api-reference/adk/schedule-agent-run-endpoint.md)
- [Link or unlink an agent to a dashboard](/api-reference/dashboards/link-or-unlink-an-agent-to-a-dashboard.md)
