> ## Documentation Index
> Fetch the complete documentation index at: https://doc-dev.weir.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Quick Start Guide - Weir AI API v1.0.1

> Get up and running with Weir AI API v1.0.1 in minutes. Complete setup guide for developers.

Welcome to the Weir AI API v1.0.1 Quick Start Guide! This guide will get you from zero to making your first API call in just a few minutes.

## Prerequisites

Before you begin, ensure you have:

<CardGroup cols={2}>
  <Card title="API Credentials" icon="key">
    Access to Weir AI API credentials (API key or basic auth credentials)
  </Card>

  <Card title="Development Environment" icon="laptop-code">
    A development environment with your preferred programming language
  </Card>

  <Card title="HTTP Client" icon="globe">
    A tool to make HTTP requests (curl, Postman, or your preferred client)
  </Card>

  <Card title="Basic API Knowledge" icon="book">
    Familiarity with REST APIs and JSON (we'll guide you through everything)
  </Card>
</CardGroup>

## Choose Your API Category

Weir AI API v1.0.1 offers different API categories for different use cases:

<AccordionGroup>
  <Accordion title="External APIs" icon="globe" defaultOpen={true}>
    **For**: Third-party integrations and public-facing applications

    * Generate access tokens for external applications
    * Basic authentication with client credentials
    * Limited scope for public integrations

    <Tip>
      Use External APIs when building integrations that will be used by external developers or third-party applications.
    </Tip>
  </Accordion>

  <Accordion title="Console APIs" icon="desktop">
    **For**: Organization management and internal operations

    * Team management and member invitations
    * Platform creation and management
    * Client and talent roster management
    * User profile and authentication management
    * Subscription and billing management

    <Tip>
      Use Console APIs for building internal management tools and organization administration features.
    </Tip>
  </Accordion>

  <Accordion title="Admin APIs" icon="shield">
    **For**: Platform administration and system management

    * Administrative user management
    * System-wide platform and organization management
    * Pod management and system control
    * Mail template management
    * Comprehensive logging and monitoring

    <Warning>
      Admin APIs require special administrative privileges and should only be used by authorized system administrators.
    </Warning>
  </Accordion>
</AccordionGroup>

## Step 1: Set Up Authentication

### For External APIs

<Steps>
  <Step title="Get Your Credentials" icon="key">
    Obtain your `clientId` and `secretKey` from the Weir AI dashboard.

    <CodeGroup>
      ```bash Environment Variables theme={null}
      export CLIENT_ID="your_client_id_here"
      export SECRET_KEY="your_secret_key_here"
      export API_BASE_URL="https://api.weir.ai"
      ```
    </CodeGroup>
  </Step>

  <Step title="Generate Access Token" icon="token">
    Use basic authentication to generate an access token.

    <RequestExample>
      ```bash cURL theme={null}
      curl -X POST 'https://api.weir.ai/auth/token' \
        -H 'Content-Type: application/json' \
        -u 'your_client_id:your_secret_key'
      ```
    </RequestExample>

    <ResponseExample>
      ```json Success Response theme={null}
      {
        "data": {
          "accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
          "expiresIn": 3600,
          "tokenType": "Bearer"
        },
        "message": "Access token generated successfully",
        "status": "success"
      }
      ```
    </ResponseExample>
  </Step>
</Steps>

### For Console APIs

<Steps>
  <Step title="Register or Login" icon="user-plus">
    Create an account or login to get your console credentials.

    <RequestExample>
      ```bash Registration theme={null}
      curl -X POST 'https://api.weir.ai/auth/register' \
        -H 'Content-Type: application/json' \
        -d '{
          "fullname": "John Doe",
          "email": "john@example.com",
          "password": "securePassword123",
          "organization": {
            "name": "My Company",
            "type": "Platform",
            "description": "A business platform"
          }
        }'
      ```
    </RequestExample>
  </Step>

  <Step title="Validate Registration" icon="check">
    If registration requires validation, use the OTP validation endpoint.

    <RequestExample>
      ```bash OTP Validation theme={null}
      curl -X POST 'https://api.weir.ai/auth/validate/registration' \
        -H 'Content-Type: application/json' \
        -d '{
          "otpSession": "your_otp_session_id",
          "otp": "123456"
        }'
      ```
    </RequestExample>
  </Step>

  <Step title="Login and Get Tokens" icon="sign-in">
    Login to get your access and refresh tokens.

    <RequestExample>
      ```bash Login theme={null}
      curl -X POST 'https://api.weir.ai/auth/login' \
        -H 'Content-Type: application/json' \
        -d '{
          "username": "John Doe",
          "password": "securePassword123"
        }'
      ```
    </RequestExample>
  </Step>
</Steps>

## Step 2: Make Your First API Call

### External API Example

<Steps>
  <Step title="Set Up Your Request" icon="gear">
    Use the access token from Step 1 to make authenticated requests.

    <CodeGroup>
      ```bash cURL theme={null}
      curl -X GET 'https://api.weir.ai/external/endpoint' \
        -H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
        -H 'Content-Type: application/json'
      ```

      ```javascript JavaScript theme={null}
      const response = await fetch('https://api.weir.ai/external/endpoint', {
        method: 'GET',
        headers: {
          'Authorization': `Bearer ${accessToken}`,
          'Content-Type': 'application/json'
        }
      });

      const data = await response.json();
      console.log(data);
      ```

      ```python Python theme={null}
      import requests

      headers = {
        'Authorization': f'Bearer {access_token}',
        'Content-Type': 'application/json'
      }

      response = requests.get('https://api.weir.ai/external/endpoint', headers=headers)
      data = response.json()
      print(data)
      ```
    </CodeGroup>
  </Step>
</Steps>

### Console API Example - Create a Team

<Steps>
  <Step title="Create Your First Team" icon="users">
    Use the Console API to create a team for your organization.

    <RequestExample>
      ```bash Create Team theme={null}
      curl -X POST 'https://api.weir.ai/org/create/team' \
        -H 'Authorization: Bearer YOUR_CONSOLE_TOKEN' \
        -H 'Content-Type: application/json' \
        -H 'x-source: console' \
        -d '{
          "name": "Development Team"
        }'
      ```
    </RequestExample>

    <ResponseExample>
      ```json Success Response theme={null}
      {
        "data": {
          "teamId": "team_123456789",
          "name": "Development Team",
          "createdAt": "2025-01-15T10:30:00Z",
          "memberCount": 1
        },
        "message": "Team created successfully",
        "status": "success"
      }
      ```
    </ResponseExample>
  </Step>

  <Step title="Invite Team Members" icon="user-plus">
    Invite members to your newly created team.

    <RequestExample>
      ```bash Invite Member theme={null}
      curl -X POST 'https://api.weir.ai/org/invite/team/member/team_123456789' \
        -H 'Authorization: Bearer YOUR_CONSOLE_TOKEN' \
        -H 'Content-Type: application/json' \
        -H 'x-source: console' \
        -d '{
          "firstname": "Jane",
          "lastname": "Smith",
          "email": "jane@example.com",
          "role": "Organization_User"
        }'
      ```
    </RequestExample>
  </Step>
</Steps>

## Step 3: Explore Advanced Features

### Platform Management

<Steps>
  <Step title="Create a Platform" icon="server">
    Create a platform for your organization.

    <RequestExample>
      ```bash Create Platform theme={null}
      curl -X POST 'https://api.weir.ai/org/create/platform' \
        -H 'Authorization: Bearer YOUR_CONSOLE_TOKEN' \
        -H 'Content-Type: application/json' \
        -H 'x-source: console' \
        -d '{
          "name": "My Platform",
          "teamId": "team_123456789",
          "description": "A sample platform",
          "type": "Forum/Community",
          "domain": "myplatform.com"
        }'
      ```
    </RequestExample>
  </Step>

  <Step title="Verify Your Platform" icon="check-circle">
    Verify your platform domain.

    <RequestExample>
      ```bash Verify Platform theme={null}
      curl -X GET 'https://api.weir.ai/org/verify/platform/PLATFORM_ID' \
        -H 'Authorization: Bearer YOUR_CONSOLE_TOKEN' \
        -H 'x-source: console'
      ```
    </RequestExample>
  </Step>
</Steps>

### Client Management

<Steps>
  <Step title="Create a Client" icon="desktop">
    Create a client for your platform.

    <RequestExample>
      ```bash Create Client theme={null}
      curl -X POST 'https://api.weir.ai/org/create/client' \
        -H 'Authorization: Bearer YOUR_CONSOLE_TOKEN' \
        -H 'Content-Type: application/json' \
        -H 'x-source: console' \
        -d '{
          "name": "My Client App",
          "environment": "production"
        }'
      ```
    </RequestExample>
  </Step>
</Steps>

## Step 4: Handle Authentication Refresh

<Steps>
  <Step title="Refresh Your Token" icon="refresh">
    When your access token expires, use the refresh token to get a new one.

    <RequestExample>
      ```bash Refresh Token theme={null}
      curl -X POST 'https://api.weir.ai/auth/refresh/token' \
        -H 'Content-Type: application/json' \
        -d '{
          "refreshToken": "YOUR_REFRESH_TOKEN"
        }'
      ```
    </RequestExample>

    <ResponseExample>
      ```json Success Response theme={null}
      {
        "data": {
          "accessToken": "new_access_token_here",
          "refreshToken": "new_refresh_token_here",
          "expiresIn": 3600
        },
        "message": "Token refreshed successfully",
        "status": "success"
      }
      ```
    </ResponseExample>
  </Step>
</Steps>

## Step 5: Error Handling

<Steps>
  <Step title="Handle Common Errors" icon="exclamation-triangle">
    Learn how to handle common API errors gracefully.

    <AccordionGroup>
      <Accordion title="Authentication Errors">
        ```json 401 Unauthorized theme={null}
        {
          "error": {
            "code": "UNAUTHORIZED",
            "message": "Invalid or expired token",
            "details": "The provided access token is invalid or has expired"
          },
          "status": "error"
        }
        ```

        **Solution**: Refresh your token or re-authenticate.
      </Accordion>

      <Accordion title="Validation Errors">
        ```json 400 Bad Request theme={null}
        {
          "error": {
            "code": "VALIDATION_ERROR",
            "message": "Invalid request parameters",
            "details": {
              "name": "Team name is required",
              "email": "Invalid email format"
            }
          },
          "status": "error"
        }
        ```

        **Solution**: Check your request parameters and fix validation errors.
      </Accordion>

      <Accordion title="Rate Limiting">
        ```json 429 Too Many Requests theme={null}
        {
          "error": {
            "code": "RATE_LIMIT_EXCEEDED",
            "message": "Too many requests",
            "details": "Rate limit of 100 requests per minute exceeded"
          },
          "status": "error"
        }
        ```

        **Solution**: Implement exponential backoff and respect rate limits.
      </Accordion>
    </AccordionGroup>
  </Step>
</Steps>

## Next Steps

<CardGroup cols={2}>
  <Card title="Explore API Reference" icon="book">
    Dive deep into the complete API reference with detailed endpoint documentation, parameters, and response examples.
  </Card>

  <Card title="Try the API Playground" icon="play">
    Test endpoints interactively in your browser with our built-in API playground.
  </Card>

  <Card title="Read Integration Guides" icon="puzzle-piece">
    Learn best practices and integration patterns for different use cases.
  </Card>

  <Card title="Join the Community" icon="users">
    Connect with other developers and get help from the Weir AI community.
  </Card>
</CardGroup>

## Common Use Cases

<AccordionGroup>
  <Accordion title="Building a Third-Party Integration" icon="globe">
    Use External APIs to build integrations that other developers can use. Focus on authentication and basic API access.
  </Accordion>

  <Accordion title="Organization Management Tool" icon="building">
    Use Console APIs to build internal tools for managing teams, platforms, and users within your organization.
  </Accordion>

  <Accordion title="Platform Administration" icon="shield">
    Use Admin APIs to build administrative tools for managing the entire Weir AI platform and system resources.
  </Accordion>
</AccordionGroup>

<Tip>
  **Pro Tip**: Start with the API Playground to explore endpoints interactively, then use the detailed API reference for implementation. The integration guides provide real-world patterns and best practices.
</Tip>

<Check>
  **Congratulations!** You've successfully set up Weir AI API v1.0.1 and made your first API calls. You're now ready to build powerful integrations with our platform.
</Check>
