organizations

Retrieve a list of organizations.

Arguments

organization_sentera_ids ([ID!])

An optional list of organization IDs. If provided only organizations from
this list will be returned and ordered the same as the list.

organization_type (OrganizationType)

An optional parameter to filter results to organizations of a specific type.

pagination (Pagination!)

Information used to paginate the results.

parent_organization_id (ID)

An optional ID of an organization. If present the results will only include
those organizations that are descended from the provided organization. The
organization represented by this ID will not be in the result set.

Return fields

page (Int!)

The page of results returned in this structure when using pagination.

page_size (Int!)

The number of results returned in this structure when using pagination.

present (Boolean!)

Whether or not there are any results in this structure.

results ([Organization]!)

A collection of organizations matching the query constraints.

total_count (Int!)

The total number of items matching the query constraints.

Examples

Organizations a user can access.

List all the organizations a user can access, including partnerships. Also flattens the hierarchy into a list.

Try this example in GraphiQL
query AllUserOrganizations {
  organizations(pagination: { page: 1, page_size: 100 }) {
    total_count
    results {
      sentera_id
    }
  }
}

{
  "data": {
    "organizations": {
      "total_count": 3,
      "results": [
        {
          "sentera_id": "0iuljkr_OR_SHORT1_CV_test_fecc82d0a_201109_160514"
        },
        {
          "sentera_id": "sps8sey_OR_SHORT2_CV_test_fecc82d0a_201109_160515"
        },
        {
          "sentera_id": "t9alucp_OR_SHORT3_CV_test_fecc82d0a_201109_160515"
        }
      ]
    }
  }
}

Filter Organizations List

Filter the list of returned organizations to a specific subset of organizations.

Try this example in GraphiQL
query Organizations {
  organizations(organization_sentera_ids: ["sps8sey_OR_SHORT2_CV_test_fecc82d0a_201109_160515", "t9alucp_OR_SHORT3_CV_test_fecc82d0a_201109_160515"], pagination: { page: 1, page_size: 100 }) {
    total_count
    results {
      sentera_id
    }
  }
}

{
  "data": {
    "organizations": {
      "total_count": 2,
      "results": [
        {
          "sentera_id": "sps8sey_OR_SHORT2_CV_test_fecc82d0a_201109_160515"
        },
        {
          "sentera_id": "t9alucp_OR_SHORT3_CV_test_fecc82d0a_201109_160515"
        }
      ]
    }
  }
}

Retrieve descendants of a specific organization

Filter the list of returned organizations to those that are descendants of a specific organization. Does not include the organization provided in the results.

Try this example in GraphiQL
query Organizations {
  organizations(parent_organization_id: "sps8sey_OR_SHORT2_CV_test_fecc82d0a_201109_160515", pagination: { page: 1, page_size: 100 }) {
    total_count
    results {
      sentera_id
    }
  }
}

{
  "data": {
    "organizations": {
      "total_count": 2,
      "results": [
        {
          "sentera_id": "x0asdfl_OR_SHORT2_CV_test_fecc82d0a_201109_160515"
        },
        {
          "sentera_id": "t9alucp_OR_SHORT3_CV_test_fecc82d0a_201109_160515"
        }
      ]
    }
  }
}

Webhook Subscriptions for all organizations you can access.

You primarily use the organizations query to get the list of organizations, and then ask for the webhook subscriptions on those organizations.

Try this example in GraphiQL
query AllUserOrganizations {
  organizations(pagination: { page: 1, page_size: 100 }) {
    total_count
    results {
      webhook_subscriptions(pagination: { page: 1, page_size: 100 }) {
        total_count
        results {
          sentera_id
          callback_url
          event_types
        }
      }
    }
  }
}

{
  "data": {
    "organizations": {
      "total_count": 3,
      "results": [
        {
          "sentera_id": "0iuljkr_OR_SHORT1_CV_test_fecc82d0a_201109_160514",
          "webhook_subscriptions": {
            "total_count": 0,
            "results": []
          }
        },
        {
          "sentera_id": "sps8sey_OR_SHORT2_CV_test_fecc82d0a_201109_160515",
          "webhook_subscriptions": {
            "total_count": 0,
            "results": []
          }
        },
        {
          "sentera_id": "t9alucp_OR_SHORT3_CV_test_fecc82d0a_201109_160515",
          "webhook_subscriptions": {
            "total_count": 1,
            "results": [
              {
                "sentera_id": "vx4lc05_WS_y99zAcme_CV_deve_ef64a0fce_220112_111029",
                "callback_url": "https://example.com/webhooks",
                "event_types": [
                  "MOSAIC_CREATED",
                  "TASK_MODIFIED"
                ]
              }
            ]
          }
        }
      ]
    }
  }
}

Webhook events by date range

If you want all events that were created within a specific date range you can query for them.

Try this example in GraphiQL
query AllUserOrganizations {
  organizations(pagination: { page: 1, page_size: 100 }) {
    total_count
    results {
      webhook_subscriptions(pagination: { page: 1, page_size: 100 }) {
        total_count
        results {
          sentera_id
          events(pagination: { page: 1, page_size: 100 }, date_range: {start_timestamp: "2022-02-06T14:55:59Z", end_timestamp: "2022-02-09T14:55:59Z", date_attribute_name: "created_at"} ) {
            results {
              sentera_id
              created_at
            }
          }
        }
      }
    }
  }
}

{
  "data": {
    "organizations": {
      "total_count": 3,
      "results": [
        {
          "sentera_id": "0iuljkr_OR_SHORT1_CV_test_fecc82d0a_201109_160514",
          "webhook_subscriptions": {
            "total_count": 0,
            "results": []
          }
        },
        {
          "sentera_id": "sps8sey_OR_SHORT2_CV_test_fecc82d0a_201109_160515",
          "webhook_subscriptions": {
            "total_count": 0,
            "results": []
          }
        },
        {
          "sentera_id": "t9alucp_OR_SHORT3_CV_test_fecc82d0a_201109_160515",
          "webhook_subscriptions": {
            "total_count": 1,
            "results": [
              {
                "sentera_id": "vx4lc05_WS_y99zAcme_CV_deve_ef64a0fce_220112_111029",
                "events": {
                  "results": [
                    {
                      "sentera_id": "zv5tc05_WE_y99zAcme_CV_deve_ef64a0fce_220208_145559",
                      "created_at": "2022-02-08T14:55:59Z"
                    }
                  ]
                }
              }
            ]
          }
        }
      ]
    }
  }
}