Getting Started with Capital Check In API
This guide will help you set up your first integration with Capital Check In API in less than 10 minutes.
Prerequisites
- An account on Capital Check In
- Basic knowledge of HTTP and JSON
- A code editor (VS Code, Sublime Text, etc.)
Step 1: Create an Account
- Go to Capital Check In
- Click “Sign Up”
- Complete the form with your information
- Verify your email
- Complete the initial onboarding
Create Account
Sign up now
Step 2: Get Credentials
Once you’ve completed registration:
- Log in to your dashboard
- Go to Settings > API
- Copy your Company ID and API Key (if applicable)
For most integrations, you’ll only need your Company ID. The API Key is optional and used for specific applications.
Capital Check In API uses JWT Bearer tokens for authentication. First, you need to obtain a token:
Option A: Email/Password Login
curl -X POST https://api.capitalcheckin.app/v1/auth/login \
-H "Content-Type: application/json" \
-d '{
"email": "[email protected]",
"password": "your-password"
}'
Response:
{
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"token_type": "bearer",
"expires_in": 86400,
"user": {
"id": "123",
"name": "Your Name",
"email": "[email protected]",
"company_id": "456"
}
}
Step 4: Make Your First Request
Now that you have a token, you can make authenticated requests:
Get User Profile
curl -X GET https://api.capitalcheckin.app/v1/auth/user \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "X-Company-Id: YOUR_COMPANY_ID"
Response:
{
"id": "123",
"name": "Your Name",
"email": "[email protected]",
"company_id": "456",
"role": "admin",
"created_at": "2024-01-15T10:00:00Z"
}
List Collaborators
curl -X GET https://api.capitalcheckin.app/v1/collaborators \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "X-Company-Id: YOUR_COMPANY_ID"
Implementation Examples
JavaScript/Node.js
// Install the SDK
// npm install @capitalcheckin/sdk
import { CapitalCheckInAPI } from '@capitalcheckin/sdk';
// Initialize the API client
const api = new CapitalCheckInAPI({
baseURL: 'https://api.capitalcheckin.app/v1',
token: 'your-jwt-token',
companyId: 'your-company-id'
});
// Login
async function login() {
try {
const response = await api.auth.login({
email: '[email protected]',
password: 'your-password'
});
console.log('Login successful:', response);
return response.access_token;
} catch (error) {
console.error('Login failed:', error);
}
}
// Get user profile
async function getUserProfile() {
try {
const user = await api.auth.getUser();
console.log('User profile:', user);
return user;
} catch (error) {
console.error('Failed to get user profile:', error);
}
}
// List collaborators
async function getCollaborators() {
try {
const collaborators = await api.collaborators.list({
page: 1,
per_page: 10,
status: 'active'
});
console.log('Collaborators:', collaborators);
return collaborators;
} catch (error) {
console.error('Failed to get collaborators:', error);
}
}
// Create a collaborator
async function createCollaborator() {
try {
const newCollaborator = {
name: 'John Doe',
email: '[email protected]',
phone: '+1234567890',
position: 'Developer',
department: 'Engineering'
};
const collaborator = await api.collaborators.create(newCollaborator);
console.log('Collaborator created:', collaborator);
return collaborator;
} catch (error) {
console.error('Failed to create collaborator:', error);
}
}
Python
# Install the SDK
# pip install capitalcheckin
from capitalcheckin import CapitalCheckInAPI
# Initialize the API client
api = CapitalCheckInAPI(
base_url='https://api.capitalcheckin.app/v1',
token='your-jwt-token',
company_id='your-company-id'
)
# Login
def login():
try:
response = api.auth.login(
email='[email protected]',
password='your-password'
)
print('Login successful:', response)
return response['access_token']
except Exception as e:
print('Login failed:', e)
# Get user profile
def get_user_profile():
try:
user = api.auth.get_user()
print('User profile:', user)
return user
except Exception as e:
print('Failed to get user profile:', e)
# List collaborators
def get_collaborators():
try:
collaborators = api.collaborators.list(
page=1,
per_page=10,
status='active'
)
print('Collaborators:', collaborators)
return collaborators
except Exception as e:
print('Failed to get collaborators:', e)
# Create a collaborator
def create_collaborator():
try:
new_collaborator = {
'name': 'John Doe',
'email': '[email protected]',
'phone': '+1234567890',
'position': 'Developer',
'department': 'Engineering'
}
collaborator = api.collaborators.create(new_collaborator)
print('Collaborator created:', collaborator)
return collaborator
except Exception as e:
print('Failed to create collaborator:', e)
PHP
// Install the SDK
// composer require capitalcheckin/sdk
use CapitalCheckIn\CapitalCheckInAPI;
// Initialize the API client
$api = new CapitalCheckInAPI([
'base_url' => 'https://api.capitalcheckin.app/v1',
'token' => 'your-jwt-token',
'company_id' => 'your-company-id'
]);
// Login
function login() {
global $api;
try {
$response = $api->auth->login([
'email' => '[email protected]',
'password' => 'your-password'
]);
echo 'Login successful: ' . json_encode($response) . "\n";
return $response['access_token'];
} catch (Exception $e) {
echo 'Login failed: ' . $e->getMessage() . "\n";
}
}
// Get user profile
function getUserProfile() {
global $api;
try {
$user = $api->auth->getUser();
echo 'User profile: ' . json_encode($user) . "\n";
return $user;
} catch (Exception $e) {
echo 'Failed to get user profile: ' . $e->getMessage() . "\n";
}
}
// List collaborators
function getCollaborators() {
global $api;
try {
$collaborators = $api->collaborators->list([
'page' => 1,
'per_page' => 10,
'status' => 'active'
]);
echo 'Collaborators: ' . json_encode($collaborators) . "\n";
return $collaborators;
} catch (Exception $e) {
echo 'Failed to get collaborators: ' . $e->getMessage() . "\n";
}
}
// Create a collaborator
function createCollaborator() {
global $api;
try {
$newCollaborator = [
'name' => 'John Doe',
'email' => '[email protected]',
'phone' => '+1234567890',
'position' => 'Developer',
'department' => 'Engineering'
];
$collaborator = $api->collaborators->create($newCollaborator);
echo 'Collaborator created: ' . json_encode($collaborator) . "\n";
return $collaborator;
} catch (Exception $e) {
echo 'Failed to create collaborator: ' . $e->getMessage() . "\n";
}
}
Next Steps
Now that you have the basics working, here are some next steps:
Troubleshooting
Common Issues
401 Unauthorized
- Check that your token is valid and not expired
- Verify that you’re including the
Authorization: Bearer header
- Ensure your Company ID is correct
403 Forbidden
- Verify that your user has the necessary permissions
- Check that you’re using the correct Company ID
422 Validation Error
- Review the request body format
- Check that all required fields are included
- Verify data types (strings, numbers, etc.)
429 Too Many Requests
- You’ve exceeded the rate limit
- Wait before making more requests
- Consider implementing exponential backoff
Getting Help
If you encounter issues:
- Check the documentation - This guide and the API reference
- Review error messages - They often contain helpful information
- Contact support - Email us at [email protected]
- Join the community - Connect with other developers
API Reference
Explore all available endpoints