Skip to main content

Endpoints

MethodPathDescription
GET/v1/clientsList all clients
POST/v1/clientsCreate a client
GET/v1/clients/:idGet a client
PATCH/v1/clients/:idUpdate a client
POST/v1/clients/:id/inviteSend portal invite
GET/v1/clients/:id/projectsList client’s projects
GET/v1/clients/:id/invoicesList client’s invoices

List Clients

GET /v1/clients
Example Request:
curl https://api.nextoriahub.com/v1/clients \
  -H "Authorization: Bearer YOUR_API_KEY"
Example Response:
{
  "data": [
    {
      "id": "client_xyz789",
      "name": "Acme Corp",
      "email": "hello@acmecorp.com",
      "company": "Acme Corporation Inc.",
      "portal_access": true,
      "portal_last_seen": "2026-02-28T09:15:00Z",
      "total_billed": 45000,
      "outstanding_balance": 8500,
      "active_projects": 2,
      "created_at": "2025-06-01T00:00:00Z"
    }
  ],
  "meta": {
    "total": 34,
    "limit": 20
  }
}

Create a Client

POST /v1/clients
Request Body:
{
  "name": "Jane Doe",
  "email": "jane@globexcorp.com",
  "company": "Globex Corporation",
  "phone": "+1 555 000 0000",
  "address": {
    "line1": "123 Main St",
    "city": "Springfield",
    "state": "IL",
    "postal_code": "62701",
    "country": "US"
  },
  "notes": "Primary contact for all Globex projects."
}
Required fields: name, email Response: 201 Created

Send Portal Invite

POST /v1/clients/:id/invite
Sends a branded portal invitation email to the client. Request Body:
{
  "project_ids": ["proj_abc123", "proj_def456"],
  "message": "Welcome to our client portal! You can track your projects and invoices here.",
  "expires_at": "2026-06-01T00:00:00Z"
}
Response:
{
  "invited": true,
  "invite_sent_at": "2026-03-01T10:00:00Z",
  "portal_url": "https://portal.youragency.com"
}

Client Object

interface Client {
  id: string; // "client_xyz789"
  name: string;
  email: string;
  company: string | null;
  phone: string | null;
  address: Address | null;
  notes: string | null;
  portal_access: boolean;
  portal_last_seen: string | null;
  total_billed: number; // Lifetime billed, in minor currency units
  outstanding_balance: number;
  active_projects: number;
  created_at: string;
  updated_at: string;
}

interface Address {
  line1: string;
  line2?: string;
  city: string;
  state: string;
  postal_code: string;
  country: string; // ISO 3166-1 alpha-2
}