Commusoft Contacts API

Manage contacts linked to customers or suppliers

OpenAPI Specification

commusoft-contacts-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: Commusoft Authentication Contacts API
  description: The Commusoft API is a RESTful JSON-based API designed to allow third parties to integrate products and applications with Commusoft's field service management platform. It enables programmatic management of jobs, customers, engineers, quotes, invoices, parts, and service histories for trades businesses including HVAC, plumbing, electrical, and building maintenance contractors. The API supports integrations with accounting tools (QuickBooks, Xero, Sage), payment processors (Stripe, GoCardless), and workflow automation platforms (Zapier).
  version: 1.0.0
  contact:
    url: https://www.commusoft.com/
  x-api-id: commusoft-api
  x-audience: external-partner
servers:
- url: https://api.commusoft.com/api/v1
  description: Commusoft production API server
security:
- ApiTokenHeader: []
- ApiTokenQuery: []
tags:
- name: Contacts
  description: Manage contacts linked to customers or suppliers
paths:
  /contacts:
    get:
      operationId: listContacts
      summary: List Contacts
      description: Retrieve contacts linked to customers or suppliers.
      tags:
      - Contacts
      responses:
        '200':
          description: List of contacts
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Contact'
        '401':
          $ref: '#/components/responses/Unauthorized'
    post:
      operationId: createContact
      summary: Create Contact
      description: Add a new contact linked to a customer or supplier.
      tags:
      - Contacts
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ContactInput'
      responses:
        '201':
          description: Contact created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Contact'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
  /contacts/{uuid}:
    get:
      operationId: getContact
      summary: Get Contact
      description: Retrieve a specific contact record by UUID.
      tags:
      - Contacts
      parameters:
      - $ref: '#/components/parameters/UuidPath'
      responses:
        '200':
          description: Contact record
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Contact'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  schemas:
    Error:
      type: object
      properties:
        message:
          type: string
          description: Human-readable error message
        code:
          type: integer
          description: Error code
    ContactInput:
      type: object
      required:
      - lastName
      - linkedEntityType
      - linkedEntityUuid
      properties:
        uuid:
          type: string
          format: uuid
        title:
          type: string
        firstName:
          type: string
        lastName:
          type: string
        email:
          type: string
          format: email
        telephone:
          type: string
        mobile:
          type: string
        linkedEntityType:
          type: string
          enum:
          - customer
          - supplier
        linkedEntityUuid:
          type: string
          format: uuid
    Contact:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        uuid:
          type: string
          format: uuid
          readOnly: true
        title:
          type: string
        firstName:
          type: string
        lastName:
          type: string
        email:
          type: string
          format: email
        telephone:
          type: string
        mobile:
          type: string
        linkedEntityType:
          type: string
          enum:
          - customer
          - supplier
          description: Whether this contact is linked to a customer or supplier
        linkedEntityUuid:
          type: string
          format: uuid
          description: UUID of the linked customer or supplier
        createdAt:
          type: string
          format: date-time
          readOnly: true
  responses:
    Unauthorized:
      description: Authentication token missing or invalid
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    BadRequest:
      description: Invalid request body or parameters
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  parameters:
    UuidPath:
      name: uuid
      in: path
      required: true
      description: Unique identifier (UUID) of the record
      schema:
        type: string
        format: uuid
  securitySchemes:
    ApiTokenHeader:
      type: apiKey
      in: header
      name: X-Auth-Token
      description: API token obtained from the /getToken endpoint
    ApiTokenQuery:
      type: apiKey
      in: query
      name: token
      description: API token passed as a query parameter