# Integrating SailPoint with FreeAgent

FreeAgent is a cloud-based accounting software platform designed for small businesses, freelancers, and accountants. It helps organizations manage invoicing, expenses, payroll, and financial reporting. It lets organizations track user identity and account-related attributes and connects to other tools via its REST API using **OAuth 2.0** (refresh token to access token). All calls are HTTPS. This document provides instructions to configure a new direct connection to a FreeAgent source. For a reference to the terminology specific to SailPoint products, refer to [Source and Connector Definitions](<https://documentation.sailpoint.com/saas/help/sources/index.html#source-and-connector-definitions>).

> [!NOTE]
>
> To view the latest features, enhancements, and fixes for all SaaS connectors, refer to the [SaaS Release Notes](<https://community.sailpoint.com/release-notes/saas>) page.

## Supported Features

The FreeAgent connector supports the following:

### Account Management

- Aggregate Users

> [!NOTE]
>
> User role is captured as part of account aggregation (embedded within the user record via the `role` attribute), so a separate entitlement aggregation is not required.

> [!IMPORTANT]
>
> Quick Compliance connectors have the following manual aggregation limits within a 24-hour period:
>
> - **Organization Admins**: Limited to 3 manual account or entitlement aggregations per day per source. This limit is cumulative across all admins in the organization.
> - **Regular Users**: Limited to 1 manual account or entitlement aggregation per day per source.
>
> These limits ensure that individual compliance statuses are kept up to date while maintaining continuous compliance monitoring. If you need to run additional aggregations beyond these limits, contact SailPoint Support.

## Prerequisites

Before you configure the FreeAgent connector, ensure the following requirements are met:

1. Sign in to [FreeAgent](<https://freeagent.com>) and the [FreeAgent Developer Dashboard](<https://dev.freeagent.com/>).
2. On the FreeAgent Developer Dashboard, go to **Create new app**, select **Create App**, and copy the **OAuth identifier** and **OAuth secret**.
3. Generate the **Refresh Token** using [Google OAuth 2.0 Playground](<https://developers.google.com/oauthplayground>):

   - Open [Google OAuth 2.0 Playground](<https://developers.google.com/oauthplayground>).
   - Select the **gear** icon. Select **Use your own OAuth credentials**. Enter the Client ID and Client Secret from the app you created.
   - Set OAuth endpoints to **Custom**:

     - Authorization: `https://api.freeagent.com/v2/approve_app`
     - Token: `https://api.freeagent.com/v2/token_endpoint`
   - In Step 1, enter any dummy scope (for example `api`) and select **Authorize APIs**. This redirects to the FreeAgent sign-in screen. Sign in and authorize the app.
   - Back in Playground, select **Exchange authorization code for tokens**.
   - Copy the **Refresh Token** from this response.
4. Copy and securely store the following details, which are required during connector configuration:

   - **Base URL**
   - **Token URL**
   - **Client ID**
   - **Client Secret**
   - **Refresh Token**

> [!NOTE]
>
> - The FreeAgent API uses OAuth 2.0 for authentication. The Access Token obtained via the OAuth flow is passed as a Bearer token on each API request: `Authorization: Bearer {{ your_access_token }}`.
> - All API requests must be made over HTTPS; unencrypted HTTP calls are not supported and will fail.
> - SailPoint uses the Refresh Token to obtain new Access Tokens automatically as they expire, so only the Refresh Token (along with the Client ID/Secret and Token URL) needs to be configured in SailPoint - the Access Token generated in **Google OAuth 2.0 Playground** is only used to complete the initial authorization and does not need to be stored in SailPoint.
> - Tokens should be stored securely and treated like a password.

For more detailed information on FreeAgent API authentication, refer to the [FreeAgent API documentation](<https://dev.freeagent.com/docs>).

> [!NOTE]
>
> The linked document is not maintained by SailPoint and is subject to change without notice.

## Required Permissions

FreeAgent uses role-based access at the account level. Available roles include the following:

### Staff Roles

- **Owner** - Full access to all company financial data, settings, and user management.
- **Director** - Broad access similar to Owner, typically without full billing or ownership control.
- **Partner** - Access similar to Director, used in partnership-structured businesses.
- **Company Secretary** - Administrative access focused on statutory and compliance tasks.
- **Employee** - Restricted access, typically limited to expenses, timeslips, and personal data.
- **Shareholder** - Restricted access, typically limited to viewing dividend or shareholding-related information.

### Advisor Roles

- **Accountant** - Granted to external accountants or advisors for managing client books.
