Get your API key
Sign up for a free Attrove account and create your first API key. You can create separate keys for development and production environments.
Add AI-powered communication context to your app. Connect your users' Gmail, Slack, and more โ then query their data with natural language.
Sign up for a free Attrove account and create your first API key. You can create separate keys for development and production environments.
Call the /v1/users endpoint to provision a user. Each user represents one of your end-users who will connect their communication accounts.
const res = await fetch("https://api.attrove.com/v1/users", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.ATTROVE_API_KEY}`,
"X-Auth-Type": "partner",
"Content-Type": "application/json",
},
body: JSON.stringify({
email: "[email protected]",
client_id: "your-client-id",
}),
});
const { token, id } = await res.json();
// Save this token โ you'll need it to open Attrove Connect
Add a connect button to your app that redirects users to Attrove's OAuth flow. Once connected, you'll be able to query their communication data.
// Generate a short-lived integration token
const tokenRes = await fetch(`https://api.attrove.com/v1/users/${userId}/tokens`, {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.ATTROVE_API_KEY}`,
"X-Auth-Type": "partner",
"Content-Type": "application/json",
},
body: JSON.stringify({ client_id: "your-client-id" }),
});
const { token } = await tokenRes.json();
// Redirect user to connect their Gmail
window.location.href = `https://connect.attrove.com/integrations/connect?provider=gmail&token=${token}&user_id=${userId}`;
Once users have connected their accounts, use natural language queries to search across their communication data. Our AI understands context and returns relevant results with source citations.
Example queries to try:
// Query user's connected data with natural language
const res = await fetch(`https://api.attrove.com/v1/ai/query?user_id=${userId}`, {
method: "POST",
headers: {
"Authorization": `Bearer ${userToken}`, // Token from Step 2
"Content-Type": "application/json",
},
body: JSON.stringify({
query: "What did we promise ACME last week?",
client_timezone: "America/Los_Angeles",
}),
});
const { answer, sources } = await res.json();
Your integration is set up. Start building AI-powered features with your users' communication data.