Quick Start
Make your first API request in under 5 minutes
This guide walks you through authenticating with the Micro API and making your first request.
Prerequisites
Section titled “Prerequisites”- A Micro account
- An API key — go to Settings → API → Generate API key
1. Make your first request
Section titled “1. Make your first request”Query your contacts using curl:
curl https://api.micro.so/v2/prism/query/{teamId}/contact \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "query": { "select": ["full_name", "email", "title"], "limit": 10 } }'Replace {teamId} with your team ID (found in Settings → API) and YOUR_API_KEY with your key.
The response looks like:
[ { "id": "c1a2b3c4-...", "properties": { "full_name": "Sarah Chen", "email": "sarah@example.com", "title": "Partner" } }]2. Filter results
Section titled “2. Filter results”Add a filter to narrow results. For example, contacts labeled investor who you’ve interacted with recently:
curl https://api.micro.so/v2/prism/query/{teamId}/contact \ -H "x-api-key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "query": { "select": ["full_name", "email", "last_interaction_date"], "filter": [ { "labels": { "in": ["investor"] } }, { "last_interaction_date": { ">=": "2024-01-01" } } ], "sort": [{ "last_interaction_date": "desc" }], "limit": 25 } }'3. Use the TypeScript SDK
Section titled “3. Use the TypeScript SDK”Install the SDK:
npm install microimport Micro from 'micro';
const client = new Micro({ apiKey: process.env.MICRO_API_KEY, teamId: process.env.MICRO_TEAM_ID,});
const result = await client.contacts.list({ query: { select: ['full_name', 'email', 'title'], filter: [{ labels: { in: ['investor'] } }], limit: 25, },});
console.log(result); // array of { id, properties }Next steps
Section titled “Next steps”- Querying — filters, sorting, pagination, and relationship traversal
- Authentication — keeping your API key secure
- Errors — handling errors gracefully
- Objects — full property reference for each object type