IKU MEDIA ERP API

RESTful API Documentation

PRODUCTION Version 1.0.0

Status
Healthy
Database
Connected
Queue
Configured
Last Updated
07:19:49

🔐 Authentication Quick Start

The API uses Laravel Sanctum with Bearer tokens. Send Authorization: Bearer <token> on protected endpoints. withCredentials is not required unless you use cookie-based auth.

1. Login

POST https://agencyapi.ikuhub.com/api/auth/login Content-Type: application/json { "email": "user@example.com", "password": "your_password" } // Response: { "success": true, "data": { "user": { ... }, "token": "1|abc123def456..." } }

2. Use Token in Subsequent Requests

GET https://agencyapi.ikuhub.com/api/auth/me Authorization: Bearer 1|abc123def456... Accept: application/json

3. Logout

POST https://agencyapi.ikuhub.com/api/auth/logout Authorization: Bearer {your_token}

🌐 CORS & Headers

Spark Frontend Notes:
• Allowed origins are configured via config/cors.php
• Send Authorization: Bearer <token> on protected endpoints
withCredentials is only needed for cookie-based auth
• On 401, prompt login and refresh token
// Axios example (Bearer token) import axios from 'axios'; const api = axios.create({ baseURL: 'https://agencyapi.ikuhub.com/api', headers: { 'Content-Type': 'application/json', 'Accept': 'application/json' } }); api.interceptors.request.use((config) => { const token = localStorage.getItem('auth_token'); if (token) { config.headers.Authorization = `Bearer ${token}`; } return config; }); // Fetch example (Bearer token) const token = localStorage.getItem('auth_token'); fetch('https://agencyapi.ikuhub.com/api' + '/auth/me', { method: 'GET', headers: { 'Authorization': `Bearer ${token}`, 'Accept': 'application/json' } });

📡 API Endpoints

Below is a categorized overview of major endpoints. For complete details, request/response schemas, and interactive testing, use the Swagger UI.

Authentication

User authentication and session management

  • POST /auth/login
    Login and get access token
  • GET /auth/me
    Get current authenticated user
  • POST /auth/logout
    Logout and revoke token

Talents

TikTok talent management

  • GET /talents
    List all talents (paginated)
  • POST /talents
    Create new talent
  • GET /talents/{id}
    Get talent details
  • PUT /talents/{id}
    Update talent
  • DELETE /talents/{id}
    Delete talent

Groups

Talent group management

  • GET /groups
    List all groups
  • POST /groups
    Create new group
  • GET /groups/{id}/members
    List group members
  • POST /groups/{id}/members
    Add member to group

Revenue

Diamond and affiliate revenue tracking

  • GET /revenue/diamond
    List diamond revenues
  • POST /revenue/diamond
    Record diamond revenue
  • GET /revenue/affiliate
    List affiliate revenues
  • POST /revenue/affiliate
    Record affiliate revenue

Periods

Accounting period management

  • GET /periods
    List all periods
  • POST /periods
    Create new period
  • POST /periods/{id}/lock
    Lock period
  • POST /periods/{id}/unlock
    Unlock period

Payouts

Talent payout generation and approval

  • GET /payouts
    List all payouts
  • POST /payouts/generate
    Generate payout for period
  • POST /payouts/{id}/submit
    Submit for approval
  • POST /payouts/{id}/approve
    Approve payout

HR Management

Employee, department, attendance, and leave management

  • GET /employees
    List employees
  • GET /departments
    List departments
  • GET /attendance
    List attendance logs
  • GET /leave-requests
    List leave requests
  • GET /contracts
    List contracts

Finance & Accounting

General ledger, journal entries, and reconciliation

  • GET /coa-accounts
    List chart of accounts
  • GET /journal-entries
    List journal entries
  • POST /journal-entries/{id}/post
    Post to GL
  • GET /reconciliations
    List reconciliations

Payroll

Employee and talent payroll processing

  • GET /payroll-periods
    List payroll periods
  • GET /employee-payroll
    List employee payrolls
  • GET /talent-payroll
    List talent payrolls
  • POST /employee-payroll/{id}/approve
    Approve payroll

Bank & Cash

Bank account and cash management

  • GET /bank-accounts
    List bank accounts
  • GET /bank-transactions
    List bank transactions
  • GET /cash-boxes
    List cash boxes
  • GET /cash-transactions
    List cash transactions

Fixed Assets

Asset tracking and depreciation

  • GET /assets
    List fixed assets
  • GET /asset-categories
    List asset categories
  • GET /depreciation-runs
    List depreciation runs
  • POST /depreciation-runs
    Run depreciation

Content & Campaigns

Content calendar and campaign management

  • GET /content-calendar
    List content calendar
  • GET /content-items
    List content items
  • GET /campaigns
    List campaigns
  • GET /tasks
    List tasks

Reports & Exports

Reporting and data export

  • GET /reports/talent-revenue
    Talent revenue report
  • GET /reports/payroll-summary
    Payroll summary report
  • POST /exports
    Request data export
  • GET /exports/{id}
    Get export status

📝 Response Format

Success Response

{ "success": true, "message": "Operation successful", "data": { ... }, "meta": { // pagination info } }

Error Response

{ "success": false, "message": "Error message", "errors": { // validation errors (422 only) } }
Rate Limiting:
• Auth endpoints: 5 requests/minute
• All other endpoints: 60 requests/minute