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

# Applications

> SQL and API credentials.

<div />

Propel Applications give your app credentials to access Propel via SQL or the API. [Scopes](#scopes) control what the Application can do, and [Propellers](#propellers) control the speed and cost of the queries.

## Scopes

Scopes determine what an Application can do in Propel. You can create an Application with the following scopes:

| Scope               | Description                                                     |
| :------------------ | :-------------------------------------------------------------- |
| `ADMIN`             | Can query and manage all resources (except other Applications). |
| `METRIC_QUERY`      | Can list and query Metrics.                                     |
| `DATA_POOL_QUERY`   | Can list and query Data Pools.                                  |
| `APPLICATION_ADMIN` | Can create another Application.                                 |
| `ENVIRONMENT_ADMIN` | Can create other Environments within the same Account.          |

## Propellers

Propellers determine the speed of queries on a per-query basis. They control the number of rows per second that an individual query can read from a Data Pool.

| Propeller    | Max records read per second | Price per GB read |
| :----------- | --------------------------: | ----------------: |
| `P1_X_SMALL` |                   1,000,000 |       \$0.03 / GB |
| `P1_SMALL`   |                  10,000,000 |       \$0.05 / GB |
| `P1_MEDIUM`  |                 100,000,000 |       \$0.06 / GB |
| `P1_LARGE`   |                 250,000,000 |       \$0.07 / GB |
| `P1_X_LARGE` |                 500,000,000 |       \$0.08 / GB |

By adjusting the Propeller size, you can optimize the balance between query performance and cost based on your specific needs.

For guidance on selecting the most appropriate Propeller for your use case, refer to our [Choosing a Propeller](/docs/guides/choosing-a-propeller) guide.

## Creating an Application

Follow these steps to create an Application:

<Tabs>
  <Tab title="Console">
    <Steps>
      <Step title="Go to the &#x22;Applications&#x22; section">
        Log into the [Propel Console](https://console.propeldata.com), navigate to the **"Applications"** section, and click on **"New Application"** .

        <Frame caption="Navigate to Applications section">
          <img src="https://mintcdn.com/propeldocs/Dnye5EmtO6L5-zx0/images/docs/2024-08-create-application-01.png?fit=max&auto=format&n=Dnye5EmtO6L5-zx0&q=85&s=6281dbe1c9a1a20fb8ab52e1f94ddf35" alt="Navigate to Applications section" width="1523" height="911" data-path="images/docs/2024-08-create-application-01.png" />
        </Frame>
      </Step>

      <Step title="Name your Application">
        Give your Application a unique name. It should represent the app that will be using the SQL or API credentials.

        <Frame caption="Name your Application">
          <img src="https://mintcdn.com/propeldocs/Dnye5EmtO6L5-zx0/images/docs/2024-08-create-application-02.png?fit=max&auto=format&n=Dnye5EmtO6L5-zx0&q=85&s=c0cc8360fd28f921ce0d379a5926d22b" alt="Name your Application" width="1279" height="246" data-path="images/docs/2024-08-create-application-02.png" />
        </Frame>
      </Step>

      <Step title="Select scopes">
        Scopes determine what the credentials will be allowed to do. To just query data, select the `DATAPOOL_QUERY` scope. Learn more about [scopes](#scopes).

        <Frame caption="Select scopes">
          <img src="https://mintcdn.com/propeldocs/Dnye5EmtO6L5-zx0/images/docs/2024-08-create-application-03.png?fit=max&auto=format&n=Dnye5EmtO6L5-zx0&q=85&s=fca2462def54bf8d62e28596dbe8e6c3" alt="Select scopes" width="1267" height="153" data-path="images/docs/2024-08-create-application-03.png" />
        </Frame>
      </Step>

      <Step title="Select Propeller size">
        Propellers determine the speed and cost of your queries. A `P1_X_SMALL` is a good to start with. You can change it later if you need to. Learn more about [Propellers](#propellers).

        <Frame caption="Select Propeller size">
          <img src="https://mintcdn.com/propeldocs/Dnye5EmtO6L5-zx0/images/docs/2024-08-create-application-04.png?fit=max&auto=format&n=Dnye5EmtO6L5-zx0&q=85&s=c6d6ec98ef539fd4a6b0e34a461a3d2e" alt="Select Propeller size" width="1275" height="249" data-path="images/docs/2024-08-create-application-04.png" />
        </Frame>
      </Step>

      <Step title="Create theApplication">
        Lastly, click **"Create Application"**.
      </Step>
    </Steps>
  </Tab>

  <Tab title="API">
    <Note>
      You must have the `APPLICATION_ADMIN` scope to create an Application.
    </Note>

    ```graphql theme={"system"}
    mutation {
      createApplication(
        input: {
          uniqueName: "Dashboard"
          description: "My dashboard app"
          scopes: [DATA_POOL_QUERY]
          propeller: P1_X_SMALL
        }
      ) {
        ... on ApplicationResponse {
          application {
            id
            uniqueName
            description
            scopes
            propeller
            clientId
            secret
          }
        }
        ... on FailureResponse {
          error {
            message
          }
        }
      }
    }
    ```
  </Tab>

  <Tab title="Terraform">
    <Note>
      You must have the `application:admin` scope to create an Application.
    </Note>

    ```hcl theme={"system"}
    resource "propel_application" "dashboard" {
      unique_name = "Dashboard"
      description = "My dashboard app"
      scopes = [DATA_POOL_QUERY]
      propeller = P1_X_SMALL
    }
    ```
  </Tab>
</Tabs>

## Using credentials

Now that you have your Application created, you can find your credentials on the Applications details page.

<Frame caption="Application credentials">
  <img src="https://mintcdn.com/propeldocs/Dnye5EmtO6L5-zx0/images/docs/2024-08-create-application-05.png?fit=max&auto=format&n=Dnye5EmtO6L5-zx0&q=85&s=6798ed9fd67443232c08fc529b20a478" alt="Application credentials" width="1516" height="882" data-path="images/docs/2024-08-create-application-05.png" />
</Frame>

### With SQL

You can use the client ID and secret as the user and password when [connecting to Propel via SQL](/docs/connect).

### With the API

To use your Application credentials with the Propel API, follow these steps:

1. **Obtain an Access Token**:
   Use your client ID and secret to request an access token. This token will be used to authenticate your API requests.

   ```bash theme={"system"}
   curl -X POST https://auth.us-east-2.propeldata.com/oauth2/token \
     -d "grant_type=client_credentials" \
     -d "client_id=YOUR_CLIENT_ID" \
     -d "client_secret=YOUR_CLIENT_SECRET"
   ```

   This request will return a JSON response containing your access token.

2. **Use the Access Token**:
   Include the access token in the Authorization header of your API requests.

   ```bash theme={"system"}
   curl -X POST https://api.us-east-2.propeldata.com/graphql \
     -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
   ```

<Note>
  Remember to keep your client credentials secure and never expose them in client-side code.
</Note>

For a complete guide on API authentication, refer to our [API authentication guide](/docs/query-apis/authentication).
