Athenic AI Docs
  • Getting Started
    • How to Get Started with Athenic AI
    • Connect a Data Source
    • New Project and Project Settings
    • Configure Data Source and Data Preparation
  • Getting Insights
    • Asking Questions
      • Question Tips
    • Using Projects
      • Suggested Questions
      • Key Terms
      • Follow-up Questions
      • Saving Tables and Charts to a Project
      • Modifying a Chart
        • Chart Basics
        • Advance Visualization Capabilities
      • Using the Dashboard
        • Editing a Dashboard
        • Using Dashboard Filters
        • Scheduling a Report
        • Share Dashboard
        • Viewing the Charts
      • Datasets
      • AI Training
  • Integrations & Application Connectors
    • SQL Databases
    • Data Warehouses
    • Files and Sheets
  • Collaboration and Management
    • Managing Projects
    • Managing Teams and Accounts
      • General Team Settings
      • Adding a New Team Member
      • Upgrade Subscription Plan
  • Developer Reference Materials
    • API Docs
Powered by GitBook
On this page
  • List Projects
  • Query Projects
  1. Developer Reference Materials

API Docs

List Projects

GET https://app.athenic.com/api/projects

The API uses an API key to authenticate requests. You can view your API key in your team settings. Projects must be created in the application. This API request will retrieve IDs and names for all projects owned by your team. You can then use any project_id to query that project.

Headers

Name
Value

Content-Type

application/json

Authorization

Bearer {Your API Key}

Response

{
    "projects": [{
        "project_id": project_id,
        "project_name": project_name,
        "created_at_date": created_at_date,
    }]
}

Query Projects

POST https://app.athenic.com/api/projects/<project_id>/generate-query

Query an existing project

The API uses an API key to authenticate requests. You can view your API key in your team settings. Projects must be created in the application before querying. This API request will generate a SQL query given an input question.

Headers

Name
Value

Content-Type

application/json

Authorization

Bearer {Your API Key}

Body

Name
Type
Description

question

string

Your input question you want answered

Response


{
        "query_id": "c5d5a134-eebc-4224-90fa-0dbe7bc35cc5",
        "question": "Show me the monthly sales for x, y, z",
        "sql_query": "SELECT ... FROM ..."
        "full_sql_query": "WITH dataset1 AS (...), dataset2 AS (...) SELECT ... FROM ..." -- The full SQL query including the project datasets' SQL
        "explanation": -- An plain text explanation of what your query is doing
        "run_status": -- One of ["success", "error", "empty"]
        "df": A dictionary containing the query results
        "truncated": -- A boolean indicating whether the df was truncated to 10000 rows
        "query_error": -- A string containing the error if running the SQL query failed  
}
PreviousUpgrade Subscription Plan

Last updated 2 days ago