{
 "openapi": "3.1.0",
 "info": {
  "title": "Activities (CRM)",
  "version": "20261030b",
  "description": "Calls, e-mails, meetings and notes logged against a customer, a contact or an opportunity, and what is still to do."
 },
 "servers": [
  {
   "url": "https://{tenant}.tranxact.ai",
   "variables": {
    "tenant": {
     "default": "demo"
    }
   }
  }
 ],
 "components": {
  "securitySchemes": {
   "bearer": {
    "type": "http",
    "scheme": "bearer"
   }
  },
  "schemas": {
   "activities": {
    "type": "object",
    "required": [
     "subject"
    ],
    "properties": {
     "id": {
      "type": "string",
      "format": "uuid",
      "description": "Id",
      "readOnly": true
     },
     "org_id": {
      "type": "string",
      "format": "uuid",
      "description": "Org id",
      "readOnly": true
     },
     "activity_type": {
      "type": "string",
      "description": "Type",
      "enum": [
       "call",
       "email",
       "meeting",
       "note",
       "task",
       "visit"
      ]
     },
     "subject": {
      "type": "string",
      "description": "Subject"
     },
     "due_at": {
      "type": "string",
      "format": "date-time",
      "description": "When"
     },
     "status": {
      "type": "string",
      "description": "Status",
      "enum": [
       "open",
       "done",
       "cancelled"
      ]
     },
     "account_id": {
      "type": "string",
      "format": "uuid",
      "description": "Account"
     },
     "contact_id": {
      "type": "string",
      "format": "uuid",
      "description": "Contact"
     },
     "opportunity_id": {
      "type": "string",
      "format": "uuid",
      "description": "Opportunity id"
     },
     "owner_id": {
      "type": "string",
      "format": "uuid",
      "description": "Owner id",
      "readOnly": true
     },
     "notes": {
      "type": "string",
      "description": "Notes"
     },
     "created_at": {
      "type": "string",
      "format": "date-time",
      "description": "Created at",
      "readOnly": true
     },
     "org_unit_id": {
      "type": "string",
      "format": "uuid",
      "description": "Org unit id",
      "readOnly": true
     },
     "location_id": {
      "type": "string",
      "format": "uuid",
      "description": "Location id",
      "readOnly": true
     },
     "warehouse_id": {
      "type": "string",
      "format": "uuid",
      "description": "Warehouse id",
      "readOnly": true
     },
     "lead_id": {
      "type": "string",
      "format": "uuid",
      "description": "Lead id",
      "readOnly": true
     },
     "xf_text_1": {
      "type": "string",
      "description": "Xf text 1",
      "readOnly": true
     },
     "xf_text_2": {
      "type": "string",
      "description": "Xf text 2",
      "readOnly": true
     },
     "xf_text_3": {
      "type": "string",
      "description": "Xf text 3",
      "readOnly": true
     },
     "xf_text_4": {
      "type": "string",
      "description": "Xf text 4",
      "readOnly": true
     },
     "xf_text_5": {
      "type": "string",
      "description": "Xf text 5",
      "readOnly": true
     },
     "xf_num_1": {
      "type": "string",
      "format": "decimal",
      "description": "Xf num 1",
      "readOnly": true
     },
     "xf_num_2": {
      "type": "string",
      "format": "decimal",
      "description": "Xf num 2",
      "readOnly": true
     },
     "xf_num_3": {
      "type": "string",
      "format": "decimal",
      "description": "Xf num 3",
      "readOnly": true
     },
     "xf_date_1": {
      "type": "string",
      "format": "date",
      "description": "Xf date 1",
      "readOnly": true
     },
     "xf_date_2": {
      "type": "string",
      "format": "date",
      "description": "Xf date 2",
      "readOnly": true
     },
     "created_by": {
      "type": "string",
      "format": "uuid",
      "description": "Created by",
      "readOnly": true
     },
     "updated_at": {
      "type": "string",
      "format": "date-time",
      "description": "Updated at",
      "readOnly": true
     },
     "updated_by": {
      "type": "string",
      "format": "uuid",
      "description": "Updated by",
      "readOnly": true
     },
     "source": {
      "type": "string",
      "description": "Source",
      "readOnly": true
     },
     "external_id": {
      "type": "string",
      "description": "External id",
      "readOnly": true
     },
     "mailbox_connection_id": {
      "type": "string",
      "format": "uuid",
      "description": "Mailbox connection id",
      "readOnly": true
     },
     "direction": {
      "type": "string",
      "description": "Direction",
      "readOnly": true
     },
     "from_address": {
      "type": "string",
      "description": "From address",
      "readOnly": true
     },
     "to_addresses": {
      "type": "string",
      "description": "To addresses",
      "readOnly": true
     },
     "body_text": {
      "type": "string",
      "description": "Body text",
      "readOnly": true
     },
     "starts_at": {
      "type": "string",
      "format": "date-time",
      "description": "Starts at",
      "readOnly": true
     },
     "ends_at": {
      "type": "string",
      "format": "date-time",
      "description": "Ends at",
      "readOnly": true
     },
     "location_text": {
      "type": "string",
      "description": "Location text",
      "readOnly": true
     },
     "calendar_event_id": {
      "type": "string",
      "description": "Calendar event id",
      "readOnly": true
     },
     "calendar_pushed_at": {
      "type": "string",
      "format": "date-time",
      "description": "Calendar pushed at",
      "readOnly": true
     },
     "calendar_push_error": {
      "type": "string",
      "description": "Calendar push error",
      "readOnly": true
     }
    }
   }
  }
 },
 "security": [
  {
   "bearer": []
  }
 ],
 "paths": {
  "/api/crm/activities": {
   "get": {
    "summary": "list activities",
    "operationId": "list_activities_0_4",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "post": {
    "summary": "create activities",
    "operationId": "create_activities_1_4",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/crm/activities/{id}": {
   "get": {
    "summary": "get activities",
    "operationId": "get_activities_0_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "put": {
    "summary": "change activities",
    "operationId": "change_activities_1_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "delete": {
    "summary": "delete activities",
    "operationId": "delete_activities_2_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/crm/activities/{id}/calendar-invite": {
   "post": {
    "summary": "Calendar invite",
    "operationId": "action_activities_0_6",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/crm/activities/{id}/calendar-invite/cancel": {
   "post": {
    "summary": "Calendar invite cancel",
    "operationId": "action_activities_0_7",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/crm/activities/{id}/push-to-calendar": {
   "post": {
    "summary": "Push to calendar",
    "operationId": "action_activities_0_6",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/crm/activities/{id}/copy": {
   "post": {
    "summary": "Copy",
    "operationId": "action_activities_0_6",
    "description": "Body keys: overrides, preview, withLines",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  }
 }
}