After successfully running a query, deploy it with one click:
In your query interface (where you see the code and results)
Click the “Deploy” button
That’s it! Your query is now available as an API endpoint
Deploy button in the query interface
Deployment is instant - no configuration needed. Your query is now live as an API.
2
Explore Your Deployed APIs
Now let’s explore what’s available in the Deploy section:
Navigate to the “Deploy” section in the left sidebar
You’ll see three key areas:
API Logs: Monitor API usage and performance
Direct Endpoints: Test individual query APIs
Unified Endpoints: Natural language API access
Deploy section showing logs and endpoint options
3
Test Direct Endpoints
Direct endpoints give you traditional API access to each query:
Click on your deployed query (e.g., “calculate_campaign_roas”)
You’ll see a Postman-like interface for testing
Direct endpoint testing interface
Key features:
Endpoint URL: Each query has a unique endpoint URL
Query Parameters: Customize results with filters
Response Preview: See actual data returned
Code Examples: Get implementation code in multiple languages
Try the “Send” button to execute the API call and see real results from your data.
4
Explore Unified Endpoints
The Unified Endpoint is a powerful natural language API:
Click “Unified Endpoints” in the Deploy section
Access the “Chat Completions” interface
Chat Completions interface for natural language queries
How it works:
Single Endpoint: One API URL with your project ID that handles all queries
Natural Language: Ask questions like “your question here”
Auto-routing: Automatically selects the right query program
Flexible: No need to remember specific endpoint names
The interface will show your specific endpoint URL including your project ID. When calling this API outside the Workshop, you must provide an API key. You can create and manage API keys in the left navigation under “API Keys”.
The unified endpoint returns two types of responses depending on whether your question matches a deployed query:
Important: Natural language questions sent to the unified endpoint must relate to one of your deployed queries. If your question doesn’t match any deployed query, you’ll receive a list of available queries instead of data results. Always check that you have deployed relevant queries before testing the unified endpoint.
When your question doesn’t match any deployed query, you receive suggested questions:
Copy
Ask AI
{ "id": "chatcmpl-1752600833", "object": "chat.completion", "created": 1752600833, "model": "infactory-v1", "choices": [{ "index": 0, "message": { "role": "tool", "content": { "kind": "PublishedQueries", "data": { "project_id": "02c0b9df-874a-43fd-9cca-3e9e7da22d71", "queries": [ { "id": "9618dc6d-ccbc-4d83-944d-8e6d1b2ad60f", "cue": "What's the ROAS for each campaign", "name": null }, { "id": "5db2f947-c01f-495d-b3cf-4d207ea3a44d", "cue": "What's the ROI for each campaign or ad group?", "name": null } // ... more available queries ] } } } }]}
Key indicators of a non-matched query:
The content has kind: "PublishedQueries"
Contains a list of available queries with their cue (suggested questions)
No actual data rows returned
When you receive a non-matched response, try rephrasing your question to match one of the suggested queries, or deploy a new query program that answers your specific question.
The Unified Endpoint is perfect for chatbots, voice assistants, or any application that needs flexible data access.
5
View API Logs
Monitor your API usage and performance:
Click “API Logs” to see real-time activity
Track requests, response times, and errors
API logs showing usage and performance metrics
Your APIs are live and ready! You can test them directly or integrate into your applications.
When running Infactory APIs outside of the Workshop interface (for example, from your own scripts, Postman, or other applications), you must provide an API key for authentication.
Use direct endpoints for specific, predictable queries:
Each deployed query has its own unique endpoint URL. Find the exact URL in the Direct Endpoints interface by clicking on your query.
Copy
Ask AI
import requests# Direct endpoint for ROAS calculation# Get the endpoint URL from the Direct Endpoints interfaceurl = "[YOUR-ENDPOINT-URL]"headers = { "Authorization": "Bearer YOUR_API_KEY", "Content-Type": "application/json"}response = requests.get(url, headers=headers)data = response.json()# Process resultsfor campaign in data['results']: print(f"{campaign['campaign_name']}: {campaign['roas']}")