Skip to content

Aiwyn API (1.0.0)

Welcome to Aiwyn API

The Aiwyn API provides programmatic access to our comprehensive suite of financial automation tools. Build powerful integrations and automate your accounting workflows with our RESTful APIs.

Key Features

  • 🔐 Secure Authentication - Industry-standard OAuth 2.0 and API key authentication
  • 📊 Real-time Data - Access up-to-date financial information
  • 🚀 High Performance - Low latency, high throughput API infrastructure
  • 📚 Comprehensive Coverage - Full access to clients, engagements, expenses, and more
  • 🛠️ Developer-Friendly - Extensive documentation, SDKs, and code examples

API Versioning

We use URL versioning for our APIs. The current version is v1. All endpoints are prefixed with the version number.

Download OpenAPI description
Overview
Languages
Servers
Mock server
https://api.doc.aiwyn.ai/_mock/bundle/
Staging Environment (Test Data)
https://demo.api.aiwyn.ai/

🔐 Authentication

Authentication endpoints for obtaining access tokens and managing API keys.

Operations

👤 Client

Manage client records, profiles, and related operations.

Operations

List clients

Request

Retrieve all clients with basic pagination support

This endpoint provides simple client listing capabilities without any filtering restrictions. It's designed for scenarios where you need to browse through the entire client database with standard pagination controls.

Key Features:

  • Basic pagination with configurable page sizes (default: 50 records)
  • Default sorting by client name (ascending) then creation date (descending)
  • Complete client information including contact details and staff assignments
  • Total count aggregation for pagination metadata
  • No filtering logic - returns all clients in the system
  • Optimized for dashboard displays and data export operations

Performance Considerations:

  • Default 50-record pageSize prevents memory issues with large datasets
  • Indexed sorting on name and createdAt fields for optimal query performance
  • Consider using filtered queries for large client databases (1000+ records)
  • Suitable for datasets up to 10,000 clients with reasonable response times

Real Example:

curl --location 'https://{{host}}/v1/clients' \
--data '{
  "pageSize": 25,
  "page": 0
}'
Security
BearerAuth
Bodyapplication/json
pageSizeinteger[ 1 .. 1000 ]

Maximum number of client records to return

Default 50
Example: 25
pageinteger>= 0

Number of records to skip for pagination navigation

Default 0
Example: 0
curl -i -X POST \
  https://api.doc.aiwyn.ai/_mock/bundle/gql/v1/clients \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "pageSize": 25,
    "page": 0
  }'

Responses

Successfully retrieved client list

Bodyapplication/json
clientsArray of objects(Client)
totalobject
Response
application/json
{ "clients": [ {}, {}, {}, {}, {} ], "total": { "aggregate": {} } }

Search clients

Request

Advanced client filtering with custom GraphQL where clauses and dynamic ordering

This query provides maximum flexibility for client data retrieval through custom GraphQL-style where clause construction and dynamic ordering specifications. It's designed for complex business requirements that need sophisticated filtering logic.

Key Features:

  • Custom GraphQL where clause construction for unlimited filtering combinations
  • Dynamic order_by specifications supporting multi-field sorting with custom directions
  • Advanced boolean logic combining multiple filter conditions with _and, _or, _not
  • Relationship-based filtering across connected entities (contacts, staff assignments)
  • Custom pagination with flexible pageSize and page controls for any result set size
  • Full access to GraphQL query capabilities through REST interface abstraction
  • Enterprise-grade filtering supporting complex business logic requirements
  • Support for nested queries and conditional logic patterns

Advanced Filtering Capabilities:

  • Boolean Logic: _and, _or, _not operators for complex condition combinations
  • Text Operations: _like, _ilike, _regex for pattern matching and search
  • Comparison Operators: _gt, _gte, _lt, _lte, _eq, _neq for numerical/date comparisons
  • Array Operations: _in, _nin for multi-value filtering and inclusion/exclusion
  • Null Handling: _is_null for empty value detection and filtering
  • Relationship Traversal: Filter on connected entities like contacts and staff
  • Date Ranges: Precision timestamp filtering for time-based analysis
  • Case Sensitivity: Both case-sensitive and case-insensitive text matching

Dynamic Ordering Options:

  • Multi-field Sorting: Order by multiple columns with individual sort directions
  • Relationship Sorting: Sort by connected entity fields (staff names, contact info)
  • Custom Directions: Mix ascending and descending order across different fields
  • Priority Ordering: Define primary, secondary, tertiary sort criteria
  • Date-based Sorting: createdAt, updatedAt for chronological ordering
  • Text Sorting: Alphabetical ordering with locale-aware collation

