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

# Preview visualize Slack chart

> Draw rows with a visualize-tool viz config as the Slack chart image, for debugging the Slack renderer.



## OpenAPI

````yaml https://raw.githubusercontent.com/lightdash/lightdash/refs/heads/main/packages/backend/src/generated/swagger.json post /api/v1/projects/{projectUuid}/aiAgents/visualize/slack-preview
openapi: 3.0.0
info:
  title: Lightdash API
  version: 3.123.0
  description: >
    Open API documentation for all public Lightdash API endpoints. #
    Authentication Authenticate using the Authorization header with either
    'ApiKey <personal-access-token>' or 'Bearer <service-account-token>'. Create
    a Personal Access Token by following this guide:
    https://docs.lightdash.com/references/personal_tokens Self-hosted
    provisioning can use the admin token configured with
    LD_SETUP_SERVICE_ACCOUNT_TOKEN to create scoped service accounts through the
    Service Accounts API.
  license:
    name: MIT
  contact:
    name: Lightdash Support
    email: support@lightdash.com
    url: https://docs.lightdash.com/help-and-contact/contact/contact_info/
servers:
  - url: /
security: []
tags:
  - name: My Account
    description: These routes allow users to manage their own user account.
  - name: Organizations
    description: >-
      Each user is a member of a single organization. These routes allow users
      to manage their organization. Most actions are only available to admin
      users.
  - name: Projects
    description: >-
      Projects belong to a single organization. These routes allow users to
      manage their projects, browse content, and execute queries. Users inside
      an organization might have access to a project from an organization-level
      role or they might be granted access to a project directly.
  - name: Spaces
    description: >-
      Spaces allow you to organize charts and dashboards within a project. They
      also allow granular access to content by allowing you to create private
      spaces, which are only accessible to the creator and admins.
  - name: Roles & Permissions
    description: >-
      These routes allow users to manage roles and permissions for their
      organization.
    externalDocs:
      url: https://docs.lightdash.com/references/roles
  - name: Service Accounts
    description: >-
      Create and manage machine credentials for your organization. Requires
      organization administration permission. Use predefined organization
      scopes, a custom organization role, or grants to selected projects.
      Credentials cannot grant more access than the caller holds.
  - name: Query
    description: >-
      These routes allow users to execute and manage queries against their data
      warehouse. This includes metric queries, SQL queries, and retrieving query
      results.
paths:
  /api/v1/projects/{projectUuid}/aiAgents/visualize/slack-preview:
    post:
      summary: Preview visualize Slack chart
      description: >-
        Draw rows with a visualize-tool viz config as the Slack chart image, for
        debugging the Slack renderer.
      operationId: previewVisualizeSlackChart
      parameters:
        - in: path
          name: projectUuid
          required: true
          schema:
            $ref: '#/components/schemas/UUID'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApiAiAgentVisualizeSlackPreviewRequest'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: string
                format: byte
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorPayload'
      security: []
