Skip to content

Quickstart

This guide will help you make your first API call to JustAI in just 5 minutes.

Before you begin, you’ll need:

  • At least one template created in the Console.
  1. Log in to the JustAI Console.
  2. Navigate to Settings → API Keys.
  3. Click Create New API Key.
  4. Copy your new API key (you won’t be able to see it again!).

Your organization slug is your company identifier, usually your company name in lowercase (e.g., your-company). If you’re unsure, ask us.

  1. In the Console, go to Templates.
  2. Click on any template.
  3. Copy the Template ID from the URL or template details (e.g., console.justwords.ai/templates/c2cb96ff/overview -> c2cb96ff).

Choose your preferred programming language and run this code:

Terminal window
curl -X POST https://worker.justwords.ai/api/generate/your-org \
-H "X-Api-Key: your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"template_id": "your_template_id",
"user_id": "user_123"
}'

Replace:

  • your-org with your organization slug
  • your_api_key_here with your actual API key
  • your_template_id with a template ID from your account

You should receive a JSON response like this:

{
"copy": {
"id": "variant_abc123",
"vars": {
"subject": "Welcome to our platform!",
"body": "We're excited to have you join us.",
"preheader": "Get started in minutes"
}
}
}

What this means:

  • copy.id: The unique identifier for the selected variant.
  • copy.vars: The template variables (subject, body, etc.) personalized for this user.

You can use these values in your email, push notification, or wherever you need personalized content.

Now that you’ve made your first API call, explore more features: