Quickstart
Get up and running with ConstellationAPI in 5 minutes.
Prerequisites
- ConstellationAPI running (see Installation)
- Your
INTERNAL_API_KEYfrom the.envfile - A tenant ID (or create one using the Admin API)
Step 1: Check API Health
curl http://localhost:3007/health
Step 2: Create a Tenant
First, create a tenant to organize your integrations:
curl -X POST http://localhost:3007/admin/tenants \
-H "Content-Type: application/json" \
-H "X-API-KEY: your-internal-key" \
-d '{
"id": "my-tenant",
"consumerId": "apideck-consumer-id",
"name": "My Organization",
"description": "My organization tenant"
}'
Note: Replace apideck-consumer-id with your actual Apideck consumer ID.
Step 3: List Available Integrations
curl http://localhost:3007/auth/integrations \
-H "X-API-KEY: your-internal-key" \
-H "X-Tenant-Id: my-tenant"
Step 4: Create a Vault Session
Authorize an integration (e.g., JIRA):
curl -X POST http://localhost:3007/auth/vault-session \
-H "Content-Type: application/json" \
-H "X-API-KEY: your-internal-key" \
-H "X-Tenant-Id: my-tenant" \
-d '{
"integration": "jira"
}'
Response:
{
"success": true,
"data": {
"sessionUri": "https://vault.apideck.com/session/abc123",
"consumerId": "consumer-123"
},
"meta": {
"tenantId": "my-tenant",
"integration": "jira",
"timestamp": "2024-01-01T00:00:00.000Z"
}
}
Step 5: Authorize the Integration
- Open the
sessionUrifrom the response in your browser - Complete the OAuth flow for the integration
- You'll be redirected back to your application
Step 6: Use the Integration
Once authorized, you can use the integration. For example, get JIRA projects:
curl http://localhost:3007/jira/projects \
-H "X-API-KEY: your-internal-key" \
-H "X-Tenant-Id: my-tenant"
Complete Example
Here's a complete example using JavaScript/Node.js:
const API_BASE = 'http://localhost:3007';
const API_KEY = 'your-internal-key';
const TENANT_ID = 'my-tenant';
// 1. Check health
const health = await fetch(`${API_BASE}/health`);
console.log(await health.json());
// 2. Create tenant
const tenant = await fetch(`${API_BASE}/admin/tenants`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-API-KEY': API_KEY,
},
body: JSON.stringify({
id: 'my-tenant',
consumerId: 'apideck-consumer-id',
name: 'My Organization',
}),
});
console.log(await tenant.json());
// 3. Create vault session
const vaultSession = await fetch(`${API_BASE}/auth/vault-session`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-API-KEY': API_KEY,
'X-Tenant-Id': TENANT_ID,
},
body: JSON.stringify({
integration: 'jira',
}),
});
const session = await vaultSession.json();
console.log('Open this URL to authorize:', session.data.sessionUri);
// 4. After authorization, get JIRA projects
const projects = await fetch(`${API_BASE}/jira/projects`, {
headers: {
'X-API-KEY': API_KEY,
'X-Tenant-Id': TENANT_ID,
},
});
console.log(await projects.json());
Next Steps
- Authentication Guide - Learn more about authentication
- API Reference - Explore all available endpoints
- JIRA Integration - Deep dive into JIRA integration