> ## Documentation Index
> Fetch the complete documentation index at: https://docs.withterminal.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Motive OAuth Configuration

> Follow this guide to configure an OAuth2 client for Motive integration

## Overview

This guide provides detailed instructions on integrating Motive with your Terminal instance.

This is required for Motive specifically in order to guarantee:

* The OAuth flow is consistent with your branding.
* The permissions are customized for your specific needs.
* You can publish your application on the Motive [marketplace](https://marketplace.gomotive.com/).

## Creating a Developer Account

<Note>
  You can skip this step if you already have a Motive developer account
</Note>

<div
  style={{
position: 'relative',
paddingBottom: '64.90384615384616%',
height: '0',
}}
>
  <iframe
    src="https://www.loom.com/embed/3276f4c0c53445c0ab3dcb36a6862d7e?sid=2eb4268e-157b-4a99-9dad-f326df6b199f"
    frameborder="0"
    webkitallowfullscreen
    mozallowfullscreen
    allowfullscreen
    style={{
  position: 'absolute',
  top: '0',
  left: '0',
  width: '100%',
  height: '100%',
}}
  />
</div>

1. Create a Motive developer account by signing up [here](https://developer.gomotive.com/portal/auth/register).
   * **Tip**: use a shared email for your team as Motive does not have a multi-user feature.
2. Verify your email address by clicking the link in the email sent to you.
3. Log in to the [Motive Developer Portal](https://developer.gomotive.com/portal).
4. Share the `email` + `password` with the Terminal Team so we can help you complete setup.

## Creating an OAuth Application

<div
  style={{
position: 'relative',
paddingBottom: '64.90384615384616%',
height: '0',
}}
>
  <iframe
    src="https://www.loom.com/embed/872c1e1e319346fcacb6c06d429e27d8?sid=e96da9e1-2841-496c-99eb-ea278f84c490"
    frameborder="0"
    webkitallowfullscreen
    mozallowfullscreen
    allowfullscreen
    style={{
  position: 'absolute',
  top: '0',
  left: '0',
  width: '100%',
  height: '100%',
}}
  />
</div>

To establish an OAuth client with Motive, execute the following steps:

1. **Create a new App**:
   * Log in to the [Motive Developer Portal](https://developer.gomotive.com/portal).
   * Click the **Create App** button.
   * Give your application a name and click **Create App**.

2. Navigate to **Configuration**

3. Under **Success Redirect URI**, input:

```
https://link.withterminal.com/oauth/callback/motive/{PUBLISHABLE_KEY}
```

<Info>
  Substitute `{PUBLISHABLE_KEY}` with your production publishable key, which is
  available in your Terminal
  [dashboard](https://dashboard.withterminal.com/api-keys). If you haven't
  obtained production access to Terminal yet, you can skip this step and add the
  redirect URI later.
</Info>

4. Determine the **Permissions** your application will require.

<Accordion title="Which permissions should I select?">
  Here's a breakdown of the permissions and scopes you might need from Motive, depending on the Terminal common models you plan to use.

  <Tip>
    It's best to request all the permissions you might need upfront. Adding
    permissions later will require customers to re-authenticate, which can be
    avoided with early planning.
  </Tip>

  | Common Model                                        | Motive Scope                                                                                                                         |
  | --------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
  | **General** (required)                              | `Company Details (Read Only)`                                                                                                        |
  | **Vehicles** (required)                             | `Vehicles (Read Only)`                                                                                                               |
  | Devices                                             | `ELDs (Read Only)`                                                                                                                   |
  | Groups                                              | `Groups (Read Only)`                                                                                                                 |
  | Drivers                                             | `Drivers and Fleet Managers (Read Only)`                                                                                             |
  | Fault Code Events                                   | `Fault Codes (Read Only)`                                                                                                            |
  | Latest Vehicle Locations                            | `Vehicles with Current Location and Current Driver (Read Only)`<br />`Drivers with Current Location and Current Vehicle (Read Only)` |
  | Historical Vehicle Locations<br />Vehicle Stat Logs | `Vehicle Location History (Read Only)`                                                                                               |
  | Trailers                                            | `Assets (Read Only)`                                                                                                                 |
  | Trailer Locations                                   | `Asset with Asset Gateway Location History (Read Only)`                                                                              |
  | HOS Available Time                                  | `Drivers with Hours of Service (Read Only)`                                                                                          |
  | HOS Logs<br />HOS Daily Log                         | `HOS Logs (Read Only)`                                                                                                               |
  | Safety Events                                       | `Speeding Events (Read Only)`<br />`Scorecard Summary (Read Only)`                                                                   |
  | IFTA Summaries                                      | `IFTA Trip Reports (Read Only)`<br />`Vehicles' Mileage Summary (Read Only)`                                                         |
  | Vehicle Utilization                                 | `Utilization Summary by Vehicle (Read Only)`                                                                                         |
  | Passthrough                                         | *Select any other scopes you plan to leverage if using [passthrough](/terminal-platform/passthrough)*                                |
</Accordion>

5. Click **Save** to finalize application setup.
6. Share the `email` and `password` of the developer account with the Terminal Team.

## Update Motive Configuration in the Terminal Dashboard

<Note>
  If you haven’t obtained production access to Terminal yet, you can skip this
  step and complete it when you have production access.

  You must be a Terminal Dashboard admin to perform this step.
</Note>

1. Go to the Terminal Dashboard [Settings](https://dashboard.withterminal.com/settings?tab=application)
2. Scroll down to **Motive**
3. Paste the **Client ID** and **Client Secret** from Motive into the Terminal dashboard.
4. Click **Edit Scopes** to configure the scopes your application will use. Use the **Sync** button to show what is enabled in Motive to match.
   <Note>
     The scopes selected here should match the scopes you selected in the Motive
     developer portal.
   </Note>
5. Click **Close** to finish editing the scopes.
6. Click **Save Changes** to save the configuration.
7. Begin connecting Motive fleets to Terminal 🚛

## Publishing Your Application

Once your integration is in production and Motive fleets have connected to your application, you can request that Motive review your application for inclusion in their [marketplace](https://marketplace.gomotive.com/).

Contact us when ready, and we'll help introduce you to the Motive team to expedite the review process.
