Skip to main content
The AI Agent endpoints power FieldIU’s intelligent automation layer. Use them to check appointment availability, confirm work orders, create incidents, and interact with the conversational AI.

Confirm Work Order

Confirms or cancels a scheduled work order visit.

Request Body

wo_number
string
The work order number to confirm
confirmed
boolean
Set to true to confirm the visit, false to cancel
visit_date
string
required
The scheduled visit date and time (ISO 8601 format)

Example Request

curl -X POST https://integration.fieldiu.online/api/v1/ai-agent/confirm-workorder \
  -H "Content-Type: application/json" \
  -H "X-API-KEY: your_api_key" \
  -H "X-ORG-ID: your_org_id" \
  -d '{
    "wo_number": "WO-2024-001",
    "confirmed": true,
    "visit_date": "2024-06-15T09:00:00Z"
  }'
const response = await fetch('https://integration.fieldiu.online/api/v1/ai-agent/confirm-workorder', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'X-API-KEY': 'your_api_key',
    'X-ORG-ID': 'your_org_id'
  },
  body: JSON.stringify({
    wo_number: 'WO-2024-001',
    confirmed: true,
    visit_date: '2024-06-15T09:00:00Z'
  })
});

Check Booking Availability

Checks whether a specific date and time slot is available for booking.

Request Body

dateTime
string
The date and time to check, in ISO 8601 format (e.g. 2024-06-15T09:00:00Z)

Example Request

curl -X POST https://integration.fieldiu.online/api/v1/ai-agent/is-booking-available \
  -H "Content-Type: application/json" \
  -H "X-API-KEY: your_api_key" \
  -H "X-ORG-ID: your_org_id" \
  -d '{ "dateTime": "2024-06-15T09:00:00Z" }'
const response = await fetch('https://integration.fieldiu.online/api/v1/ai-agent/is-booking-available', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'X-API-KEY': 'your_api_key',
    'X-ORG-ID': 'your_org_id'
  },
  body: JSON.stringify({ dateTime: '2024-06-15T09:00:00Z' })
});

Get Available Appointments

Returns a list of available appointment slots starting from a given date and time.

Request Body

dateTime
string
The starting date and time to search from, in ISO 8601 format

Example Request

curl -X POST https://integration.fieldiu.online/api/v1/ai-agent/available-appointments \
  -H "Content-Type: application/json" \
  -H "X-API-KEY: your_api_key" \
  -H "X-ORG-ID: your_org_id" \
  -d '{ "dateTime": "2024-06-15T00:00:00Z" }'
const response = await fetch('https://integration.fieldiu.online/api/v1/ai-agent/available-appointments', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'X-API-KEY': 'your_api_key',
    'X-ORG-ID': 'your_org_id'
  },
  body: JSON.stringify({ dateTime: '2024-06-15T00:00:00Z' })
});

Create Incident

Logs a new pest or service incident linked to a client.

Request Body

clientName
string
Name of the client associated with the incident
insectName
string
Name or type of pest/insect involved in the incident
dateTime
string
required
Date and time of the incident in ISO 8601 format (e.g. 2017-07-21T17:32:28Z)

Example Request

curl -X POST https://integration.fieldiu.online/api/v1/ai-agent/create-incident \
  -H "Content-Type: application/json" \
  -H "X-API-KEY: your_api_key" \
  -H "X-ORG-ID: your_org_id" \
  -d '{
    "clientName": "Acme Corporation",
    "insectName": "German Cockroach",
    "dateTime": "2024-06-10T14:30:00Z"
  }'
const response = await fetch('https://integration.fieldiu.online/api/v1/ai-agent/create-incident', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'X-API-KEY': 'your_api_key',
    'X-ORG-ID': 'your_org_id'
  },
  body: JSON.stringify({
    clientName: 'Acme Corporation',
    insectName: 'German Cockroach',
    dateTime: '2024-06-10T14:30:00Z'
  })
});

Create Quote Request

Submits a new quote request on behalf of a client.

Request Body

clientName
string
required
Name of the client requesting the quote
description
string
required
Description of the service or scope being quoted

Example Request

curl -X POST https://integration.fieldiu.online/api/v1/ai-agent/create-quote-request \
  -H "Content-Type: application/json" \
  -H "X-API-KEY: your_api_key" \
  -H "X-ORG-ID: your_org_id" \
  -d '{
    "clientName": "Acme Corporation",
    "description": "Monthly pest control service for a 3-floor commercial building"
  }'
const response = await fetch('https://integration.fieldiu.online/api/v1/ai-agent/create-quote-request', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'X-API-KEY': 'your_api_key',
    'X-ORG-ID': 'your_org_id'
  },
  body: JSON.stringify({
    clientName: 'Acme Corporation',
    description: 'Monthly pest control service for a 3-floor commercial building'
  })
});

Get Work Order Details

Retrieves full details for a specific work order by its number.

Request Body

woNumber
string
required
The work order number to look up

Example Request

curl -X POST https://integration.fieldiu.online/api/v1/ai-agent/get-wo-details \
  -H "Content-Type: application/json" \
  -H "X-API-KEY: your_api_key" \
  -H "X-ORG-ID: your_org_id" \
  -d '{ "woNumber": "WO-2024-001" }'
const response = await fetch('https://integration.fieldiu.online/api/v1/ai-agent/get-wo-details', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'X-API-KEY': 'your_api_key',
    'X-ORG-ID': 'your_org_id'
  },
  body: JSON.stringify({ woNumber: 'WO-2024-001' })
});

Ask the AI

Sends a natural language query to the FieldIU AI assistant and returns a response. Supports multi-turn conversations via chatId.

Request Body

query
string
required
The natural language question or instruction to send to the AI
chatId
string
required
A UUID that groups messages into a single conversation thread. Generate a new UUID to start a fresh conversation
userId
string
required
The UUID of the user sending the query

Example Request

curl -X POST https://integration.fieldiu.online/api/v1/ai-agent/ask \
  -H "Content-Type: application/json" \
  -H "X-API-KEY: your_api_key" \
  -H "X-ORG-ID: your_org_id" \
  -d '{
    "query": "What are the open work orders for Acme Corporation?",
    "chatId": "550e8400-e29b-41d4-a716-446655440000",
    "userId": "660e8400-e29b-41d4-a716-446655440000"
  }'
const response = await fetch('https://integration.fieldiu.online/api/v1/ai-agent/ask', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'X-API-KEY': 'your_api_key',
    'X-ORG-ID': 'your_org_id'
  },
  body: JSON.stringify({
    query: 'What are the open work orders for Acme Corporation?',
    chatId: '550e8400-e29b-41d4-a716-446655440000',
    userId: '660e8400-e29b-41d4-a716-446655440000'
  })
});

Get Metadata

Returns metadata and configuration available to the AI agent for your organization. No request body is required.

Example Request

curl -X POST https://integration.fieldiu.online/api/v1/ai-agent/get-meta-data \
  -H "X-API-KEY: your_api_key" \
  -H "X-ORG-ID: your_org_id"
const response = await fetch('https://integration.fieldiu.online/api/v1/ai-agent/get-meta-data', {
  method: 'POST',
  headers: {
    'X-API-KEY': 'your_api_key',
    'X-ORG-ID': 'your_org_id'
  }
});

Response

200 OK — Returns organization metadata used by the AI agent.