# Company Functional Area Intelligence

Returns Functional Area Intelligence (FAI) for a company. FAI predicts where detected
technologies are used at both a departmental and location-specific level within an organization.
Provide the company by `id` (hex-encoded) or `domain`. All filters are optional.

Endpoint: POST /data-api/v2/companies/functional-areas
Security: authorization

## Request fields (application/json):

  - `company` (object, required)
    Company identifier. Provide exactly one of `id` or `domain`.
    Example: {"domain":"microsoft.com"}

  - `company.domain` (string)
    Company domain (e.g. "microsoft.com")
    Example: microsoft.com

  - `company.id` (string)
    Hexadecimal identifier (unsigned 128-bit base 16 integer)
    Example: 1698C53EBC888758570396E0334965C1

  - `filters` (object)
    Optional filters to narrow FAI results.

  - `filters.country` (object)
    Filter by ISO 3166-1 alpha-2 country codes
    Example: {"codes":["US","CA"]}

  - `filters.country.codes` (array, required)
    Country codes

  - `filters.departments` (object)
    Filter by FAI department IDs (from /v2/catalog/fai_departments)
    Example: {"ids":["3570470BAD94692CE93E32700D2E1CB"]}

  - `filters.departments.ids` (array, required)
    Department IDs (hex-encoded)

  - `filters.has_decision_maker` (boolean)
    Filter to rows where a decision maker is present

  - `filters.has_influencer` (boolean)
    Filter to rows where an influencer is present

  - `filters.last_verified_date` (string)
    Only return rows where last_verified_at >= this date (ISO 8601)
    Example: 2024-01-01

  - `filters.products` (object)
    Filter by product IDs
    Example: {"ids":[814,805]}

  - `filters.products.ids` (array, required)
    Product IDs

  - `filters.roles` (object)
    Filter by FAI role IDs (from /v2/catalog/fai_departments)
    Example: {"ids":["38823D12CF303C0B30D1AA2E924BDE3"]}

  - `filters.roles.ids` (array, required)
    Role IDs (hex-encoded)

  - `filters.vendors` (object)
    Filter by vendor IDs
    Example: {"ids":[311,466]}

  - `filters.vendors.ids` (array, required)
    Vendor IDs

  - `limit` (integer)
    Maximum number of records to return

  - `offset` (integer)
    Number of records to skip

  - `sorts` (array)
    Sort order for results

  - `sorts.direction` (string, required)
    Sort direction
    Enum: "ASC", "DESC"

  - `sorts.field` (string, required)
    Field to sort by
    Enum: "department_usage_share", "department_signal_strength", "role_usage_share", "role_signal_strength_at_location", "product_name", "department_name", "role_name", "country_name"

## Response 200 fields (application/json):

  - `company` (object)
    Company information extracted from FAI data.

  - `company.domain` (string)
    Company domain

  - `company.id` (string)
    HG company ID (hex-encoded)
    Example: 1698C53EBC888758570396E0334965C1

  - `company.name` (string)
    Company name

  - `count` (integer, required)
    Total number of matching records (before pagination)

  - `data` (array, required)
    FAI data records

  - `data.city_name` (string)
    City name

  - `data.country_name` (string)
    Country name

  - `data.decision_maker_titles` (array)
    Titles of decision makers

  - `data.department_id` (string)
    Department ID (hex-encoded)

  - `data.department_name` (string)
    Department name

  - `data.department_signal_strength` (integer)
    Department signal strength

  - `data.department_usage_share` (number)
    Department usage share

  - `data.first_verified_at` (string)
    First verified date

  - `data.has_decision_maker` (boolean)
    Whether a decision maker is present

  - `data.has_influencer` (boolean)
    Whether an influencer is present

  - `data.influencer_titles` (array)
    Titles of influencers

  - `data.last_verified_at` (string)
    Last verified date

  - `data.product_id` (integer)
    Product ID

  - `data.product_name` (string)
    Product name

  - `data.role_id` (string)
    Role ID (hex-encoded)

  - `data.role_name` (string)
    Role name

  - `data.role_signal_strength_at_location` (number)
    Role signal strength at location

  - `data.role_usage_share` (number)
    Role usage share

  - `data.state_name` (string)
    State name

  - `data.vendor_id` (integer)
    Vendor ID

  - `data.vendor_name` (string)
    Vendor name

## Response 401 fields (application/json):

  - `errors` (array)

  - `errors.detail` (string, required)
    Example: The api key provided is not valid

  - `errors.source` (string)

  - `errors.title` (string, required)
    Example: Unauthorized

## Response 422 fields (application/json):

  - `errors` (array, required)

  - `errors.detail` (string, required)
    Example: null value where string expected

  - `errors.source` (object, required)

  - `errors.source.pointer` (string, required)
    Example: /data/attributes/petName

  - `errors.title` (string, required)
    Example: Invalid value

## Response 503 fields (application/json):

  - `errors` (array)

  - `errors.detail` (string, required)
    Example: Unable to verify credit availability. Please try again later. If the error persists, contact customersupport@hginsights.com.

  - `errors.source` (string)

  - `errors.title` (string, required)
    Example: Service unavailable