Real Example:

curl --location 'https://{{host}}/v1/clients/search' \
--header 'Authorization: bearer {{token}} \
--header 'Content-Type: application/json' \
--data '{
  "pageSize": 1,
  "where": {
    "_and": [
      {
        "_or": [
          {
            "name": {
              "_ilike": "%tech%"
            }
          },
          {
            "clientRef": {
              "_ilike": "%45%"
            }
          }
        ]
      },
      {
        "active": {
          "_eq": true
        }
      },
      {
        "createdAt": {
          "_gte": "1900-01-01T00:00:00Z"
        }
      },
      {
        "partnerStaffId": {
          "_in": [
            5,
            6,
            7,
            8
          ]
        }
      }
    ]
  },
  "orderBy": [
    {
      "name": "asc"
    },
    {
      "createdAt": "desc"
    }
  ]
}'
Security
BearerAuth
Bodyapplication/json
limitinteger[ 1 .. 1000 ]

Maximum number of filtered clients to return

Default 1
Example: 1
whereobject

GraphQL-style where clause for complex filtering

Example: {"_and":[{"_or":[{"name":{"_ilike":"%tech%"}},{"clientRef":{"_ilike":"%45%"}}]},{"active":{"_eq":true}},{"createdAt":{"_gte":"1900-01-01T00:00:00Z"}},{"partnerStaffId":{"_in":[5,6,7,8]}}]}
orderByArray of objects

Dynamic ordering specifications with multiple fields

Example: [{"name":"asc"},{"createdAt":"desc"}]
curl -i -X POST \
  https://api.doc.aiwyn.ai/_mock/bundle/gql/v1/clients/search \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "limit": 1,
    "where": {
      "_and": [
        {
          "_or": [
            {
              "name": {
                "_ilike": "%tech%"
              }
            },
            {
              "clientRef": {
                "_ilike": "%45%"
              }
            }
          ]
        },
        {
          "active": {
            "_eq": true
          }
        },
        {
          "createdAt": {
            "_gte": "1900-01-01T00:00:00Z"
          }
        },
        {
          "partnerStaffId": {
            "_in": [
              5,
              6,
              7,
              8
            ]
          }
        }
      ]
    },
    "orderBy": [
      {
        "name": "asc"
      },
      {
        "createdAt": "desc"
      }
    ]
  }'

Responses

Successfully retrieved filtered clients with dynamic ordering

Bodyapplication/json
clientsArray of objects
totalobject
Response
application/json
{ "clients": [ {}, {} ], "total": { "aggregate": {} } }

Get client by ID

Request

Retrieve a specific client by its unique identifier

This endpoint provides detailed client information including:

  • Complete client details and demographics
  • Client status and relationship information
  • Contact and address information
  • Engagement and project portfolio
  • Financial and billing information
  • Industry and business classification

Client Management Features:

  • Client lifecycle tracking
  • Relationship management
  • Contact and address management
  • Engagement portfolio oversight
  • Financial and billing setup

Client Details Include:

  • Client name and demographics
  • Client status and type
  • Contact information
  • Address and location
  • Engagement portfolio
  • Financial information

Business Applications:

  • Client relationship management
  • Engagement portfolio analysis
  • Financial performance tracking
  • Contact management
  • Business development planning

Real Example:

curl --location 'https://{{host}}/v1/client/789' \
--header 'Authorization: bearer {{token}}' \
--header 'Content-Type: application/json'

Response Example:

{
  "id": 789,
  "name": "Acme Corporation",
  "legalName": "Acme Corporation, Inc.",
  "status": "ACTIVE",
  "type": "CORPORATE",
  "industry": "MANUFACTURING",
  "size": "LARGE",
  "website": "https://www.acme.com",
  "taxId": "12-3456789",
  "phone": "+1-555-0123",
  "email": "info@acme.com",
  "address": {
    "street": "123 Business Ave",
    "city": "New York",
    "state": "NY",
    "zipCode": "10001",
    "country": "USA"
  },
  "billingAddress": {
    "street": "456 Finance Blvd",
    "city": "New York",
    "state": "NY",
    "zipCode": "10002",
    "country": "USA"
  },
  "primaryContact": {
    "id": 23456,
    "name": "John Smith",
    "title": "Chief Financial Officer",
    "email": "john.smith@acme.com",
    "phone": "+1-555-0123"
  },
  "engagements": [
    {
      "id": 34567,
      "name": "Annual Audit Engagement 2024",
      "status": "ACTIVE",
      "type": "AUDIT",
      "startDate": "2024-01-01T00:00:00Z",
      "endDate": "2024-12-31T23:59:59Z"
    }
  ],
  "financialSummary": {
    "totalRevenue": 150000.00,
    "outstandingBalance": 25000.00,
    "currency": "USD",
    "lastPaymentDate": "2024-11-15T10:30:00Z"
  },
  "notes": "Long-term client with excellent payment history and strong relationship",
  "createdAt": "2020-01-15T10:00:00Z",
  "updatedAt": "2024-11-20T14:30:00Z"
}
Security
BearerAuth
Path
idinteger>= 1required

