# Freshservice

> Manage Freshservice IT service desk - tickets, agents, requesters, assets, problems, changes and departments - with the REST API v2.

Lets an agent run your Freshservice IT service desk through the REST API v2: list and read tickets, create and update them, and pull agents, requesters, assets, problems, changes and departments. Use it to triage incidents, file new tickets, and report on the service desk.

## What it can do

| Method | What it does |
| --- | --- |
| `freshservice_tickets_list` | List tickets, with optional filter, pagination and sort. |
| `freshservice_ticket_get` | Get one ticket by id, optionally embedding conversations, requester, stats and more. |
| `freshservice_ticket_create` | Create a ticket (subject, description, requester, priority, status, group, responder, tags). |
| `freshservice_ticket_update` | Update a ticket's subject, priority, status, group, responder or tags. |
| `freshservice_agents_list` | List agents (staff who handle tickets). |
| `freshservice_requesters_list` | List requesters (end users who raise tickets). |
| `freshservice_assets_list` | List assets (configuration items). |
| `freshservice_problems_list` | List problems (root causes behind recurring incidents). |
| `freshservice_changes_list` | List changes (planned modifications to services/infrastructure). |
| `freshservice_departments_list` | List departments. |
| `freshservice_request` | Generic passthrough to any `/api/v2` endpoint for full API coverage. |

## How to get your API key

Freshservice authenticates with HTTP Basic auth, where your API key is the username and any string is the password. The connector handles that for you - you just paste the key and your account domain.

1. Sign in to your Freshservice account.
2. Click your avatar in the top-right corner and open **Profile Settings**.
3. Find the **API Key** on the right-hand side of the page and copy it ([finding your API key](https://support.freshservice.com/support/solutions/articles/153184-finding-your-api-key)).
4. Note your account domain - the part before `.freshservice.com` in your URL (e.g. for `https://acme.freshservice.com` the domain is `acme`).

## Fields to fill

| FlyMyAI field | Where it comes from |
| --- | --- |
| `FRESHSERVICE_DOMAIN` | Your account subdomain, e.g. `acme` or `acme.freshservice.com` |
| `FRESHSERVICE_API_KEY` | Freshservice -> avatar -> Profile Settings -> API Key |

## Troubleshooting

- **`401 Unauthorized`** - the API key is wrong or was reset. Re-copy it from Profile Settings.
- **`404` / cannot connect** - the domain is wrong. Use only the subdomain (`acme`), not the full URL.
- **`403 Forbidden`** - your agent role lacks permission for that object (e.g. assets or changes). Ask an admin to grant the scope.
- **Empty ticket list** - the default view may exclude resolved/closed tickets. Pass a `filter` or use `freshservice_request` with explicit query parameters.

## Links

- [Freshservice API reference](https://api.freshservice.com)
- [Finding your API key](https://support.freshservice.com/support/solutions/articles/153184-finding-your-api-key)
