> ## Documentation index
> Fetch the complete documentation index at: https://docs.prescientai.com/llms.txt
> Use this file to discover all available pages before exploring further. Add `.md` to any page URL to get that page as Markdown.

# Types

> Reference for each object, enum, and scalar in the schema of the Prescient GraphQL API, with the fields and the values of each one.

The schema has 15 types. Each query page links to the types that the query uses.

## Objects

An object is a set of fields that a query returns.

### Model

| Field  | Type          | Nullable | Description                                            |
| ------ | ------------- | -------- | ------------------------------------------------------ |
| `name` | `String!`     | No       | The name of the model                                  |
| `unit` | `MetricUnit!` | No       | The unit in which this model's metrics are measured in |

Used by: [`models`](https://docs.prescientai.com/api/queries/models).

### ModeledMetricQuery

| Field      | Type                   | Nullable | Description                                  |
| ---------- | ---------------------- | -------- | -------------------------------------------- |
| `data`     | `[ModeledMetricRow!]!` | No       | The array containing the modeled metric rows |
| `pageInfo` | `PageInfo!`            | No       | Pagination info for the query                |

Used by: [`modeledMetrics`](https://docs.prescientai.com/api/queries/modeled-metrics).

### ModeledMetricRow

| Field                  | Type               | Nullable | Description                                                                                            |
| ---------------------- | ------------------ | -------- | ------------------------------------------------------------------------------------------------------ |
| `metricName`           | `MetricName!`      | No       | The type of the metric                                                                                 |
| `metricValue`          | `Float!`           | No       | The value of the metric                                                                                |
| `processDate`          | `ISO8601DateTime!` | No       | The date the metric was created or last updated                                                        |
| `reportedDate`         | `String!`          | No       | The date the metric corresponds to. This is a date string in the format of YYYY-MM-DD                  |
| `sourceCampaignId`     | `String!`          | No       | The ID for the campaign                                                                                |
| `sourceCampaignName`   | `String`           | Yes      | The name of the campaign                                                                               |
| `sourceCampaignTactic` | `String`           | Yes      | The tactic the campaign is labeled with in the Data Center, if any                                     |
| `sourceChannelName`    | `String!`          | No       | The data source channel of the campaign                                                                |
| `target`               | `String!`          | No       | The name of the model that produced this metric                                                        |
| `targetChannelName`    | `String`           | Yes      | The channel that the modeling attributes credit for this metric. Only applies to second order metrics. |

Used by: [`ModeledMetricQuery`](https://docs.prescientai.com/api/types#modeledmetricquery).

### PageInfo

| Field         | Type      | Nullable | Description                                   |
| ------------- | --------- | -------- | --------------------------------------------- |
| `endCursor`   | `String`  | Yes      | The cursor for the next page, if there is one |
| `hasNextPage` | `Boolean` | Yes      | Whether a next page exists or not             |

Used by: [`ModeledMetricQuery`](https://docs.prescientai.com/api/types#modeledmetricquery), [`ReportedMetricQuery`](https://docs.prescientai.com/api/types#reportedmetricquery).

### ReportedMetricQuery

| Field      | Type                    | Nullable | Description                                   |
| ---------- | ----------------------- | -------- | --------------------------------------------- |
| `data`     | `[ReportedMetricRow!]!` | No       | The array containing the reported metric rows |
| `pageInfo` | `PageInfo!`             | No       | Pagination info for the query                 |

Used by: [`reportedMetrics`](https://docs.prescientai.com/api/queries/reported-metrics).

### ReportedMetricRow

| Field          | Type           | Nullable | Description                                     |
| -------------- | -------------- | -------- | ----------------------------------------------- |
| `campaignId`   | `String!`      | No       | The ID for the campaign                         |
| `campaignName` | `String`       | Yes      | The name of the campaign                        |
| `channelName`  | `String!`      | No       | The data source channel of the campaign         |
| `processDate`  | `ISO8601Date!` | No       | The date the metric was created or last updated |
| `reportedDate` | `ISO8601Date!` | No       | The date the metric corresponds to              |
| `spend`        | `Float!`       | No       | The spend amount for the campaign on this date  |

Used by: [`ReportedMetricQuery`](https://docs.prescientai.com/api/types#reportedmetricquery).

## Enums

An enum is a fixed list of values. Write a value without quotation marks in a query, and as a string in the variables.

### MetricName

| Value                        | Description                                                                                      |
| ---------------------------- | ------------------------------------------------------------------------------------------------ |
| `FIRST_ORDER_CONVERSIONS`    | New Customers attributed to direct conversions from the campaign, such as last click attribution |
| `FIRST_ORDER_LEADS`          | Leads attributed to direct conversions from the campaign, such as last click attribution         |
| `FIRST_ORDER_REVENUE`        | Revenue attributed to direct conversions from the campaign, such as last click attribution       |
| `FIRST_ORDER_SUBSCRIPTIONS`  | Subscriptions attributed to direct conversions from the campaign, such as last click attribution |
| `SECOND_ORDER_CONVERSIONS`   | New Customers attributed to halo effects from the campaign                                       |
| `SECOND_ORDER_LEADS`         | Leads attributed to halo effects from the campaign                                               |
| `SECOND_ORDER_REVENUE`       | Revenue attributed to halo effects from the campaign                                             |
| `SECOND_ORDER_SUBSCRIPTIONS` | Subscriptions attributed to halo effects from the campaign                                       |

Used by: [`ModeledMetricRow`](https://docs.prescientai.com/api/types#modeledmetricrow).

### MetricUnit

| Value           | Description                                |
| --------------- | ------------------------------------------ |
| `CUSTOMERS`     | The metrics are measured in new customers  |
| `REVENUE`       | The metrics are measured by revenue in USD |
| `SUBSCRIPTIONS` | The metrics are measured in subscriptions  |

Used by: [`Model`](https://docs.prescientai.com/api/types#model).

### SalesChannelEnum

Sales channel for filtering modeled metrics output

| Value       | Description |
| ----------- | ----------- |
| `ECOMMERCE` |             |
| `RETAIL`    |             |

Used by: [`modeledMetrics`](https://docs.prescientai.com/api/queries/modeled-metrics).

## Scalars

A scalar is one value, for example a date or a number.

### BigInt

Represents non-fractional signed whole numeric values. Since the value may exceed the size of a 32-bit integer, it's encoded as a string.

Used by: [`modeledMetrics`](https://docs.prescientai.com/api/queries/modeled-metrics), [`reportedMetrics`](https://docs.prescientai.com/api/queries/reported-metrics).

### Boolean

The `Boolean` scalar type represents `true` or `false`.

Used by: [`PageInfo`](https://docs.prescientai.com/api/types#pageinfo).

### Float

The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point).

Used by: [`ModeledMetricRow`](https://docs.prescientai.com/api/types#modeledmetricrow), [`ReportedMetricRow`](https://docs.prescientai.com/api/types#reportedmetricrow).

### ISO8601Date

An ISO 8601-encoded date

Used by: [`modeledMetrics`](https://docs.prescientai.com/api/queries/modeled-metrics), [`reportedMetrics`](https://docs.prescientai.com/api/queries/reported-metrics), [`ReportedMetricRow`](https://docs.prescientai.com/api/types#reportedmetricrow).

### ISO8601DateTime

An ISO 8601-encoded datetime

Used by: [`ModeledMetricRow`](https://docs.prescientai.com/api/types#modeledmetricrow).

### String

The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.

Used by: [`channelNames`](https://docs.prescientai.com/api/queries/channel-names), [`modeledMetrics`](https://docs.prescientai.com/api/queries/modeled-metrics), [`reportedMetrics`](https://docs.prescientai.com/api/queries/reported-metrics), [`Model`](https://docs.prescientai.com/api/types#model), [`ModeledMetricRow`](https://docs.prescientai.com/api/types#modeledmetricrow), [`PageInfo`](https://docs.prescientai.com/api/types#pageinfo), [`ReportedMetricRow`](https://docs.prescientai.com/api/types#reportedmetricrow).
