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

# Create chart trigger

> Create a scheduled trigger for a chart.



## OpenAPI

````yaml api-reference/openapi.yaml post /api/v1/{workspace_slug}/dashboards/{dashboard_id}/charts/{chart_id}/triggers
openapi: 3.1.0
info:
  title: Anlytic API
  version: '1.0'
  description: >
    The Anlytic REST API. All endpoints are served under `/api/v1/`.


    ## Authentication


    Most endpoints require a **Bearer JWT** obtained via the authentication
    flow:

    1. `GET /api/v1/users/otp` — request a one-time passcode (uses HTTP Basic
    Auth)

    2. `GET /api/v1/users/token/{kid}` — exchange OTP for a workspace JWT.


    Include the JWT in every subsequent request with `Authorization: Bearer
    <token>`.


    Alternatively, use an **API Key** via the same header: `Authorization:
    API-Key <key>`.


    ## Roles & Scopes


    | Scope | Description |

    |---|---|

    | `workspace_viewer` | Read-only access to workspace resources |

    | `workspace_editor` | Create and update resources |

    | `workspace_admin` | Full workspace management including billing |

    | `admin` | System-level operations (Anlytic staff only) |
  contact:
    name: Anlytic Support
    url: https://anlytic.com
servers:
  - url: https://app.anlytic.com
    description: Production
security:
  - bearerAuth: []
  - apiKeyAuth: []
tags:
  - name: Configuration
    description: API configuration and policy endpoints
  - name: Authentication
    description: Login, OTP, token exchange, and MFA flows
  - name: Users
    description: User profile and settings management
  - name: API Keys
    description: Programmatic API key management per user
  - name: MFA
    description: Multi-factor authentication setup and verification
  - name: Workspaces
    description: Workspace lifecycle management
  - name: Workspace Members
    description: Manage users within a workspace
  - name: Teams
    description: Team creation and membership management
  - name: Sources
    description: Database source connections and schema exploration
  - name: Columns
    description: Column metadata and value search
  - name: Connectors
    description: Fivetran sync connector management
  - name: Uploads
    description: File upload ingestion (CSV, JSON, Parquet)
  - name: Webhooks
    description: Inbound webhook endpoints for external data ingestion
  - name: Actions
    description: Custom action definitions triggered from dashboards
  - name: Enrichments
    description: Data enrichment pipeline management
  - name: Dashboards
    description: Dashboard creation and management
  - name: Charts
    description: Chart configuration and data retrieval
  - name: Workbooks
    description: Spreadsheet-style workbook management
  - name: Filters
    description: Reusable data filter management
  - name: Folders
    description: Content organisation into folders
  - name: AI Assistant
    description: AI assistant sessions and message history
  - name: Payments
    description: Stripe billing, subscriptions, and plan management
  - name: Notifications
    description: In-app notification management
  - name: Catalog
    description: Workspace data catalog overview
  - name: Favorites
    description: User-level content favorites
paths:
  /api/v1/{workspace_slug}/dashboards/{dashboard_id}/charts/{chart_id}/triggers:
    post:
      tags:
        - Triggers
      summary: Create chart trigger
      description: Create a scheduled trigger for a chart.
      operationId: createChartTrigger
      parameters:
        - $ref: '#/components/parameters/workspaceSlug'
        - name: dashboard_id
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/UUID'
        - name: chart_id
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/UUID'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpsertTrigger'
      responses:
        '201':
          description: Created trigger
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Trigger'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  parameters:
    workspaceSlug:
      name: workspace_slug
      in: path
      required: true
      schema:
        type: string
        example: acme
      description: URL-friendly workspace identifier
      example: acme
  schemas:
    UUID:
      type: string
      format: uuid
      example: 550e8400-e29b-41d4-a716-446655440000
    UpsertTrigger:
      type: object
      required:
        - cron_spec
        - trigger_type
      properties:
        name:
          type: string
          maxLength: 120
        cron_spec:
          type: string
          description: Cron expression that controls when the trigger runs.
        enabled:
          type: boolean
        filters:
          type: object
          additionalProperties: true
        action_id:
          type: string
          description: Action to execute when the trigger fires.
        trigger_type:
          type: string
          enum:
            - always
            - has_results
            - no_results
            - value_threshold
        trigger_condition:
          type: object
          additionalProperties: true
          description: >-
            Required for trigger types that need a condition, such as
            `value_threshold`.
    Trigger:
      type: object
      properties:
        trigger_id:
          $ref: '#/components/schemas/UUID'
        chart_id:
          $ref: '#/components/schemas/UUID'
        action_id:
          type:
            - string
            - 'null'
        name:
          type: string
        cron_spec:
          type: string
          description: Cron expression that controls when the trigger runs.
        enabled:
          type: boolean
        filters:
          type:
            - object
            - 'null'
          additionalProperties: true
        trigger_type:
          type: string
          enum:
            - always
            - has_results
            - no_results
            - value_threshold
        trigger_condition:
          type:
            - object
            - 'null'
          additionalProperties: true
        created_at:
          $ref: '#/components/schemas/Timestamp'
        updated_at:
          $ref: '#/components/schemas/Timestamp'
    Timestamp:
      type: string
      format: date-time
      example: '2024-01-15T10:30:00Z'
    Error:
      type: object
      properties:
        error:
          type: string
          description: Human-readable error message
        code:
          type: string
          description: Machine-readable error code
  responses:
    BadRequest:
      description: Invalid request body or parameters
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: Missing or invalid authentication token
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Forbidden:
      description: Insufficient permissions
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
    apiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: Enter `API-Key <key>`.

````