Getting Started with the Demi API
This guide will help you set up authentication and make your first API call in just a few minutes.
1. Get Your API Key
To use the Demi API, you'll need an API key. Here's how to get one:
- Log in to your Demi dashboard
- Navigate to Settings → API Keys
- Click Generate New Key
- Give your key a descriptive name (e.g., "Production Integration")
- Select the scopes you need:
customers:read- Read customer datacustomers:write- Create/update customersorders:read- Read order dataorders:write- Create/update ordersproducts:read- Read product catalog
- Click Generate
Important: Copy your API key immediately! It will only be shown once. If you lose it, you'll need to generate a new one.
2. Make Your First Request
Test your API key by fetching the product catalog:
curl https://api.getdemi.co/api/v1/products \
-H "X-API-Key: pk_your_api_key_here"
You should receive a JSON response with a list of products:
{
"data": [
{
"id": 1,
"name": "Organic Chicken Bowl",
"priceRetail": 12.99,
"tags": ["healthy", "protein"]
}
],
"total": 42,
"limit": 20,
"offset": 0
}
3. Explore the API
Now that you're authenticated, explore the full API:
- Interactive API Reference - Try out endpoints directly
- Authentication Guide - Learn more about API keys and scopes
- Code Examples - Copy-paste examples for your language
Prefer the terminal? Use the Demi CLI for imports, bulk updates, data checks, and agentic workflows backed by the same API.
4. Best Practices
- Use environment variables - Never hardcode your API key in source code
- Handle rate limits - Respect the
X-RateLimit-Remainingheader - Implement retries - Use exponential backoff for transient errors
- Use pagination - Don't fetch all records at once; use limit/offset
- Keep keys secure - Rotate keys periodically and revoke unused ones
Need Help?
If you run into issues:
- Check the Error Reference for common issues
- Contact us at support@getdemi.co