---
title: API Through Pathfix OAuth
slug: oauth
description: Call an API for your Pathfix OAuth connected users
docTags: 
createdAt: 2021-04-06T04:43:51.000Z
---

The Pathfix OAuth platform handles the entire OAuth integration process on your platform. Using Pathfix Automation, you can link your Pathfix OAuth account to initiate a call and trigger any automation for all your connected users.&#x20;

*Note: This method will only work if you use Pathfix OAuth to authenticate your users on your platform&#x20;*

**

Begin by linking your Pathfix OAuth account:

- Click on **Connections** on the top navigation bar
- Search for Pathfix and connect your Pathfix OAuth account

::Image[]{src="https://api.archbee.com/api/optimize/4iTydmxMeM2cxR5sP_SIi/mr2COiBY-WpcXwNUePtXh_image.png" size="86" width="1701" height="1217" caption="Link Pathfix OAuth Account" position="center" showCaption="true"}



Pathfix Automation has a few pre-configured APIs available in the public library ready for use. You can either choose to use one of those or add your own API using the API builder.&#x20;

To search and add an existing API:

- Add a new automation by clicking on **Design&#x20;**&#x61;nd select **+ Create New**
- On your design page, give your Automation a name, select the first task and click on **Call API**

****

::Image[]{src="https://api.archbee.com/api/optimize/4iTydmxMeM2cxR5sP_SIi/SHzgyIaYJ90I_ByaN0QwR_image.png" size="88" width="1700" height="1157" caption="Calling an API" position="center" showCaption="true"}



- Give the task a name and click on **Select API**
- Search by provider or description to pull up any API that may match your query

::Image[]{src="https://api.archbee.com/api/optimize/4iTydmxMeM2cxR5sP_SIi/dFL2-oad_O-oUsfZ9K3Hl_image.png" size="88" width="1762" height="1073" caption="Search for an API" position="center" showCaption="true"}



If an API is not available, you can add a custom API

**To add a custom API:**

- Click on **APIs&#x20;**&#x6F;n the top navigation bar
- Click on **New API** and then click on the **Build&#x20;**&#x69;con

::Image[]{src="https://api.archbee.com/api/optimize/4iTydmxMeM2cxR5sP_SIi/Mtk4ailxbMP4hxTHweSDf_image.png" size="88" width="1811" height="1215" caption="Build" position="center" showCaption="true"}



- Add the API endpoint URL and choose the method (POST, GET etc.)
- You can add dynamic values in `<>` in the URL, Header values, Query Param values or anywhere in the Body
- There are 3 ways to initialize the call&#x20;
  - **Initialize** (will directly call the API with the headers and params included, ideal for user-facing integrations where authentication is handled by you or to call your own service)
  - **Initialize through Connection** (will call the API through your linked Connection - ideal for user-facing integration where the authentication is handled by Pathfix or for internal automations where you have connected your software/provider account via the Connections tab)
  - **Manually Initialize** (allows you to initialize manually without waiting for a response from the provider)



::Image[]{src="https://api.archbee.com/api/optimize/4iTydmxMeM2cxR5sP_SIi/55cZg5kUmP9feGo8GwzKA_image.png" size="88" width="1427" height="1109" caption="API Build" position="center" showCaption="true"}



- Click **Initialize through Connection**, you will be asked to choose the Connection you have authorized, select the Pathfix OAuth account connected



::Image[]{src="https://api.archbee.com/api/optimize/4iTydmxMeM2cxR5sP_SIi/wVph6PT5UP2fDkd_ZU7WY_image.png" size="88" width="1413" height="1104" caption="Initialize through connection" position="center" showCaption="true"}



- As is required in your Pathfix OAuth setup, you will need to add the **Pathfix User Id** of your connected user. To complete the initilization, enter your Pathfix OAuth account email address.&#x20;
- Add the provider name as per the [Provider reference](https://docs.pathfix.com/provider-reference) (this is one time reference only)
- If there are any other Dynamic fields and inputs needed as per your API, enter them here&#x20;
- The default input type i&#x73;**&#x20;Free Text&#x20;**&#x62;ut you can switch this from any of the options from the dropdown, including getting this from an API&#x20;

::Image[]{src="https://api.archbee.com/api/optimize/4iTydmxMeM2cxR5sP_SIi/MWhEthGE4Isl3O63VRg-u_image.png" size="88" width="1403" height="1101" caption="API setup" position="center" showCaption="true"}



- Click on **Continue Initialize** to proceed
- In the Output screen, you would see the response from the call
- Click on **Use** and make sure you click on **Save**&#x20;



::Image[]{src="https://api.archbee.com/api/optimize/4iTydmxMeM2cxR5sP_SIi/P0o7Q_Gjbu4YbC9_grvzN_image.png" size="88" width="1387" height="1086" caption="Use and Save" position="center" showCaption="true"}



Your API is ready for use in your Automation.&#x20;

**Note**: When calling the Automation that uses this API, you will need to send along the **Pathfix User Id** of your connected user (e.g. Current User's Unique Id, email address, user account Id etc.).











Need help? Reach out to our support team for any additional assistance at support\@pathfix.com.

