Skip to content

AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents

1.1 KB
Raw Blame
import { createAction, Property } from "@activepieces/pieces-framework";
import { housecallProAuth, makeHousecallProRequest } from "../common";
import { HttpMethod } from "@activepieces/pieces-common";

export const deleteJobSchedule = createAction({
  auth: housecallProAuth,
  name: "delete_job_schedule",
  classification: 'DESTRUCTIVE',
  displayName: "Delete Job Schedule",
  description: "Deletes schedule on a job.",
  audience: 'both',
  aiMetadata: { description: "Remove the schedule (start/end times) from a Housecall Pro job by job ID, leaving the job itself intact. Idempotent: deleting an already-unscheduled job's schedule has no further effect.", idempotent: true },
  props: {
    job_id: Property.ShortText({
      displayName: "Job ID",
      description: "The ID of the job to delete schedule from.",
      required: true,
    }),
  },
  async run(context) {
    const { auth, propsValue } = context;

    const response = await makeHousecallProRequest(
      auth,
      `/jobs/${propsValue['job_id']}/schedule`,
      HttpMethod.DELETE
    );

    return response.body;
  },
});