Overview
This guide will walk you through making your first API calls to Haystack. You’ll learn how to authenticate, retrieve content, and perform a search.1
Get Your API Credentials
Haystack provides two APIs. Get the credentials you need from the Haystack Dashboard:For the Private API (content management, analytics):
- Navigate to Developer → API
- In the Private API section, click New key
- Enter a name (e.g., “Development Server”) and click Submit
- Copy and save your API key securely (you won’t see it again!)
- Navigate to Developer → API
- In the Search API section, find your Search API Base URL
- Click Copy to copy your church-specific URL
2
Set Up Your Environment
Store your credentials as environment variables:Or create a
.env file:.env
3
Make Your First Request
Let’s retrieve your collections to verify authentication is working:Expected Response:
4
Search Your Content
Now let’s perform a search query to find content:Expected Response:
No Authentication Required: The search endpoint uses your church-specific Search API URL and does not require authentication. It’s safe to call from public websites.
5
Create Content
Let’s create a new item in your library:Expected Response:
Error Handling
Always check for errors in API responses. The API uses standard HTTP status codes:200- Success400- Bad Request (invalid parameters)401- Unauthorized (invalid or missing token)403- Forbidden (insufficient permissions)404- Not Found500- Internal Server Error

