okdata.app

Deploying Templates

Learn how to deploy your templates and integrate them into your applications.

Direct API Integration

Trigger your template directly from your application code.

Webhook URL

Forward template results to automation platforms of your choice.

# Using the API

To trigger your template via the API, you'll need your template ID and the appropriate endpoint.

Curl Example

Here's how to trigger the Geo Guesser template using curl:

curl -X POST https://okdata.app/api/trigger \
  -F "templateId=AB1234" \
  -F "text=the city holding the status of liberty"
Key Parameters:
  • templateId - Your unique template identifier (AB1234 in this example)
  • text - The input text to process

Expected Response

The API returns a structured response with your template data:

{
  "data": {
    "city": "New York",
    "country": "USA",
    "currency": "USD",
    "isCapital": false,
    "population": "8.4 million"
  },
  "ai": {
    "llm": "openai:gpt-4o",
    "duration": 1207,
    "date": "2025-05-12T07:17:37.525Z"
  },
  "success": true
}

# Using Webhooks

Webhooks allow you to send template results directly to third-party services or your own endpoints:

  1. Set up an endpoint in your application to receive webhook data
  2. Enter your endpoint URL in the Webhook URL field
  3. When your template is triggered, results will be automatically forwarded to your endpoint

Common Webhook Use Cases

  • Sending structured data to CRM systems
  • Triggering automations in tools like Zapier or Make
  • Updating records in databases or spreadsheets
  • Sending notifications when specific conditions are met

For more detailed information about the okdata API, refer to the API Reference.