# DevRev

> Manage issues and tickets, parts, accounts, conversations, and timeline comments in DevRev's dev CRM via its REST API.

Lets an agent work with DevRev, the platform that unifies dev (issues), support (tickets and conversations), and CRM (accounts) on one graph. Create and update work items, list parts, dev users, accounts and conversations, and add timeline comments.

## What it can do

| Method | What it does |
| --- | --- |
| `devrev_work_create` | Create a work item (issue or ticket) with title, owner, body, and priority. |
| `devrev_works_list` | List work items, filtered by type and state. |
| `devrev_work_get` | Get a work item by ID. |
| `devrev_work_update` | Update a work item's title, body, stage, priority, or owner. |
| `devrev_parts_list` | List parts (products, capabilities, features) that work items apply to. |
| `devrev_dev_users_list` | List dev users (members of your DevRev org). |
| `devrev_accounts_list` | List accounts (customer organizations). |
| `devrev_conversations_list` | List support / PLuG conversations. |
| `devrev_timeline_entry_create` | Add a timeline comment / note to a work item or conversation. |
| `devrev_request` | Generic passthrough to any DevRev endpoint for full API coverage. |

> DevRev's API is POST-based: list and get operations are POST calls with a JSON body, not GET requests.

## How to get your token

DevRev authenticates API calls with a Personal Access Token (PAT) sent in the `Authorization` header.

1. Sign in to [DevRev](https://app.devrev.ai/).
2. Open **Settings -> API tokens** (Personal Access Tokens).
3. Create a new PAT, copy it, and paste it into FlyMyAI.

## Fields to fill

| FlyMyAI field | Where it comes from |
| --- | --- |
| `DEVREV_TOKEN` | DevRev -> Settings -> API tokens (Personal Access Token) |

## Troubleshooting

- **`401 Unauthorized`** - the PAT is wrong or expired. Create a new one in Settings -> API tokens.
- **`applies_to_part is required`** - some DevRev orgs require a part on every work item. List parts with `devrev_parts_list` and pass one of the IDs as `applies_to_part`.
- **`owned_by` not accepted** - pass dev-user IDs from `devrev_dev_users_list`, not names or emails.
- **Cannot find an object by ID** - DevRev IDs are `don:core:...` DON strings; use the exact value returned by a list call.

## Links

- [DevRev API reference](https://developer.devrev.ai/public/api-reference)
- [DevRev app](https://app.devrev.ai/)
