Skip to main content

API Reference

Complete reference documentation for all Weir AI API v1.0.1 endpoints. This section provides detailed information about every endpoint, including parameters, response formats, and code examples.

API Categories Overview

External APIs

Purpose: Public-facing APIs for third-party integrations
  • Basic authentication with client credentials
  • Access token generation for external applications
  • Limited scope for public integrations
  • Third-party application integrations
  • Public API access for external developers
  • Limited functionality for security
  • Client credential-based authentication
  • 100 requests per minute per client
  • 10 token generation requests per minute
  • Burst limit of 200 requests per 5-minute window

Console APIs

Purpose: 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
  • Internal management tools
  • Organization administration
  • Team collaboration platforms
  • Platform management interfaces
  • User management systems
  • 200 requests per minute per user
  • 5 login requests per minute per IP
  • Burst limit of 500 requests per 5-minute window

Admin APIs

Purpose: 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
  • System administration dashboards
  • Platform monitoring and management
  • User administration tools
  • System maintenance and operations
  • Audit and compliance tools
  • 500 requests per minute per admin
  • 10 admin login requests per minute per IP
  • Burst limit of 1000 requests per 5-minute window

Common Response Format

All Weir AI API responses follow a consistent format:

Success Response Structure

{
  "data": {
    // Response data object
  },
  "message": "Human-readable message",
  "status": "success"
}

Error Response Structure

{
  "error": {
    "code": "ERROR_CODE",
    "message": "Human-readable error message",
    "details": "Additional error details"
  },
  "status": "error"
}

HTTP Status Codes

Success Codes

  • 200 OK: Successful GET, PUT, PATCH requests
  • 201 Created: Successful POST requests
  • 204 No Content: Successful DELETE requests

Error Codes

  • 400 Bad Request: Invalid request parameters
  • 401 Unauthorized: Authentication required
  • 403 Forbidden: Insufficient permissions
  • 404 Not Found: Resource not found
  • 429 Too Many Requests: Rate limit exceeded
  • 500 Internal Server Error: Server error

Authentication

Different API categories use different authentication methods:
Method: Basic Authentication
curl -X POST 'https://api.weir.ai/auth/token' \
  -H 'Authorization: Basic base64(client_id:secret_key)'
Method: Bearer Token with x-source header
curl -X GET 'https://api.weir.ai/org/teams' \
  -H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
  -H 'x-source: console'
Method: Bearer Token with admin privileges
curl -X GET 'https://api.weir.ai/admin/organizations' \
  -H 'Authorization: Bearer YOUR_ADMIN_TOKEN'

Rate Limiting

All APIs implement rate limiting with the following headers in responses:
X-RateLimit-Limit
string
Maximum number of requests allowed per time window.
X-RateLimit-Remaining
string
Number of requests remaining in the current time window.
X-RateLimit-Reset
string
Unix timestamp when the rate limit window resets.

Error Handling

  • UNAUTHORIZED: Invalid or expired authentication token
  • FORBIDDEN: Valid authentication but insufficient permissions
  • NOT_FOUND: Requested resource does not exist
  • VALIDATION_ERROR: Invalid request parameters
  • RATE_LIMIT_EXCEEDED: Too many requests in time window
{
  "error": {
    "code": "ERROR_CODE",
    "message": "Human-readable error message",
    "details": "Additional error details or validation errors"
  },
  "status": "error"
}

Pagination

Many endpoints support pagination for large datasets:
page
integer
default:"1"
Page number for pagination. Must be a positive integer.
limit
integer
default:"10"
Number of items per page. Range: 1-100.

Pagination Response Format

{
  "data": {
    "items": [...],
    "pagination": {
      "page": 1,
      "limit": 10,
      "total": 100,
      "totalPages": 10
    }
  }
}

Code Examples

Each endpoint documentation includes code examples in multiple languages:

cURL

Command-line examples for testing and automation

JavaScript

Modern JavaScript examples with fetch API

Python

Python examples with requests library

PHP

PHP examples with cURL

Interactive API Playground

Try the API Playground

Test endpoints directly in your browser with our interactive API playground. No external tools required.

Getting Started

Choose Your API Category

Select the API category that best matches your use case.

Review Authentication

Understand the authentication method for your chosen API category.

Explore Endpoints

Browse the available endpoints and their documentation.

Test with Examples

Use the provided code examples to test the endpoints.

Support and Resources

Pro Tip: Start with the API category that matches your use case, then explore the specific endpoints you need. Use the interactive playground to test endpoints before implementing them in your code.