Quickstart
Make your first authenticated Happily.ai API call in under five minutes. You will fetch your own member record, then send your first recognition.
1. Get an API key
You need a Happily account with developer access. Generate a key from my.happily.ai/integrations. Keys are issued per company and per stage (prod or dev).
Your API key is a secret. It grants full access to your company's data. Keep it out of client-side code and version control. Store it in an environment variable.
export HAPPILY_API_KEY="your_api_key_here"
2. Set the base URL
All requests go to a versioned, stage-scoped base URL:
https://api.happily.ai/{stage}/1
Use prod with a production key and dev with a development key. Your key only works on its own stage.
3. Make your first call
Fetch your own member record by email. This is a safe, read-only call.
curl "https://api.happily.ai/prod/1/members?email=you@yourcompany.com" \
-H "x-api-key: $HAPPILY_API_KEY"
const res = await fetch(
"https://api.happily.ai/prod/1/members?email=you@yourcompany.com",
{ headers: { "x-api-key": process.env.HAPPILY_API_KEY } }
);
const data = await res.json();
console.log(data.member);
import os, requests
res = requests.get(
"https://api.happily.ai/prod/1/members",
params={"email": "you@yourcompany.com"},
headers={"x-api-key": os.environ["HAPPILY_API_KEY"]},
)
print(res.json()["member"])
A successful response looks like this:
{
"statusCode": 200,
"message": "success",
"member": {
"email": "you@yourcompany.com",
"firstname": "Jordan",
"lastname": "Diaz",
"company_id": "company_abc123",
"team_id": "t123456789",
"talent_type": "Builder",
"impact_rating": 82,
"status": "Active"
}
}
4. Send your first recognition
Now a write. Give a colleague some coins. The sender's email goes in the path, the recipients go in the body.
curl -X POST "https://api.happily.ai/prod/1/recognition/you@yourcompany.com" \
-H "x-api-key: $HAPPILY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"recipients": ["teammate@yourcompany.com"],
"amount": 5,
"for": "Helping me debug the deploy pipeline ๐",
"type": "coin",
"display_feed": true
}'
const res = await fetch(
"https://api.happily.ai/prod/1/recognition/you@yourcompany.com",
{
method: "POST",
headers: {
"x-api-key": process.env.HAPPILY_API_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify({
recipients: ["teammate@yourcompany.com"],
amount: 5,
for: "Helping me debug the deploy pipeline ๐",
type: "coin",
display_feed: true,
}),
}
);
console.log(await res.json());
import os, requests
res = requests.post(
"https://api.happily.ai/prod/1/recognition/you@yourcompany.com",
headers={"x-api-key": os.environ["HAPPILY_API_KEY"]},
json={
"recipients": ["teammate@yourcompany.com"],
"amount": 5,
"for": "Helping me debug the deploy pipeline ๐",
"type": "coin",
"display_feed": True,
},
)
print(res.json())
Open any endpoint in the API Reference and use the built-in Try it console to send live requests with your key, no setup required.
Next steps
- Authentication โ keys, stages, and security.
- Errors & status codes โ handle failures cleanly.
- Sync members from your HRIS โ your first real integration.
Get an API key