# Create Agent — Freshdesk

> Create an agent in Freshdesk. See the documentation

- Key: `freshdesk-create-agent`
- Type: Action (Write)
- Version: 0.0.10
- App: Freshdesk (`freshdesk`) — https://pipedream.com/apps/freshdesk.md
- This page (HTML): https://pipedream.com/apps/freshdesk/actions/create-agent
- Hints: open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/freshdesk/actions/create-agent/create-agent.mjs

## Description

Create an agent in Freshdesk. [See the documentation](https://developers.freshdesk.com/api/#create_agent)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `email` | `string` | Yes | Email address of the Agent. |
| `ticketScope` | `integer` | Yes | Ticket permission of the agent. Current logged in agent can't update his/her ticket_scope |
| `occasional` | `boolean` | No | Set to true if this is an occasional agent (true => occasional, false => full-time) |
| `signature` | `string` | No | Signature of the agent in HTML format |
| `skillIds` | `string[]` | No | Array of skill IDs Options are loaded from the connected account. |
| `groupIds` | `string[]` | No | Array of group IDs Options are loaded from the connected account. |
| `roleIds` | `string[]` | No | Array of role IDs Options are loaded from the connected account. |
| `agentType` | `integer` | No | Type of the agent |
| `language` | `string` | No | Language of the Agent. Default language is `en` |
| `timeZone` | `string` | No | Time zone of the agent. Default value is time zone of the domain. |
| `focusMode` | `boolean` | No | Focus mode of the agent. Default value is true |

## 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": "freshdesk",
      },
    },
  },
)

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: "freshdesk-create-agent",
  arguments: {
    email: "Email",
    ticketScope: 10,
  },
})
```

**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: "freshdesk-create-agent",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    freshdesk: { authProvisionId: "apn_xxxxxxx" },
    email: "Email",
    ticketScope: 10,
  },
})

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": "freshdesk-create-agent",
    "configured_props": {
      "freshdesk": { "authProvisionId": "apn_xxxxxxx" },
      "email": "Email",
      "ticketScope": 10
    }
  }'
```

---

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