> ## Documentation Index
> Fetch the complete documentation index at: https://docs.capitalcheckin.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> Set up your first integration with Capital Check In API in minutes

# 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](https://cloud.capitalcheckin.app)
* Basic knowledge of HTTP and JSON
* A code editor (VS Code, Sublime Text, etc.)

## Step 1: Create an Account

1. Go to [Capital Check In](https://cloud.capitalcheckin.app)
2. Click "Sign Up"
3. Complete the form with your information
4. Verify your email
5. Complete the initial onboarding

<Card title="Create Account" icon="user-plus" href="https://cloud.capitalcheckin.app/sign-up">
  Sign up now
</Card>

## Step 2: Get Credentials

Once you've completed registration:

1. Log in to your dashboard
2. Go to **Settings** > **API**
3. Copy your **Company ID** and **API Key** (if applicable)

<Note>
  For most integrations, you'll only need your Company ID. The API Key is optional and used for specific applications.
</Note>

## Step 3: Configure Authentication

Capital Check In API uses JWT Bearer tokens for authentication. First, you need to obtain a token:

### Option A: Email/Password Login

```bash theme={null}
curl -X POST https://api.capitalcheckin.app/v1/auth/login \
  -H "Content-Type: application/json" \
  -d '{
    "email": "your-email@company.com",
    "password": "your-password"
  }'
```

**Response:**

```json theme={null}
{
  "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "token_type": "bearer",
  "expires_in": 86400,
  "user": {
    "id": "123",
    "name": "Your Name",
    "email": "your-email@company.com",
    "company_id": "456"
  }
}
```

## Step 4: Make Your First Request

Now that you have a token, you can make authenticated requests:

### Get User Profile

```bash theme={null}
curl -X GET https://api.capitalcheckin.app/v1/auth/user \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "X-Company-Id: YOUR_COMPANY_ID"
```

**Response:**

```json theme={null}
{
  "id": "123",
  "name": "Your Name",
  "email": "your-email@company.com",
  "company_id": "456",
  "role": "admin",
  "created_at": "2024-01-15T10:00:00Z"
}
```

### List Collaborators

```bash theme={null}
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

```javascript theme={null}
// 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: 'your-email@company.com',
      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: 'john@company.com',
      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

```python theme={null}
# 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='your-email@company.com',
            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': 'john@company.com',
            '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

```php theme={null}
// 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' => 'your-email@company.com',
            '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' => 'john@company.com',
            '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:

<CardGrid cols={2}>
  <Card title="Authentication Guide" icon="shield" href="/authentication/overview">
    Learn about all authentication methods
  </Card>

  <Card title="Collaborators API" icon="users" href="/api-reference/collaborators/collaborators">
    Complete guide to managing collaborators
  </Card>

  <Card title="Groups API" icon="user-group" href="/api-reference/collaborators/groups">
    Organize collaborators into groups
  </Card>

  <Card title="Lists API" icon="list-bullet" href="/api-reference/management/lists">
    Create custom collaborator lists
  </Card>
</CardGrid>

## 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:

1. **Check the documentation** - This guide and the API reference
2. **Review error messages** - They often contain helpful information
3. **Contact support** - Email us at [hi@capitalcheckin.app](mailto:hi@capitalcheckin.app)
4. **Join the community** - Connect with other developers

<Card title="API Reference" icon="book-open" href="/api-reference/introduction">
  Explore all available endpoints
</Card>
