### Query Connections with Arguments - GraphQL Source: https://connect.greyfinch.com/api-reference/operations/apps/queries/connections Demonstrates how to query the 'connections' endpoint with various arguments such as distinctOn, limit, offset, orderBy, and where. This example assumes a GraphQL schema where ConnectionSelectColumn, ConnectionOrderBy, and ConnectionBoolExp are defined types. ```graphql query GetConnections( $distinctOn: [ConnectionSelectColumn!] $limit: Int $offset: Int $orderBy: [ConnectionOrderBy!] $where: ConnectionBoolExp ) { connections( distinctOn: $distinctOn limit: $limit offset: $offset orderBy: $orderBy where: $where ) { # Specify fields from the Connection type you want to retrieve id name status # ... other fields } } ``` -------------------------------- ### OutboundNumberStreamCursorInput Fields Explanation Source: https://connect.greyfinch.com/api-reference/types/miscellaneous/inputs/outbound-number-stream-cursor-input Explains the fields within the OutboundNumberStreamCursorInput. 'initialValue' is mandatory for specifying the starting point of the stream, and 'ordering' allows for custom cursor ordering. ```plaintext #### `OutboundNumberStreamCursorInput.**initialValue**`●`**OutboundNumberStreamCursorValueInput!**`​ Stream column input with initial value #### `OutboundNumberStreamCursorInput.**ordering**`●`**CursorOrdering**`​ cursor ordering ``` -------------------------------- ### AppStreamCursorValueInput Schema Source: https://connect.greyfinch.com/api-reference/types/miscellaneous/inputs/app-stream-cursor-value-input Defines the structure for AppStreamCursorValueInput, used to specify the starting point for data streaming. ```APIDOC ## AppStreamCursorValueInput Schema ### Description Represents the initial value of a column from where streaming should start. ### Fields #### `createdAt` (timestamptz) - Required - The timestamp when the record was created. #### `id` (uuid) - Required - The unique identifier for the record. #### `metadata` (jsonb) - Optional - Additional metadata associated with the record. #### `name` (String) - Required - The name associated with the cursor value. #### `status` (AppsAppStatusesEnum) - Required - The status of the application associated with the cursor value. #### `updatedAt` (timestamptz) - Required - The timestamp when the record was last updated. ### Member Of `AppStreamCursorInput` input ``` -------------------------------- ### Subscription Root - leadConfigurations Source: https://connect.greyfinch.com/api-reference/types/miscellaneous/objects/subscription-root Fetches lead configurations with optional filtering and sorting. ```APIDOC ## GET /subscription_root/leadConfigurations ### Description Fetches lead configurations with optional filtering and sorting. ### Method GET ### Endpoint `/subscription_root/leadConfigurations` ### Parameters #### Query Parameters - **distinctOn** ([LeadConfigurationSelectColumn!]) - Optional - Distinct select on columns. - **limit** (Int) - Optional - Limit the number of rows returned. - **offset** (Int) - Optional - Skip the first n rows. Use only with order_by. - **orderBy** ([LeadConfigurationOrderBy!]) - Optional - Sort the rows by one or more columns. - **where** (LeadConfigurationBoolExp) - Optional - Filter the rows returned. ### Response #### Success Response (200) - **[LeadConfiguration!]!** (array) - A list of LeadConfiguration objects. #### Response Example { "data": { "leadConfigurations": [ { "id": "a1b2c3d4-e5f6-7890-1234-567890abcdef" } ] } } ``` -------------------------------- ### Subscription Root - LeadConfigurationByPk Source: https://connect.greyfinch.com/api-reference/types/miscellaneous/objects/subscription-root Retrieves a single LeadConfiguration by its primary key. ```APIDOC ## GET /subscription_root/LeadConfigurationByPk ### Description Retrieves a single LeadConfiguration by its primary key. ### Method GET ### Endpoint `/subscription_root/LeadConfigurationByPk(id: uuid!)` ### Parameters #### Path Parameters - **id** (uuid!) - Required - The unique identifier of the LeadConfiguration. ### Response #### Success Response (200) - **LeadConfiguration** (object) - The LeadConfiguration object if found. #### Response Example { "data": { "LeadConfigurationByPk": { "id": "a1b2c3d4-e5f6-7890-1234-567890abcdef" } } } ``` -------------------------------- ### Treatment Object Source: https://connect.greyfinch.com/api-reference/types/miscellaneous/objects/treatment Represents a patient's treatment within an organization. Treatments are defined by start and end dates and are associated with a treatment plan. ```APIDOC ## Treatment Object ### Description A patient's treatments in an organisation. A treatment is defined by a start and end date, and will be assigned to a treatment plan based on the patient's needs. Patients may undergo multiple treatments in the same clinic. ### Fields #### `appointments` - **Type**: `[Appointment!]!` - **Description**: An array relationship to associated appointments. Supports filtering, sorting, limiting, and distinct selection. - `distinctOn`: `[AppointmentSelectColumn!]` - Distinct select on columns. - `limit`: `Int` - Limit the number of rows returned. - `offset`: `Int` - Skip the first n rows. Use only with `order_by`. - `orderBy`: `[AppointmentOrderBy!]` - Sort the rows by one or more columns. - `where`: `AppointmentBoolExp` - Filter the rows returned. #### `colors` - **Type**: `String` - **Description**: Color associated with the treatment. #### `createdAt` - **Type**: `timestamp` - **Description**: Timestamp of when the treatment was created. #### `didNotStart` - **Type**: `Boolean!` - **Description**: Flag indicating if the treatment did not start. #### `endDate` - **Type**: `date` - **Description**: The end date of the treatment. #### `estimatedEndDate` - **Type**: `date` - **Description**: The estimated end date of the treatment. #### `estimatedStartDate` - **Type**: `date` - **Description**: The estimated start date of the treatment. #### `id` - **Type**: `uuid!` - **Description**: Unique identifier for the treatment. #### `imageSeries` - **Type**: `[ImageSeries!]!` - **Description**: An array relationship to associated image series. Supports filtering, sorting, limiting, and distinct selection. - `distinctOn`: `[ImageSeriesSelectColumn!]` - Distinct select on columns. - `limit`: `Int` - Limit the number of rows returned. - `offset`: `Int` - Skip the first n rows. Use only with `order_by`. - `orderBy`: `[ImageSeriesOrderBy!]` - Sort the rows by one or more columns. - `where`: `ImageSeriesBoolExp` - Filter the rows returned. #### `migrated` - **Type**: `Boolean!` - **Description**: Flag indicating if the treatment has been migrated. #### `notes` - **Type**: `String!` - **Description**: Notes related to the treatment. #### `patient` - **Type**: `Patient` - **Description**: An object relationship to the patient undergoing the treatment. #### `startDate` - **Type**: `date` - **Description**: The start date of the treatment. #### `name` - **Type**: `String!` - **Description**: The name of the treatment. This is a computed field that executes the function `treatments.tx_card_name`. #### `status` - **Type**: `TreatmentStatus!` - **Description**: An object relationship to the status of the treatment. #### `updatedAt` - **Type**: `timestamp` - **Description**: Timestamp of when the treatment was last updated. ### Returned By `treatments` query ### Member Of `Appointment` object ● `ImageSeries` object ● `Patient` object ● `PatientAction` object ``` -------------------------------- ### Lead Configuration Stream Source: https://connect.greyfinch.com/api-reference/types/miscellaneous/objects/subscription-root Fetches lead configuration data in a streaming manner, allowing for batching and cursor-based pagination. ```APIDOC ## POST /leadConfigurations/stream ### Description Fetches data from the 'leads.configurations' table in a streaming manner. ### Method POST ### Endpoint /leadConfigurations/stream ### Parameters #### Request Body - **batchSize** (Int!) - Required - Maximum number of rows returned in a single batch. - **cursor** ([LeadConfigurationStreamCursorInput]!) - Required - Cursor to stream the results. - **where** (LeadConfigurationBoolExp) - Optional - Filters the rows returned. ``` -------------------------------- ### GET /companies Source: https://connect.greyfinch.com/api-reference/operations/organization/queries/companies Retrieves a list of companies. Supports filtering by various criteria, including distinct selections, limits, offsets, ordering, and complex boolean expressions. ```APIDOC ## GET /companies ### Description Returns a list of companies filtered by some criteria. Supports distinct selection, limiting, offsetting, ordering, and filtering with boolean expressions. ### Method GET ### Endpoint /companies ### Parameters #### Query Parameters - **distinctOn** ([CompanySelectColumn!]) - Optional - Distinct select on columns - **limit** (Int) - Optional - Limit the number of rows returned - **offset** (Int) - Optional - Skip the first n rows. Use only with order_by - **orderBy** ([CompanyOrderBy!]) - Optional - Sort the rows by one or more columns - **where** (CompanyBoolExp) - Optional - Filter the rows returned ### Response #### Success Response (200) - **Company** ([Company!]!) - A list of Company objects. #### Response Example ```json [ { "id": "string", "name": "string", "createdAt": "string", "updatedAt": "string" // ... other company fields } ] ``` #### Type Definitions `CompanySelectColumn`: Represents columns that can be used for distinct selection. `CompanyOrderBy`: Represents columns that can be used for ordering. `CompanyBoolExp`: Represents a boolean expression for filtering companies. `Company`: Represents a company object with fields like id, name, createdAt, and updatedAt. ``` -------------------------------- ### Subscription Root - AppByPk Source: https://connect.greyfinch.com/api-reference/types/miscellaneous/objects/subscription-root Retrieves a single App by its primary key. ```APIDOC ## GET /subscription_root/AppByPk ### Description Retrieves a single App by its primary key. ### Method GET ### Endpoint `/subscription_root/AppByPk(id: uuid!)` ### Parameters #### Path Parameters - **id** (uuid!) - Required - The unique identifier of the App. ### Response #### Success Response (200) - **App** (object) - The App object if found. #### Response Example { "data": { "AppByPk": { "id": "a1b2c3d4-e5f6-7890-1234-567890abcdef" } } } ``` -------------------------------- ### OutboundNumberStreamCursorValueInput Source: https://connect.greyfinch.com/api-reference/types/miscellaneous/inputs/outbound-number-stream-cursor-value-input This input type specifies the initial value for a stream cursor. It allows for filtering and defining the starting point for streaming data based on various attributes of outbound numbers. ```APIDOC ## OutboundNumberStreamCursorValueInput ### Description Initial value of the column from where the streaming should start. ### Type Definition ```graphql input OutboundNumberStreamCursorValueInput { active: Boolean callForwardingNumber: String createdAt: timestamptz id: uuid name: String number: String updatedAt: timestamptz xid: String } ``` ### Fields #### `active` - **Type**: `Boolean` - **Description**: Specifies if the outbound number is active. #### `callForwardingNumber` - **Type**: `String` - **Description**: The call forwarding number associated with the outbound number. #### `createdAt` - **Type**: `timestamptz` - **Description**: The timestamp when the outbound number record was created. #### `id` - **Type**: `uuid` - **Description**: The unique identifier for the outbound number. #### `name` - **Type**: `String` - **Description**: The name associated with the outbound number. #### `number` - **Type**: `String` - **Description**: The outbound phone number. #### `updatedAt` - **Type**: `timestamptz` - **Description**: The timestamp when the outbound number record was last updated. #### `xid` - **Type**: `String` - **Description**: An external identifier for the outbound number. ### Member Of `OutboundNumberStreamCursorInput` input ``` -------------------------------- ### Lead Configuration by Primary Key Source: https://connect.greyfinch.com/api-reference/types/miscellaneous/objects/subscription-root Retrieves a single lead configuration by its unique identifier. ```APIDOC ## GET /leadConfigurations/{id} ### Description Fetches a single lead configuration by its primary key. ### Method GET ### Endpoint /leadConfigurations/{id} ### Parameters #### Path Parameters - **id** (uuid!) - Required - The unique identifier of the lead configuration. ``` -------------------------------- ### Subscription Root - LeadConfigurationStream Source: https://connect.greyfinch.com/api-reference/types/miscellaneous/objects/subscription-root Fetches data from the lead configurations table in a streaming manner. ```APIDOC ## POST /subscription_root/LeadConfigurationStream ### Description Fetches data from the lead configurations table in a streaming manner. ### Method POST ### Endpoint `/subscription_root/LeadConfigurationStream` ### Parameters #### Request Body - **batchSize** (Int!) - Required - Maximum number of rows returned in a single batch. - **cursor** ([LeadConfigurationStreamCursorInput]!) - Required - Cursor to stream the results returned by the query. - **where** (LeadConfigurationBoolExp) - Optional - Filter the rows returned. ### Request Example ```json { "batchSize": 100, "cursor": [{"field": "value"}], "where": {} } ``` ### Response #### Success Response (200) - **[LeadConfiguration!]!** (array) - A list of LeadConfiguration objects. #### Response Example { "data": { "LeadConfigurationStream": [ { "id": "a1b2c3d4-e5f6-7890-1234-567890abcdef" } ] } } ``` -------------------------------- ### Unstable Get App Connection Access Token Source: https://connect.greyfinch.com/api-reference/operations/apps/mutations/unstable-get-app-connection-access-token Retrieves the connection access token and its expiry for a given resource, refreshing it if needed. This API is currently unstable and subject to deprecation. ```APIDOC ## unstableGetAppConnectionAccessToken ### Description Returns the connection access token and expiry associated with a resource, refreshing it if necessary. Note: unstable, this will be deprecated when finalised. ### Method POST ### Endpoint /websites/connect_greyfinch_api-reference/unstableGetAppConnectionAccessToken ### Parameters #### Query Parameters - **name** (String) - Optional - The name associated with the access token request. - **resourceId** (String!) - Required - The ID of the resource for which to get the access token. - **resourceType** (AppConnectionAccessTokenResourceTypeEnum!) - Required - The type of the resource. ### Request Body ```json { "name": "example_name", "resourceId": "example_resource_id", "resourceType": "example_resource_type" } ``` ### Response #### Success Response (200) - **accessToken** (String) - The connection access token. - **expiresAt** (String) - The expiry timestamp of the access token. #### Response Example ```json { "accessToken": "example_access_token", "expiresAt": "2023-10-27T10:00:00Z" } ``` ``` -------------------------------- ### GraphQL Query for Patient Appointments Source: https://connect.greyfinch.com/api-reference/types/miscellaneous/objects/patient Example of how to query appointments for a specific patient using the Greyfinch API. This demonstrates filtering, ordering, and limiting the results for the related 'appointments' field. ```graphql query GetPatientAppointments($patientId: uuid!, $limit: Int, $orderBy: [AppointmentOrderBy!]) { patient(where: { id: { _eq: $patientId } }) { appointments(limit: $limit, orderBy: $orderBy) { id createdAt // Add other fields you need from the Appointment type } } } ``` -------------------------------- ### Fetch Lead Configurations Data Source: https://connect.greyfinch.com/api-reference/operations/lead/queries/lead-configurations Retrieves configurations from the 'leads.configurations' table. Supports distinct selections, limiting, offsetting, ordering, and filtering based on specified criteria. The `distinctOn` argument requires a list of `LeadConfigurationSelectColumn` values, `limit` and `offset` are integers for pagination, `orderBy` requires a list of `LeadConfigurationOrderBy` values for sorting, and `where` takes a `LeadConfigurationBoolExp` object for filtering. ```graphql query GetLeadConfigurations( $distinctOn: [LeadConfigurationSelectColumn!] $limit: Int $offset: Int $orderBy: [LeadConfigurationOrderBy!] $where: LeadConfigurationBoolExp ) { leadConfigurations( distinctOn: $distinctOn limit: $limit offset: $offset orderBy: $orderBy where: $where ) { # Select the fields you need from LeadConfiguration } } ``` -------------------------------- ### GraphQL Query for Patient Documents Source: https://connect.greyfinch.com/api-reference/types/miscellaneous/objects/patient Example of how to retrieve documents associated with a patient via the Greyfinch API. This shows how to use arguments like 'where' and 'orderBy' to refine the document query. ```graphql query GetPatientDocuments($patientId: uuid!, $documentType: String) { patient(where: { id: { _eq: $patientId } }) { documents(where: { type: { _eq: $documentType } }) { id name url createdAt } } } ``` -------------------------------- ### Subscription Root - apps Source: https://connect.greyfinch.com/api-reference/types/miscellaneous/objects/subscription-root Fetches data from the 'apps.apps' table. ```APIDOC ## GET /subscription_root/apps ### Description Fetches data from the 'apps.apps' table. ### Method GET ### Endpoint `/subscription_root/apps` ### Parameters #### Query Parameters - **distinctOn** ([AppSelectColumn!]) - Optional - Distinct select on columns. - **limit** (Int) - Optional - Limit the number of rows returned. - **offset** (Int) - Optional - Skip the first n rows. Use only with order_by. - **orderBy** ([AppOrderBy!]) - Optional - Sort the rows by one or more columns. - **where** (AppBoolExp) - Optional - Filter the rows returned. ### Response #### Success Response (200) - **[App!]!** (array) - A list of App objects. #### Response Example { "data": { "apps": [ { "id": "a1b2c3d4-e5f6-7890-1234-567890abcdef" } ] } } ``` -------------------------------- ### Subscription Root - AppCompanyByPk Source: https://connect.greyfinch.com/api-reference/types/miscellaneous/objects/subscription-root Retrieves a single AppCompany by its primary key. ```APIDOC ## GET /subscription_root/AppCompanyByPk ### Description Retrieves a single AppCompany by its primary key. ### Method GET ### Endpoint `/subscription_root/AppCompanyByPk(id: uuid!)` ### Parameters #### Path Parameters - **id** (uuid!) - Required - The unique identifier of the AppCompany. ### Response #### Success Response (200) - **AppCompany** (object) - The AppCompany object if found. #### Response Example { "data": { "AppCompanyByPk": { "id": "a1b2c3d4-e5f6-7890-1234-567890abcdef" } } } ``` -------------------------------- ### AppCompanyStreamCursorValueInput GraphQL Schema Source: https://connect.greyfinch.com/api-reference/types/miscellaneous/inputs/app-company-stream-cursor-value-input Defines the structure of the AppCompanyStreamCursorValueInput, used to specify the starting point for data streaming. It includes fields for creation timestamp, unique identifier, metadata, status, update timestamp, and an external identifier. ```graphql input AppCompanyStreamCursorValueInput { createdAt: timestamptz id: uuid metadata: jsonb status: AppsAppCompanyStatusEnum updatedAt: timestamptz xid: String } ``` -------------------------------- ### Lead Configurations API Source: https://connect.greyfinch.com/api-reference/operations/lead/queries/lead-configurations Fetches lead configurations from the 'leads.configurations' table with options for distinct selection, limiting, offsetting, ordering, and filtering. ```APIDOC ## Lead Configurations ### Description Fetches lead configurations from the `leads.configurations` table with advanced querying capabilities. ### Method GET ### Endpoint /websites/connect_greyfinch_api-reference/leadConfigurations ### Parameters #### Query Parameters - **distinctOn** ([LeadConfigurationSelectColumn!]) - Optional - Specifies the columns to return distinct values from. - **limit** (Int) - Optional - Limits the number of rows returned. - **offset** (Int) - Optional - Skips the first n rows. Use only with `orderBy`. - **orderBy** ([LeadConfigurationOrderBy!]) - Optional - Sorts the rows by one or more columns. - **where** (LeadConfigurationBoolExp) - Optional - Filters the rows returned based on specified criteria. ### Response #### Success Response (200) - **LeadConfiguration** ([LeadConfiguration!]!) - An array of LeadConfiguration objects, each representing a lead configuration with its columns and relationships. ``` -------------------------------- ### Lead Configurations API Source: https://connect.greyfinch.com/api-reference/types/miscellaneous/objects/subscription-root Endpoints for querying and filtering lead configurations. Supports distinct selections, limiting, offsetting, ordering, and filtering. ```APIDOC ## GET /leadConfigurations ### Description Fetches a list of lead configurations with options for distinct selection, limiting, offsetting, ordering, and filtering. ### Method GET ### Endpoint /leadConfigurations ### Parameters #### Query Parameters - **distinctOn** ([LeadConfigurationSelectColumn!]) - Optional - Specifies columns to return distinct values from. - **limit** (Int) - Optional - Limits the number of rows returned. - **offset** (Int) - Optional - Skips the first n rows. Use only with order_by. - **orderBy** ([LeadConfigurationOrderBy!]) - Optional - Sorts the rows by one or more columns. - **where** (LeadConfigurationBoolExp) - Optional - Filters the rows returned. ``` -------------------------------- ### Define LeadConfigurationStreamCursorValueInput Type Source: https://connect.greyfinch.com/api-reference/types/miscellaneous/inputs/lead-configuration-stream-cursor-value-input This GraphQL schema defines the LeadConfigurationStreamCursorValueInput type. It includes fields for activation status, creation and update timestamps, metadata, and a unique identifier. This input is used to set the starting point for streaming data. ```graphql input LeadConfigurationStreamCursorValueInput { active: Boolean createdAt: timestamptz id: uuid metadata: jsonb name: String updatedAt: timestamptz } ``` -------------------------------- ### Get App Connection Access Token (Greyfinch API) Source: https://connect.greyfinch.com/api-reference/operations/apps/mutations/unstable-get-app-connection-access-token Retrieves the connection access token and its expiry for a given resource. The token is refreshed if it is necessary. This function is currently unstable and may be deprecated in the future. It requires the resource name, resource ID, and resource type as input. ```javascript unstableGetAppConnectionAccessToken( name: String resourceId: String! resourceType: AppConnectionAccessTokenResourceTypeEnum! ): getAppConnectionAccessTokenResponse ``` -------------------------------- ### insertLeadConfigurationRenamedToUseInInsertOne Source: https://connect.greyfinch.com/api-reference/operations/miscellaneous/mutations/insert-lead-configuration-renamed-to-use-in-insert-one Inserts lead configuration data into the system. It supports inserting multiple configurations and handling conflicts. ```APIDOC ## POST /websites/connect_greyfinch_api-reference ### Description Inserts lead configuration data. Allows for batch insertion and conflict resolution. ### Method POST ### Endpoint /websites/connect_greyfinch_api-reference ### Parameters #### Query Parameters - **objects** (array of LeadConfigurationInsertInput) - Required - The rows to be inserted. - **onConflict** (LeadConfigurationOnConflict) - Optional - Upsert condition. ### Request Body ```json { "objects": [ { "field1": "value1", "field2": "value2" } ], "onConflict": { "constraint": "unique_constraint_name" } } ``` ### Response #### Success Response (200) - **data** (LeadConfigurationMutationResponse) - The response of the mutation. #### Response Example ```json { "data": { "insertLeadConfigurationRenamedToUseInInsertOne": { "affected_rows": 1 } } } ``` ``` -------------------------------- ### TreatmentOrderBy Input Source: https://connect.greyfinch.com/api-reference/types/miscellaneous/inputs/treatment-order-by This input type allows specifying the order for various fields when querying treatments. It supports sorting by appointment aggregates, colors, dates, IDs, image series aggregates, migration status, notes, patient information, start and end dates, name, status, and update times. ```APIDOC ## TreatmentOrderBy Input ### Description This input type allows specifying the order for various fields when querying treatments. It supports sorting by appointment aggregates, colors, dates, IDs, image series aggregates, migration status, notes, patient information, start and end dates, name, status, and update times. ### Fields #### `appointmentsAggregate` (AppointmentAggregateOrderBy) - Specifies the sorting order for appointment aggregates. #### `colors` (OrderBy) - Specifies the sorting order for colors. #### `createdAt` (OrderBy) - Specifies the sorting order for the creation timestamp. #### `didNotStart` (OrderBy) - Specifies the sorting order for treatments that did not start. #### `endDate` (OrderBy) - Specifies the sorting order for the end date. #### `estimatedEndDate` (OrderBy) - Specifies the sorting order for the estimated end date. #### `estimatedStartDate` (OrderBy) - Specifies the sorting order for the estimated start date. #### `id` (OrderBy) - Specifies the sorting order for the treatment ID. #### `imageSeriesAggregate` (ImageSeriesAggregateOrderBy) - Specifies the sorting order for image series aggregates. #### `migrated` (OrderBy) - Specifies the sorting order for the migrated status. #### `notes` (OrderBy) - Specifies the sorting order for notes. #### `patient` (PatientOrderBy) - Specifies the sorting order for patient information. #### `startDate` (OrderBy) - Specifies the sorting order for the start date. #### `name` (OrderBy) - Specifies the sorting order for the treatment name. #### `status` (TreatmentStatusOrderBy) - Specifies the sorting order for the treatment status. #### `updatedAt` (OrderBy) - Specifies the sorting order for the update timestamp. ### Member Of - `AppointmentOrderBy` input - `ImageSeriesOrderBy` input - `treatments` query ``` -------------------------------- ### Subscription Root - appCompanies Source: https://connect.greyfinch.com/api-reference/types/miscellaneous/objects/subscription-root Fetches data from the 'apps.app_companies' table. ```APIDOC ## GET /subscription_root/appCompanies ### Description Fetches data from the 'apps.app_companies' table. ### Method GET ### Endpoint `/subscription_root/appCompanies` ### Parameters #### Query Parameters - **distinctOn** ([AppCompanySelectColumn!]) - Optional - Distinct select on columns. - **limit** (Int) - Optional - Limit the number of rows returned. - **offset** (Int) - Optional - Skip the first n rows. Use only with order_by. - **orderBy** ([AppCompanyOrderBy!]) - Optional - Sort the rows by one or more columns. - **where** (AppCompanyBoolExp) - Optional - Filter the rows returned. ### Response #### Success Response (200) - **[AppCompany!]!** (array) - A list of AppCompany objects. #### Response Example { "data": { "appCompanies": [ { "id": "a1b2c3d4-e5f6-7890-1234-567890abcdef" } ] } } ``` -------------------------------- ### Define AppsAuditLogsTypesEnum Source: https://connect.greyfinch.com/api-reference/types/miscellaneous/enums/apps-audit-logs-types-enum This code snippet defines the AppsAuditLogsTypesEnum, an enumeration used to represent different types of audit log events related to applications within the Greyfinch system. It covers actions such as API calls, app enable/disable, sync processes, automation, connection events, key generation, installations, and webhook actions. ```typescript enum AppsAuditLogsTypesEnum { API APP_DISABLE APP_ENABLE APP_SYNC_MATCHING_END APP_SYNC_MATCHING_START APP_SYNC_PROCESSING_END APP_SYNC_PROCESSING_START AUTOMATION_ACTION_END AUTOMATION_ACTION_START AUTOMATION_END AUTOMATION_SETUP AUTOMATION_START CONNECTION_CONNECT CONNECTION_DISCONNECT CONNECTION_REFRESH_TOKEN GENERATE_API_KEY_APP GENERATE_API_KEY_APP_ACCESS GENERATE_API_KEY_CLIENT INSTALL LAUNCHER_END LAUNCHER_START WEBHOOK_ACTION WEBHOOK_END WEBHOOK_START } ``` -------------------------------- ### TreatmentMaxOrderBy Input Type Definition (GraphQL) Source: https://connect.greyfinch.com/api-reference/types/miscellaneous/inputs/treatment-max-order-by Defines the `TreatmentMaxOrderBy` input type in GraphQL. This input type is used to specify the sorting order for treatment-related queries. It includes fields for ordering by colors, creation date, end dates, start dates, ID, notes, and update timestamps. The `OrderBy` type is expected to be an enum defining ASC (ascending) and DESC (descending) order. ```graphql input TreatmentMaxOrderBy { colors: OrderBy createdAt: OrderBy endDate: OrderBy estimatedEndDate: OrderBy estimatedStartDate: OrderBy id: OrderBy notes: OrderBy startDate: OrderBy updatedAt: OrderBy } ``` -------------------------------- ### Query AppCompany by Primary Key Source: https://connect.greyfinch.com/api-reference/types/miscellaneous/objects/subscription-root Retrieves a single 'AppCompany' record by its primary key 'id'. The 'id' must be a UUID and is a required argument. ```graphql query AppCompanyByPk($id: uuid!) { subscription_root { AppCompanyByPk(id: $id) } } ``` -------------------------------- ### Insert Lead Configuration (GraphQL) Source: https://connect.greyfinch.com/api-reference/operations/lead/mutations/insert-lead-configuration This snippet demonstrates how to use the insertLeadConfiguration mutation in GraphQL. It requires a LeadConfigurationInsertInput object and optionally accepts an onConflict argument for upsert behavior. The mutation returns the inserted LeadConfiguration object. ```graphql mutation InsertLeadConfig($object: LeadConfigurationInsertInput!, $onConflict: LeadConfigurationOnConflict) { insertLeadConfiguration(object: $object, onConflict: $onConflict) { # Specify fields to return from LeadConfiguration } } ``` -------------------------------- ### LeadConfigurationBoolExp Source: https://connect.greyfinch.com/api-reference/types/miscellaneous/inputs/lead-configuration-bool-exp Defines the structure for boolean expressions used to filter lead configurations. It supports logical operators like AND, NOT, and OR, and allows filtering based on specific fields such as active status, creation/update timestamps, ID, leads, and metadata. ```APIDOC ## LeadConfigurationBoolExp ### Description A boolean expression to filter rows from the table "leads.configurations". All fields are combined with a logical 'AND'. ### Input Type `LeadConfigurationBoolExp` ### Fields - **_and** (Array of `LeadConfigurationBoolExp`) - Logical AND operator. Combines multiple boolean expressions. - **_not** (`LeadConfigurationBoolExp`) - Logical NOT operator. Negates a boolean expression. - **_or** (Array of `LeadConfigurationBoolExp`) - Logical OR operator. Combines multiple boolean expressions. - **active** (`BooleanComparisonExp`) - Filter by the active status of the configuration. - **createdAt** (`TimestamptzComparisonExp`) - Filter by the creation timestamp. - **id** (`UuidComparisonExp`) - Filter by the unique identifier (UUID) of the configuration. - **leads** (`LeadBoolExp`) - Filter based on related lead information. - **metadata** (`JsonbComparisonExp`) - Filter based on JSONB metadata. - **name** (`StringComparisonExp`) - Filter by the name of the configuration. - **updatedAt** (`TimestamptzComparisonExp`) - Filter by the last update timestamp. ### Member Of - `LeadBoolExp` input - `LeadConfigurationBoolExp` input - `LeadConfigurationOnConflict` input - `leadConfigurations` query ``` -------------------------------- ### Query AppCompany Data with Filtering and Pagination Source: https://connect.greyfinch.com/api-reference/types/miscellaneous/objects/subscription-root Fetches 'app_companies' data from the 'apps.app_companies' table. Supports distinct selection, limiting results, offsetting, ordering, and filtering. ```graphql query AppCompanies($distinctOn: [AppCompanySelectColumn!], $limit: Int, $offset: Int, $orderBy: [AppCompanyOrderBy!], $where: AppCompanyBoolExp) { subscription_root { appCompanies(distinctOn: $distinctOn, limit: $limit, offset: $offset, orderBy: $orderBy, where: $where) } } ``` -------------------------------- ### Subscription Root - AppStream Source: https://connect.greyfinch.com/api-reference/types/miscellaneous/objects/subscription-root Fetches data from the 'apps.apps' table in a streaming manner. ```APIDOC ## POST /subscription_root/AppStream ### Description Fetches data from the 'apps.apps' table in a streaming manner. ### Method POST ### Endpoint `/subscription_root/AppStream` ### Parameters #### Request Body - **batchSize** (Int!) - Required - Maximum number of rows returned in a single batch. - **cursor** ([AppStreamCursorInput]!) - Required - Cursor to stream the results returned by the query. - **where** (AppBoolExp) - Optional - Filter the rows returned. ### Request Example ```json { "batchSize": 100, "cursor": [{"field": "value"}], "where": {} } ``` ### Response #### Success Response (200) - **[App!]!** (array) - A list of App objects. #### Response Example { "data": { "AppStream": [ { "id": "a1b2c3d4-e5f6-7890-1234-567890abcdef" } ] } } ``` -------------------------------- ### Query App Data with Filtering and Pagination Source: https://connect.greyfinch.com/api-reference/types/miscellaneous/objects/subscription-root Fetches 'apps' data from the 'apps.apps' table. Supports distinct selection, limiting results, offsetting, ordering, and filtering. ```graphql query Apps($distinctOn: [AppSelectColumn!], $limit: Int, $offset: Int, $orderBy: [AppOrderBy!], $where: AppBoolExp) { subscription_root { apps(distinctOn: $distinctOn, limit: $limit, offset: $offset, orderBy: $orderBy, where: $where) } } ``` -------------------------------- ### Query Leads Data - GraphQL Source: https://connect.greyfinch.com/api-reference/operations/lead/queries/leads This snippet demonstrates how to query lead data from the Greyfinch API using GraphQL. It shows how to use arguments like `distinctOn`, `limit`, `offset`, `orderBy`, and `where` to filter and paginate results. The `Lead` type represents a prospect collected from the leads app widget. ```graphql query GetLeads($limit: Int, $offset: Int, $orderBy: [LeadOrderBy!], $where: LeadBoolExp) { leads(limit: $limit, offset: $offset, orderBy: $orderBy, where: $where) { # Specify fields you want to retrieve, e.g.: id name email createdAt updatedAt } } ``` -------------------------------- ### Subscription Root - AppCompanyStream Source: https://connect.greyfinch.com/api-reference/types/miscellaneous/objects/subscription-root Fetches data from the 'apps.app_companies' table in a streaming manner. ```APIDOC ## POST /subscription_root/AppCompanyStream ### Description Fetches data from the 'apps.app_companies' table in a streaming manner. ### Method POST ### Endpoint `/subscription_root/AppCompanyStream` ### Parameters #### Request Body - **batchSize** (Int!) - Required - Maximum number of rows returned in a single batch. - **cursor** ([AppCompanyStreamCursorInput]!) - Required - Cursor to stream the results returned by the query. - **where** (AppCompanyBoolExp) - Optional - Filter the rows returned. ### Request Example ```json { "batchSize": 100, "cursor": [{"field": "value"}], "where": {} } ``` ### Response #### Success Response (200) - **[AppCompany!]!** (array) - A list of AppCompany objects. #### Response Example { "data": { "AppCompanyStream": [ { "id": "a1b2c3d4-e5f6-7890-1234-567890abcdef" } ] } } ``` -------------------------------- ### Query AppCompany Data via Streaming Source: https://connect.greyfinch.com/api-reference/types/miscellaneous/objects/subscription-root Fetches 'app_companies' data in a streaming manner from the 'apps.app_companies' table. Supports batching, cursors for pagination, and filtering via a boolean expression. ```graphql query AppCompanyStream($batchSize: Int!, $cursor: [AppCompanyStreamCursorInput]!, $where: AppCompanyBoolExp) { subscription_root { AppCompanyStream(batchSize: $batchSize, cursor: $cursor, where: $where) } } ``` -------------------------------- ### Lead Configuration Mutation Response Source: https://connect.greyfinch.com/api-reference/types/miscellaneous/objects/lead-configuration-mutation-response This documentation details the response structure for mutations performed on the 'leads.configurations' table. ```APIDOC ## LeadConfigurationMutationResponse ### Description This object represents the response received after performing any mutation (insert, update, delete) on the `leads.configurations` table. ### Method POST (typically for mutations) ### Endpoint /websites/connect_greyfinch_api-reference (example endpoint) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None (This is a response object) ### Request Example None (This is a response object) ### Response #### Success Response (200) - **affectedRows** (Int!) - The number of rows that were affected by the mutation. - **returning** ([LeadConfiguration!]!) - An array containing the data from the rows that were affected by the mutation. Each element in the array is of type `LeadConfiguration`. #### Response Example ```json { "affectedRows": 1, "returning": [ { "id": "some-uuid", "name": "Example Configuration", "value": "Example Value" } ] } ``` ### Returned By `insertLeadConfigurationRenamedToUseInInsertOne` mutation ``` -------------------------------- ### Query App Data via Streaming Source: https://connect.greyfinch.com/api-reference/types/miscellaneous/objects/subscription-root Fetches 'apps' data in a streaming manner from the 'apps.apps' table. Supports batching, cursors for pagination, and filtering via a boolean expression. ```graphql query AppStream($batchSize: Int!, $cursor: [AppStreamCursorInput]!, $where: AppBoolExp) { subscription_root { AppStream(batchSize: $batchSize, cursor: $cursor, where: $where) } } ``` -------------------------------- ### Fetch App Companies Data - GraphQL Source: https://connect.greyfinch.com/api-reference/operations/apps/queries/app-companies This GraphQL query fetches data from the 'apps.app_companies' table. It demonstrates how to use distinctOn, limit, offset, orderBy, and where arguments to refine the query results. Ensure the appropriate types like AppCompanySelectColumn, AppCompanyOrderBy, and AppCompanyBoolExp are defined in your schema. ```graphql query GetAppCompanies( $distinctOn: [AppCompanySelectColumn!] $limit: Int $offset: Int $orderBy: [AppCompanyOrderBy!] $where: AppCompanyBoolExp ) { appCompanies( distinctOn: $distinctOn limit: $limit offset: $offset orderBy: $orderBy where: $where ) { # Specify the fields you want to retrieve for each AppCompany id name # ... other fields } } ``` -------------------------------- ### Query App by Primary Key Source: https://connect.greyfinch.com/api-reference/types/miscellaneous/objects/subscription-root Retrieves a single 'App' record by its primary key 'id'. The 'id' must be a UUID and is a required argument. ```graphql query AppByPk($id: uuid!) { subscription_root { AppByPk(id: $id) } } ``` -------------------------------- ### Query Resources with Filtering and Sorting Source: https://connect.greyfinch.com/api-reference/operations/organization/queries/resources This GraphQL query demonstrates how to fetch resources with specific filtering, distinct selection, ordering, and limiting. It utilizes arguments like 'distinctOn', 'limit', 'offset', 'orderBy', and 'where' to refine the query results. The 'ResourceBoolExp' type is used for filtering, and 'ResourceSelectColumn' for distinct selections. ```graphql query GetResources( $distinctOn: [ResourceSelectColumn!], $limit: Int, $offset: Int, $orderBy: [ResourceOrderBy!], $where: ResourceBoolExp ) { resources( distinctOn: $distinctOn, limit: $limit, offset: $offset, orderBy: $orderBy, where: $where ) { # Specify the fields you want to retrieve from the Resource type id name # ... other fields } } ``` -------------------------------- ### Define AppCompanyOrderBy Input Type (GraphQL) Source: https://connect.greyfinch.com/api-reference/types/miscellaneous/inputs/app-company-order-by Defines the structure for ordering app company data. It includes fields for app, company, creation and update timestamps, ID, metadata, status, and external ID. This is a GraphQL schema definition. ```graphql input AppCompanyOrderBy { app: AppOrderBy company: CompanyOrderBy createdAt: OrderBy id: OrderBy metadata: OrderBy status: OrderBy updatedAt: OrderBy xid: OrderBy } ``` -------------------------------- ### insertLeadConfiguration Source: https://connect.greyfinch.com/api-reference/operations/lead/mutations/insert-lead-configuration Inserts a new lead configuration or updates an existing one based on conflict resolution. ```APIDOC ## POST /graphql ### Description Inserts a new lead configuration into the system. If a configuration with a conflicting unique key already exists, it can be updated based on the `onConflict` argument. ### Method POST ### Endpoint /graphql ### Parameters #### Request Body - **query** (string) - Required - The GraphQL query string. - **variables** (object) - Optional - Variables for the GraphQL query. - **object** (LeadConfigurationInsertInput!) - Required - The lead configuration object to insert. - **onConflict** (LeadConfigurationOnConflict) - Optional - Specifies how to handle conflicts during insertion (e.g., update). ### Request Example ```json { "query": "mutation ($object: LeadConfigurationInsertInput!, $onConflict: LeadConfigurationOnConflict) { insertLeadConfiguration(object: $object, onConflict: $onConflict) { ... } }", "variables": { "object": { "field1": "value1", "field2": 123 }, "onConflict": { "constraint": "unique_key_constraint" } } } ``` ### Response #### Success Response (200) - **data** (object) - The result of the operation. - **insertLeadConfiguration** (LeadConfiguration) - The inserted or updated lead configuration object. - **columns and relationships of \"leads.configurations\"** (object) - Details of the lead configuration. #### Response Example ```json { "data": { "insertLeadConfiguration": { "id": "config-123", "field1": "value1", "field2": 123 } } } ``` ``` -------------------------------- ### AppCompany Query Return Information Source: https://connect.greyfinch.com/api-reference/types/miscellaneous/objects/app-company Specifies which GraphQL queries return an AppCompany object. This includes the `appCompanies` query for a list of AppCompanies and `AppCompanyByPk` for a single AppCompany by its primary key. ```graphql ### Returned By​ `appCompanies` query ● `AppCompanyByPk` query ``` -------------------------------- ### Insert Lead Configuration (GraphQL) Source: https://connect.greyfinch.com/api-reference/operations/miscellaneous/mutations/insert-lead-configuration-renamed-to-use-in-insert-one This mutation allows for the insertion of multiple lead configuration objects into the Greyfinch API. It supports an optional onConflict argument for handling potential data conflicts. The response includes the status of the mutation operation. ```graphql insertLeadConfigurationRenamedToUseInInsertOne( objects: [LeadConfigurationInsertInput!]! onConflict: LeadConfigurationOnConflict ): LeadConfigurationMutationResponse ``` -------------------------------- ### Subscription Root - companies Source: https://connect.greyfinch.com/api-reference/types/miscellaneous/objects/subscription-root Returns a list of companies filtered by some criteria. ```APIDOC ## GET /subscription_root/companies ### Description Returns a list of companies filtered by some criteria. ### Method GET ### Endpoint `/subscription_root/companies` ### Parameters #### Query Parameters - **distinctOn** ([CompanySelectColumn!]) - Optional - Distinct select on columns. - **limit** (Int) - Optional - Limit the number of rows returned. - **offset** (Int) - Optional - Skip the first n rows. Use only with order_by. - **orderBy** ([CompanyOrderBy!]) - Optional - Sort the rows by one or more columns. - **where** (CompanyBoolExp) - Optional - Filter the rows returned. ### Response #### Success Response (200) - **[Company!]!** (array) - A list of Company objects. #### Response Example { "data": { "companies": [ { "id": "a1b2c3d4-e5f6-7890-1234-567890abcdef" } ] } } ``` -------------------------------- ### GraphQL Schema for LeadConfiguration Source: https://connect.greyfinch.com/api-reference/types/miscellaneous/objects/lead-configuration This snippet displays the GraphQL schema definition for the LeadConfiguration type. It specifies the fields available, their types (e.g., Boolean, timestamptz, uuid, String, jsonb), and indicates which fields are non-nullable (!). It also details the arguments available for the 'leads' relationship, such as distinctOn, limit, offset, orderBy, and where. ```graphql type LeadConfiguration { active: Boolean! createdAt: timestamptz! id: uuid! leads( distinctOn: [LeadSelectColumn!] limit: Int offset: Int orderBy: [LeadOrderBy!] where: LeadBoolExp ): [Lead!]! metadata( path: String ): jsonb! name: String! updatedAt: timestamptz! } ```