user_organization

Retrieve the organization to which a user belongs.

Return fields

action (UpsertActionType!)

Determines if it was a create or update.

address_1 (String)

Organization address line 1.

address_2 (String)

Organization address line 2.

child_organizations_map (JSON)
Deprecation notice

To build an organization hierarchy you should pull all the organizations you can access through the organizations query and then build the tree client side using parent_organization_id.

Hierarchy of child organization information returned as JSON. Available keys
are sentera_id (string), name (string) and children (array). This structure is recursive.

city (String)

Organization city.

country_code (String!)

Organization country code (ISO 3166-1).

email (String!)

Organization email.

external_connections ([ExternalCredential!]!)

The external services connected to this organization.

feature_sets (FeatureSetsQueryResult!)

A list of feature sets that are directly attached to this organization.

Argument Type Description
order_by FeatureSetSortingAttributes

Order the results by a specific attribute.

order_by_direction SortDirection

Direction (ascending or descending) of the ordered results.

pagination Pagination

Paginate the results.

type FeatureSetType

Filter the results by feature set type.

files (FilesQueryResult!)

A list of files associated with this organization.

Argument Type Description
date_range DateRange

Filter the results by a date range.

order_by FileSortingAttributes

Order the results by a specific attribute.

order_by_direction SortDirection

Direction (ascending or descending) of the ordered results.

pagination Pagination

Paginate the results.

name (String!)

Organization name.

organization_type (OrganizationType!)

Type of this organization.

parent_organization_id (ID)

A system-generated key identifying the organization one level above this
organization in the hierarchy. If null then this organization is the root of
the hierarchy, if one exists.

phone_number (String)

Organization phone number.

preferences (OrganizationPreferences!)

The list of preferences for this organization.

sentera_id (ID!)

A system-generated key identifying the organization.

short_id (String!)

A short system-generated key identifying the organization.

state (String)

Organization state/province/region code (ISO 3166-2).

status (OrganizationStatus!)

The current status of the organization.

users (UsersQueryResult)

A list of users that belong to this organization.

Argument Type Description
order_by UserSortingAttributes

Order the results by a specific attribute.

order_by_direction SortDirection

Direction (ascending or descending) of the ordered results.

pagination Pagination

Paginate the results.

status UserStatus

Filter the results by user status.

webhook_subscriptions (WebhookSubscriptionsQueryResult!)

A list of web hook subscriptions associated with this organization.

Argument Type Description
pagination Pagination!

Paginate the results.

zip_code (String)

Organization zip code.

Examples

User Organization

Return the organization of the current user.

Try this example in GraphiQL
query FetchUserOrganization {
  user_organization {
    sentera_id
    name
    address_1
    address_2
    city
    state
    country_code
    zip_code

    email
    phone_number

    status

    users(order_by: LAST_NAME, order_by_direction: ASCENDING, pagination: { page: 1, page_size: 10 }) {
      total_count
      results {
        first_name
        last_name
        sentera_id
        address_1
        address_2
        city
        state
        country_code
        zip_code
        status
        roles
        license_type
      }
    }

    external_connections {
      partner
      expires_at
      connected_by {
        first_name
      }
    }
  }
}

{
  "data": {
    "user_organization": {
      "sentera_id": "i1iqp00_OR_sdwwAcmeOrg_CV_shar_b292b84_180501_214559",
      "name": "Acme Org",
      "address_1": "123 Apple St.",
      "address_2": "Apt 2",
      "city": "Peioria",
      "state": "IL",
      "country_code": "US",
      "zip_code": "54321",
      "email": "john.doe@example.com",
      "phone_number": "123-456-7890",
      "status": "ACTIVE",
      "users": {
        "total_count": 1,
        "results": [
          {
            "first_name": "John",
            "last_name": "Doe",
            "sentera_id": "vivlax4_US_sdwwAcmeOrg_CV_shar_b292b84_180501_214632",
            "address_1": "123 Apple St.",
            "address_2": "Apt 1",
            "city": "Peoria",
            "state": "IL",
            "country_code": "US",
            "zip_code": "54321",
            "status": "ACTIVE",
            "roles": [
              "ADMIN",
              "CLIENT_ADMIN",
              "DOCUMENTATION_READER",
              "API_INTEGRATOR"
            ],
            "license_type": "PRO"
          }
        ]
      },
      "external_connections": [
        {
          "partner": "JOHN_DEERE",
          "expires_at": "2019-10-30T15:51:02Z",
          "connected_by": {
            "first_name": "Jake"
          }
        },
        {
          "partner": "CLIMATE_FIELD_VIEW",
          "expires_at": "2019-08-30T21:03:09Z",
          "connected_by": {
            "first_name": "Dan"
          }
        }
      ]
    }
  }
}