---
updatedAt: 2026-08-27T16:57:57.000Z
agentTools:
  projectIndex: https://developer.zylo.com/llms.txt
---

# Resource Relationships

Overview of the relationships between resources.

# Resource Relationships

Resources can be related to each other in various ways.

* **One-to-Many**: A single resource can be associated with multiple instances of another resource.

* **Many-to-One**: Multiple instances of a resource can be associated with a single instance of another resource.

* **One-to-One**: A single instance of a resource is associated with exactly one instance of another resource.

The following table outlines the relationships between different resources in the system.

> **Relationship Aliases**: When a resource has multiple relationships to the same target, the aliases are shown in parentheses. Use the alias name (not the resource name) in your `with` block. For example, `applications` has three relationships to `users` — use `"application_owner"`, `"business_owner"`, or `"it_owner"` instead of `"users"`.

> **⚠️ Contracts ↔ Applications can be split across two relationships.** The direct `applications ↔ contracts` join works for the common case where a contract is associated with a single application. When a contract spans multiple applications (its `contract_line_items` point to different apps), the contract has no single `application_id` and the direct join will return null for that contract. In that case, the per-app association lives on `contract_line_items.application_id` instead. To answer "which apps have/lack contracts" or "how many contracts does this app have" comprehensively, query both populations (`applications → contracts` AND `applications → contract_line_items`) and combine results. A single `applications → contracts` join will silently under-count multi-app contracts. See the Report Builder guide's "Resource-Specific Gotchas" section for worked examples.

| Resource                   | One-to-Many                                                                                                                                                                                                                | Many-to-One                                                                   | One-to-One                                                                                         |
| :------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :---------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------- |
| alerts                     |                                                                                                                                                                                                                            | applications, contracts                                                       |                                                                                                    |
| application\_budget\_stats |                                                                                                                                                                                                                            | applications                                                                  |                                                                                                    |
| application\_catalog       |                                                                                                                                                                                                                            |                                                                               | applications                                                                                       |
| application\_licenses      |                                                                                                                                                                                                                            | applications, application\_users                                              |                                                                                                    |
| applications               | alerts, application\_licenses, application\_surveys, application\_users, contract\_line\_items, contracts, functionalities, payments, po\_line\_items, savings\_events, view\_applications, workflow\_responses, workflows | application\_security, users (application\_owner, business\_owner, it\_owner) | application\_catalog, application\_stats, application\_budget\_stats, integrations, usage\_connect |
| application\_security      | applications                                                                                                                                                                                                               |                                                                               | zybrary                                                                                            |
| application\_stats         |                                                                                                                                                                                                                            |                                                                               | applications                                                                                       |
| application\_users         | application\_licenses                                                                                                                                                                                                      | applications, users                                                           |                                                                                                    |
| application\_surveys       |                                                                                                                                                                                                                            | applications                                                                  |                                                                                                    |
| contract\_line\_items      |                                                                                                                                                                                                                            | applications, contracts                                                       |                                                                                                    |
| contracts                  | alerts, contract\_line\_items                                                                                                                                                                                              | applications                                                                  |                                                                                                    |
| functionalities            |                                                                                                                                                                                                                            | applications                                                                  |                                                                                                    |
| integrations               |                                                                                                                                                                                                                            |                                                                               | applications, usage\_connect                                                                       |
| payments                   |                                                                                                                                                                                                                            | applications, po\_line\_items, users, zybrary                                 |                                                                                                    |
| po\_line\_items            | payments, unmatched\_payments                                                                                                                                                                                              | applications, purchase\_orders                                                |                                                                                                    |
| purchase\_orders           | po\_line\_items, unmatched\_payments                                                                                                                                                                                       | suppliers                                                                     |                                                                                                    |
| savings\_events            |                                                                                                                                                                                                                            | applications                                                                  |                                                                                                    |
| suppliers                  | purchase\_orders                                                                                                                                                                                                           |                                                                               |                                                                                                    |
| unmatched\_payments        |                                                                                                                                                                                                                            | purchase\_orders, po\_line\_items                                             |                                                                                                    |
| usage\_connect             |                                                                                                                                                                                                                            |                                                                               | applications, integrations                                                                         |
| user\_stats                |                                                                                                                                                                                                                            |                                                                               | users                                                                                              |
| users                      | application\_users, applications (app\_owner\_applications, business\_owner\_applications, it\_owner\_applications), payments                                                                                              |                                                                               | user\_stats                                                                                        |
| view\_applications         |                                                                                                                                                                                                                            | applications, views                                                           |                                                                                                    |
| views                      | view\_applications, view\_zylo\_users                                                                                                                                                                                      |                                                                               |                                                                                                    |
| view\_zylo\_users          |                                                                                                                                                                                                                            | views, zylo\_users                                                            |                                                                                                    |
| workflow\_responses        |                                                                                                                                                                                                                            | applications, workflows                                                       |                                                                                                    |
| workflows                  | workflow\_responses                                                                                                                                                                                                        | applications                                                                  |                                                                                                    |
| zybrary                    | payments                                                                                                                                                                                                                   |                                                                               | application\_security                                                                              |
| zylo\_users                | view\_zylo\_users                                                                                                                                                                                                          |                                                                               |                                                                                                    |