Unique identifier of the client

Example: 789
curl -i -X GET \
  https://api.doc.aiwyn.ai/_mock/bundle/gql/v1/client/789 \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>'

Responses

Client details retrieved successfully

Bodyapplication/json
idinteger

Unique client identifier

Example: 789
namestring

Client name

Example: "Acme Corporation"
legalNamestring

Legal business name

Example: "Acme Corporation, Inc."
statusstring

Client status

Enum"ACTIVE""INACTIVE""PROSPECT""FORMER"
Example: "ACTIVE"
typestring

Client type

Enum"CORPORATE""INDIVIDUAL""PARTNERSHIP""LLC""NONPROFIT"
Example: "CORPORATE"
industrystring

Industry classification

Enum"MANUFACTURING""RETAIL""HEALTHCARE""FINANCIAL""TECHNOLOGY""CONSULTING""OTHER"
Example: "MANUFACTURING"
sizestring

Company size classification

Enum"SMALL""MEDIUM""LARGE""ENTERPRISE"
Example: "LARGE"
websitestring(uri)

Company website URL

Example: "https://www.acme.com"
taxIdstring

Tax identification number

Example: "12-3456789"
phonestring

Primary phone number

Example: "+1-555-0123"
emailstring(email)

Primary email address

Example: "info@acme.com"
addressobject

Primary business address

billingAddressobject

Billing address (if different from primary)

primaryContactobject

Primary contact information

engagementsArray of objects

Active engagements for this client

financialSummaryobject

Financial summary for this client

notesstring

Additional notes about the client

Example: "Long-term client with excellent payment history and strong relationship"
createdAtstring(date-time)

Client creation timestamp

Example: "2020-01-15T10:00:00Z"
updatedAtstring(date-time)

Last update timestamp

Example: "2024-11-20T14:30:00Z"
Response
application/json
{ "id": 789, "name": "Acme Corporation", "legalName": "Acme Corporation, Inc.", "status": "ACTIVE", "type": "CORPORATE", "industry": "MANUFACTURING", "size": "LARGE", "website": "https://www.acme.com", "taxId": "12-3456789", "phone": "+1-555-0123", "email": "info@acme.com", "address": { "street": "123 Business Ave", "city": "New York", "state": "NY", "zipCode": "10001", "country": "USA" }, "billingAddress": { "street": "456 Finance Blvd", "city": "New York", "state": "NY", "zipCode": "10002", "country": "USA" }, "primaryContact": { "id": 23456, "name": "John Smith", "title": "Chief Financial Officer", "email": "john.smith@acme.com", "phone": "+1-555-0123" }, "engagements": [ {} ], "financialSummary": { "totalRevenue": 150000, "outstandingBalance": 25000, "currency": "USD", "lastPaymentDate": "2024-11-15T10:30:00Z" }, "notes": "Long-term client with excellent payment history and strong relationship", "createdAt": "2020-01-15T10:00:00Z", "updatedAt": "2024-11-20T14:30:00Z" }

📇 Contact

Manage contact information and relationships for clients.

Operations

🧑‍💼 Staff

Manage staff accounts, roles, and permissions.

Operations

💳 Payments

Handle incoming and outgoing payments.

Operations

🧾 Billing

Manage billing cycles, statements, and billing configurations.

Operations

📄 Invoices

Create, send, and manage invoices.

Operations

📋 Projects

Handle engagements, projects, and workflow tracking.

Operations

⏱ Time

Track and manage billable and non-billable time entries.

Operations

✉️ Engagement

Create, send, and track engagement.

Operations

🛤 Last Mile

Handle the final delivery stage and client closing processes.