components:
  schemas:
    UUID:
      type: string
      format: uuid
      description: |-
        Stringified UUIDv4.
        See [RFC 4112](https://tools.ietf.org/html/rfc4122)
      pattern: >-
        [0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-4[0-9A-Fa-f]{3}-[89ABab][0-9A-Fa-f]{3}-[0-9A-Fa-f]{12}
    ApiAiAgentVisualizeSlackPreviewRequest:
      properties:
        vizConfig:
          $ref: '#/components/schemas/Record_string.unknown_'
        rows:
          items:
            $ref: '#/components/schemas/Record_string.unknown_'
          type: array
        columns:
          items:
            $ref: '#/components/schemas/ResultColumn'
          type: array
        title:
          type: string
      required:
        - vizConfig
        - rows
        - columns
        - title
      type: object
      description: >-
        Rows and a visualize-tool viz config to draw as the Slack chart image;
        vizConfig is parsed server-side.
    ApiErrorPayload:
      properties:
        error:
          properties:
            data:
              $ref: '#/components/schemas/AnyType'
              description: Optional data containing details of the error
            message:
              type: string
              description: A friendly message summarising the error
            name:
              type: string
              description: Unique name for the type of error
            statusCode:
              type: number
              format: integer
              description: HTTP status code
          required:
            - name
            - statusCode
          type: object
        status:
          type: string
          enum:
            - error
          nullable: false
      required:
        - error
        - status
      type: object
      description: |-
        The Error object is returned from the api any time there is an error.
        The message contains
    Record_string.unknown_:
      properties: {}
      additionalProperties: {}
      type: object
      description: Construct a type with a set of properties K of type T
    ResultColumn:
      properties:
        provenance:
          $ref: '#/components/schemas/ResultColumnProvenance'
          description: >-
            Absent ⇒ no semantic field behind this column (computed DuckDB
            column,

            raw SQL column, table calc, join key). Absence gates interaction

            capabilities (drill, underlying data, URLs) off — by design.
        shiftsTimezone:
          type: boolean
          description: >-
            Resolved output of getFormatterTimezone: whether values shift into
            the

            display timezone. Saves consumers from needing
            skipTimezoneConversion /

            baseDimensionType.
        timeInterval:
          $ref: '#/components/schemas/TimeFrames'
          description: |-
            Temporal grain. Required for QUARTER (no ECMA-376 token) and for
            export paths (GSheets) that branch on grain.
        formatOptions:
          $ref: '#/components/schemas/CustomFormat'
          description: >-
            Escape hatch for the non-expressible formats: Compact.AUTO and

            negative round (magnitude rounding). Mirrors
            getFieldFormatOverrideProps.
        separator:
          $ref: '#/components/schemas/NumberSeparator'
          description: |-
            The expression cannot encode locale — carried beside it, mirroring
            Field.separator / getFieldFormatOverrideProps.
        format:
          type: string
          description: |-
            Lightdash format expression: ECMA-376 with in-repo extensions (IEC
            bytes, tz-shift for date expressions). MUST be rendered with
            formatValueWithExpression, never raw numfmt.
        label:
          type: string
          description: Display label. Absent ⇒ consumers fall back to the reference.
        numericKind:
          $ref: '#/components/schemas/ResultNumericKind'
          description: >-
            NUMBER columns only, when the driver reports it. Absent ⇒ unknown,
            read as DOUBLE.
        type:
          $ref: '#/components/schemas/DimensionType'
        reference:
          type: string
      required:
        - type
        - reference
      type: object
    AnyType:
      description: |-
        This AnyType is an alias for any
        The goal is to make it easier to identify any type in the codebase
        without having to eslint-disable all the time
        These are only used on legacy `any` types, don't use it for new types.
        This is added on a separate file to avoid circular dependencies.
    ResultColumnProvenance:
      properties:
        sourceQueryUuid:
          type: string
          description: >-
            Which query in a multi-source pipeline the field belongs to. Omitted

            for single-query results. Two composer nodes can both expose the
            same

            field name, so a bare fieldId is ambiguous across sources.
        fieldId:
          type: string
          description: Key into the query's fields map (query_history.fields).
      required:
        - fieldId
      type: object
    TimeFrames:
      enum:
        - RAW
        - YEAR
        - QUARTER
        - MONTH
        - WEEK
        - DAY
        - HOUR
        - MINUTE
        - SECOND
        - MILLISECOND
        - DAY_OF_WEEK_INDEX
        - DAY_OF_MONTH_NUM
        - DAY_OF_YEAR_NUM
        - WEEK_NUM
        - MONTH_NUM
        - QUARTER_NUM
        - YEAR_NUM
        - DAY_OF_WEEK_NAME
        - MONTH_NAME
        - QUARTER_NAME
        - HOUR_OF_DAY_NUM
        - MINUTE_OF_HOUR_NUM
      type: string
    CustomFormat:
      properties:
        type:
          $ref: '#/components/schemas/CustomFormatType'
          description: Format type
        round:
          type: number
          format: double
          description: Number of decimal places
        separator:
          $ref: '#/components/schemas/NumberSeparator'
          description: Number separator style
        currency:
          type: string
          description: Currency code (e.g., USD, GBP, EUR)
        compact:
          $ref: '#/components/schemas/CompactOrAlias'
          description: Compact format for large numbers (K, M, B, T) or byte units
        prefix:
          type: string
          description: Prefix to prepend to formatted values
        suffix:
          type: string
          description: Suffix to append to formatted values
        timeInterval:
          $ref: '#/components/schemas/TimeFrames'
          description: Time interval for date formatting
        custom:
          type: string
          description: Custom format string
      required:
        - type
      type: object
      additionalProperties: true
    NumberSeparator:
      enum:
        - default
        - commaPeriod
        - spacePeriod
        - periodComma
        - noSeparatorPeriod
        - apostrophePeriod
      type: string
    ResultNumericKind:
      anyOf:
        - properties:
            kind:
              type: string
              enum:
                - integer
              nullable: false
          required:
            - kind
          type: object
        - properties:
            scale:
              type: number
              format: double
            kind:
              type: string
              enum:
                - decimal
              nullable: false
          required:
            - scale
            - kind
          type: object
        - properties:
            kind:
              type: string
              enum:
                - float
              nullable: false
          required:
            - kind
          type: object
      description: >-
        How a NUMBER column is represented at the source, so a typed read binds
        it without loss.
    DimensionType:
      enum:
        - string
        - number
        - timestamp
        - date
        - boolean
      type: string
    CustomFormatType:
      enum:
        - default
        - percent
        - currency
        - number
        - id
        - date
        - timestamp
        - bytes_si
        - bytes_iec
        - custom
      type: string
    CompactOrAlias:
      anyOf:
        - $ref: '#/components/schemas/Compact'
        - type: string
          enum:
            - K
            - thousand
            - M
            - million
            - B
            - billion
            - T
            - trillion
            - KB
            - kilobyte
            - MB
            - megabyte
            - GB
            - gigabyte
            - TB
            - terabyte
            - PB
            - petabyte
            - KiB
            - kibibyte
            - MiB
            - mebibyte
            - GiB
            - gibibyte
            - TiB
            - tebibyte
            - PiB
            - pebibyte
    Compact:
      enum:
        - auto
        - thousands
        - millions
        - billions
        - trillions
        - kilobytes
        - megabytes
        - gigabytes
        - terabytes
        - petabytes
        - kibibytes
        - mebibytes
        - gibibytes
        - tebibytes
        - pebibytes
      type: string

````

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