# Book Appointment — Zoho Bookings

> Book an appointment for a customer for a desired service. See the documentation

- Key: `zoho_bookings-book-appointment`
- Type: Action (Write)
- Version: 0.0.2
- App: Zoho Bookings (`zoho_bookings`) — https://pipedream.com/apps/zoho-bookings.md
- This page (HTML): https://pipedream.com/apps/zoho-bookings/actions/book-appointment
- Hints: open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/zoho_bookings/actions/book-appointment/book-appointment.mjs

## Description

Book an appointment for a customer for a desired service. [See the documentation](https://www.zoho.com/bookings/help/api/v1/book-appointment.html)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `serviceId` | `string` | Yes | The ID of the service for the appointment Options are loaded from the connected account. |
| `staffId` | `string` | No | The ID of the staff member for the appointment. Either staff or resource is mandatory Options are loaded from the connected account. |
| `resourceId` | `string` | No | The ID of the resource for the appointment. Either resource or staff is mandatory Options are loaded from the connected account. |
| `fromTime` | `string` | Yes | The starting time from which the appointment needs to be booked. (24-hour time format) format: dd-MMM-yyyy HH:mm:ss (e.g. 30-Apr-2019 22:00:00) |
| `customerDetails` | `object` | Yes | The details of the customer for the appointment |
| `timeZone` | `string` | No | The time zone of the appointment |

## Run it

**MCP**

```ts
import { Client } from "@modelcontextprotocol/sdk/client/index.js"
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js"
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const accessToken = await pd.rawAccessToken

const transport = new StreamableHTTPClientTransport(
  new URL("https://remote.mcp.pipedream.net/v3"),
  {
    requestInit: {
      headers: {
        Authorization: `Bearer ${accessToken}`,
        "x-pd-project-id": process.env.PIPEDREAM_PROJECT_ID!,
        "x-pd-environment": "production",
        "x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
        "x-pd-app-slug": "zoho_bookings",
      },
    },
  },
)

const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)

const { tools } = await mcp.listTools()

// listTools() hands your model this tool's input schema, so it can
// fill the arguments itself:
const result = await mcp.callTool({
  name: "zoho_bookings-book-appointment",
  arguments: {
    serviceId: "Service ID",
    staffId: "Staff ID",
  },
})
```

**TypeScript**

```ts
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const result = await pd.actions.run({
  id: "zoho_bookings-book-appointment",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    zoho_bookings: { authProvisionId: "apn_xxxxxxx" },
    serviceId: "Service ID",
    staffId: "Staff ID",
  },
})

console.log(result)
```

**cURL**

```bash
curl -X POST https://api.pipedream.com/v1/connect/{project_id}/actions/run \
  -H "Content-Type: application/json" \
  -H "X-PD-Environment: production" \
  -H "Authorization: Bearer {access_token}" \
  -d '{
    "external_user_id": "{external_user_id}",
    "id": "zoho_bookings-book-appointment",
    "configured_props": {
      "zoho_bookings": { "authProvisionId": "apn_xxxxxxx" },
      "serviceId": "Service ID",
      "staffId": "Staff ID"
    }
  }'
```

---

- App: https://pipedream.com/apps/zoho-bookings.md · All apps: https://pipedream.com/apps
