# Onfleet — Pipedream Connect

> Onfleet is the world's most advanced last mile delivery platform.

- API slug: `onfleet` (use in MCP headers and tool keys)
- Auth: API key (Pipedream-managed)
- Categories: Business Management
- Website: https://onfleet.com/
- This page (HTML): https://pipedream.com/apps/onfleet
- Tools: 3 actions · 14 triggers

## Connect via MCP (recommended)

- Endpoint: `https://remote.mcp.pipedream.net/v3`
- Headers: `Authorization: Bearer <token>` · `x-pd-project-id` · `x-pd-environment` · `x-pd-external-user-id` · `x-pd-app-slug: onfleet`

```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": "onfleet",
      },
    },
  },
)

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

const { tools } = await mcp.listTools()

// e.g. run Create Linked Pickup & Dropoff Tasks:
const result = await mcp.callTool({
  name: "onfleet-create-pickup-dropoff-task",
  arguments: {
    merchant: "Merchant",
    executor: "Executor",
  },
})
```

Docs: [MCP guide](https://pipedream.com/docs/connect/mcp/developers.md)

## API proxy

For a Onfleet endpoint with no pre-built tool, the proxy forwards your request with the connected user's credentials attached.

```bash
# The path segment is the target URL, URL-safe base64 encoded:
# https://onfleet.com/api/v2/organization

curl "https://api.pipedream.com/v1/connect/{project_id}/proxy/aHR0cHM6Ly9vbmZsZWV0LmNvbS9hcGkvdjIvb3JnYW5pemF0aW9u?external_user_id={external_user_id}&account_id=apn_xxxxxxx" \
  -H "Authorization: Bearer {access_token}" \
  -H "x-pd-environment: production"
```

Docs: [API proxy guide](https://pipedream.com/docs/connect/api-proxy.md)

## SDK

```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: "onfleet-create-pickup-dropoff-task",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    onfleet: { authProvisionId: "apn_xxxxxxx" },
    merchant: "Merchant",
    executor: "Executor",
  },
})
```

Docs: [Managed auth guide](https://pipedream.com/docs/connect/managed-auth/quickstart.md) · [Tools guide](https://pipedream.com/docs/connect/components.md)

## Actions (3)

### `onfleet-create-pickup-dropoff-task` — Create Linked Pickup & Dropoff Tasks (Write)

Create a pickup task and dropoff task linked with each other. See the docs here

Full schema: https://pipedream.com/apps/onfleet/actions/create-pickup-dropoff-task.md

### `onfleet-create-task` — Create New Task (Write)

Create a new task. See the docs here

Full schema: https://pipedream.com/apps/onfleet/actions/create-task.md

### `onfleet-create-task-template` — Create Task (Template Use) (Write)

Creates a single task. Used for simple templates only. See the docs here

Full schema: https://pipedream.com/apps/onfleet/actions/create-task-template.md

## Triggers (14)

### `onfleet-new-sms-recipient-response-missed` — New SMS Recipient Response Missed (Instant) (Instant)

Emit new event when a new SMS recipient response is missed.

Full schema: https://pipedream.com/apps/onfleet/triggers/new-sms-recipient-response-missed.md

### `onfleet-new-task-arrival` — New Task Arrival (Instant) (Instant)

Emit new event when a new task is arrival.

Full schema: https://pipedream.com/apps/onfleet/triggers/new-task-arrival.md

### `onfleet-new-task-assigned` — New Task Assigned (Instant) (Instant)

Emit new event when a new task is assigned.

Full schema: https://pipedream.com/apps/onfleet/triggers/new-task-assigned.md

### `onfleet-new-task-cloned` — New Task Cloned (Instant) (Instant)

Emit new event when a new task is cloned.

Full schema: https://pipedream.com/apps/onfleet/triggers/new-task-cloned.md

### `onfleet-new-task-completed` — New Task Completed (Instant) (Instant)

Emit new event when a new task is completed.

Full schema: https://pipedream.com/apps/onfleet/triggers/new-task-completed.md

### `onfleet-new-task-created` — New Task Created (Instant) (Instant)

Emit new event when a new task is created.

Full schema: https://pipedream.com/apps/onfleet/triggers/new-task-created.md

### `onfleet-new-task-delayed` — New Task Delayed (Instant) (Instant)

Emit new event when a new task is delayed.

Full schema: https://pipedream.com/apps/onfleet/triggers/new-task-delayed.md

### `onfleet-new-task-deleted` — New Task Deleted (Instant) (Instant)

Emit new event when a new task is deleted.

Full schema: https://pipedream.com/apps/onfleet/triggers/new-task-deleted.md

### `onfleet-new-task-eta` — New Task ETA (Instant) (Instant)

Emit new event when a new task is in ETA.

Full schema: https://pipedream.com/apps/onfleet/triggers/new-task-eta.md

### `onfleet-new-task-failed` — New Task Failed (Instant) (Instant)

Emit new event when a new task is failed.

Full schema: https://pipedream.com/apps/onfleet/triggers/new-task-failed.md

### `onfleet-new-task-started` — New Task Started (Instant) (Instant)

Emit new event when a new task is started.

Full schema: https://pipedream.com/apps/onfleet/triggers/new-task-started.md

### `onfleet-new-task-unassigned` — New Task Unassigned (Instant) (Instant)

Emit new event when a new task is unassigned.

Full schema: https://pipedream.com/apps/onfleet/triggers/new-task-unassigned.md

### `onfleet-new-task-updated` — New Task Updated (Instant) (Instant)

Emit new event when a new task is updated.

Full schema: https://pipedream.com/apps/onfleet/triggers/new-task-updated.md

### `onfleet-new-worker-duty` — New Worker Duty (Instant) (Instant)

Emit new event when a worker status is changed.

Full schema: https://pipedream.com/apps/onfleet/triggers/new-worker-duty.md

---

- All apps: https://pipedream.com/apps — index: https://pipedream.com/llms.txt
- Pipedream docs for agents: https://pipedream.com/docs/llms.txt
