# ZeyOS — LLM full working set This is a high-signal bundle for one-shot ingestion. For structured ingestion, prefer: - /ai/docs.jsonl.gz (gzip-compressed NDJSON bundle with per-tag / per-table / per-namespace chunks) Discovery: - /llms.txt - /ai/index.json Raw specs (if mirrored in this build): - /__doc/openapi/api.json - /__doc/openapi/oauth2.json - /__doc/openapi/auth.json - /__doc/dbref.json - /__doc/ixmldoc.xml --- ## LLM working set (API) Source: /api/llms-full.txt # ZeyOS REST API — LLM working set ## Specs - REST OpenAPI: /__doc/openapi/api.json - OAuth 2.0 OpenAPI: /__doc/openapi/oauth2.json - Simple Auth OpenAPI: /__doc/openapi/auth.json ## Tag index (JSON) - /ai/openapi/tags.json ## Operations index (JSON) - /ai/openapi/operations.json ## Servers - https://cloud.zeyos.com/{INSTANCE}/api/v1 — ZeyOS Cloud ## Authentication - oauth (oauth2) — OAuth 2.0 Authorization ([RFC 6749](https://tools.ietf.org/html/rfc6749)); use the **[ZeyOS OAuth 2.0 API](https://developers.zeyos.com/oauth2) `POST /oauth2/v1/token`** to obtain a valid bearer token - token (http) — HTTP Bearer Authentication ([RFC 6750](https://tools.ietf.org/html/rfc6750)) - session (apiKey) — Session Cookie Authentication ([RFC 6265](https://tools.ietf.org/html/rfc6265)) ## Tag docs (Markdown) - accounts (6 endpoints): /ai/openapi/tag.accounts.md - actionsteps (6 endpoints): /ai/openapi/tag.actionsteps.md - addresses (6 endpoints): /ai/openapi/tag.addresses.md - applicationassets (3 endpoints): /ai/openapi/tag.applicationassets.md - applications (3 endpoints): /ai/openapi/tag.applications.md - appointments (6 endpoints): /ai/openapi/tag.appointments.md - associations (6 endpoints): /ai/openapi/tag.associations.md - binfiles (1 endpoints): /ai/openapi/tag.binfiles.md - campaigns (6 endpoints): /ai/openapi/tag.campaigns.md - categories (6 endpoints): /ai/openapi/tag.categories.md - channels (6 endpoints): /ai/openapi/tag.channels.md - comments (6 endpoints): /ai/openapi/tag.comments.md - components (6 endpoints): /ai/openapi/tag.components.md - contacts (6 endpoints): /ai/openapi/tag.contacts.md - contacts2contacts (6 endpoints): /ai/openapi/tag.contacts2contacts.md - contracts (6 endpoints): /ai/openapi/tag.contracts.md - couponcodes (6 endpoints): /ai/openapi/tag.couponcodes.md - coupons (6 endpoints): /ai/openapi/tag.coupons.md - customfields (3 endpoints): /ai/openapi/tag.customfields.md - davservers (6 endpoints): /ai/openapi/tag.davservers.md - devices (6 endpoints): /ai/openapi/tag.devices.md - documents (6 endpoints): /ai/openapi/tag.documents.md - dunning (6 endpoints): /ai/openapi/tag.dunning.md - dunning2transactions (6 endpoints): /ai/openapi/tag.dunning2transactions.md - entities2channels (6 endpoints): /ai/openapi/tag.entities2channels.md - events (6 endpoints): /ai/openapi/tag.events.md - feedservers (6 endpoints): /ai/openapi/tag.feedservers.md - files (6 endpoints): /ai/openapi/tag.files.md - follows (6 endpoints): /ai/openapi/tag.follows.md - forks (3 endpoints): /ai/openapi/tag.forks.md - general (2 endpoints): /ai/openapi/tag.general.md - groups (3 endpoints): /ai/openapi/tag.groups.md - groups2users (3 endpoints): /ai/openapi/tag.groups2users.md - invitations (6 endpoints): /ai/openapi/tag.invitations.md - items (6 endpoints): /ai/openapi/tag.items.md - ledgers (6 endpoints): /ai/openapi/tag.ledgers.md - likes (6 endpoints): /ai/openapi/tag.likes.md - links (6 endpoints): /ai/openapi/tag.links.md - mailinglists (6 endpoints): /ai/openapi/tag.mailinglists.md - mailingrecipients (6 endpoints): /ai/openapi/tag.mailingrecipients.md - mailservers (6 endpoints): /ai/openapi/tag.mailservers.md - messagereads (6 endpoints): /ai/openapi/tag.messagereads.md - messages (6 endpoints): /ai/openapi/tag.messages.md - notes (6 endpoints): /ai/openapi/tag.notes.md - objects (6 endpoints): /ai/openapi/tag.objects.md - opportunities (6 endpoints): /ai/openapi/tag.opportunities.md - participants (6 endpoints): /ai/openapi/tag.participants.md - payments (6 endpoints): /ai/openapi/tag.payments.md - permissions (3 endpoints): /ai/openapi/tag.permissions.md - pricelists (6 endpoints): /ai/openapi/tag.pricelists.md - pricelists2accounts (6 endpoints): /ai/openapi/tag.pricelists2accounts.md - prices (6 endpoints): /ai/openapi/tag.prices.md - projects (6 endpoints): /ai/openapi/tag.projects.md - records (6 endpoints): /ai/openapi/tag.records.md - relateditems (6 endpoints): /ai/openapi/tag.relateditems.md - resources (3 endpoints): /ai/openapi/tag.resources.md - services (3 endpoints): /ai/openapi/tag.services.md - stocktransactions (6 endpoints): /ai/openapi/tag.stocktransactions.md - storages (6 endpoints): /ai/openapi/tag.storages.md - suppliers (6 endpoints): /ai/openapi/tag.suppliers.md - tasks (6 endpoints): /ai/openapi/tag.tasks.md - tickets (6 endpoints): /ai/openapi/tag.tickets.md - transactions (6 endpoints): /ai/openapi/tag.transactions.md - users (3 endpoints): /ai/openapi/tag.users.md - weblets (3 endpoints): /ai/openapi/tag.weblets.md --- ## LLM working set (Database) Source: /db/llms-full.txt # ZeyOS Database Reference — LLM working set ## Spec - dbref.json: /__doc/dbref.json ## Table index (JSON) - /ai/db/tables.json ## Relations graph (JSON) - /ai/db/relations.json ## Per-table docs (Markdown) - Each table/view is available as `/ai/db/table..md` (URL provided in tables.json). - Each table/view is also available as `/ai/db/table..json` (URL provided in tables.json). ## Common entities (starting points) - accounts: /ai/db/table.accounts.md - contacts: /ai/db/table.contacts.md - projects: /ai/db/table.projects.md - tasks: /ai/db/table.tasks.md - tickets: /ai/db/table.tickets.md - opportunities: /ai/db/table.opportunities.md - transactions: /ai/db/table.transactions.md --- ## LLM working set (iXML) Source: /ixml/llms-full.txt # iXML — LLM working set ## Spec - ixmldoc.xml: /__doc/ixmldoc.xml ## Indexes - Namespaces (JSON): /ai/ixml/namespaces.json - Full reference (Markdown): /ai/ixml/ixml.md ## Per-namespace docs (Markdown) - array: /ai/ixml/namespace.array.md - auth: /ai/ixml/namespace.auth.md - bin: /ai/ixml/namespace.bin.md - ctrl: /ai/ixml/namespace.ctrl.md - date: /ai/ixml/namespace.date.md - db: /ai/ixml/namespace.db.md - debug: /ai/ixml/namespace.debug.md - decode: /ai/ixml/namespace.decode.md - encode: /ai/ixml/namespace.encode.md - excel: /ai/ixml/namespace.excel.md - extdata: /ai/ixml/namespace.extdata.md - file: /ai/ixml/namespace.file.md - form: /ai/ixml/namespace.form.md - http: /ai/ixml/namespace.http.md - mail: /ai/ixml/namespace.mail.md - math: /ai/ixml/namespace.math.md - misc: /ai/ixml/namespace.misc.md - numformat: /ai/ixml/namespace.numformat.md - pdf: /ai/ixml/namespace.pdf.md - rest: /ai/ixml/namespace.rest.md - soap: /ai/ixml/namespace.soap.md - std: /ai/ixml/namespace.std.md - tags: /ai/ixml/namespace.tags.md - temp: /ai/ixml/namespace.temp.md - xml: /ai/ixml/namespace.xml.md - zip: /ai/ixml/namespace.zip.md --- ## Markdown view: /docs/gettingstarted Source: /docs/gettingstarted.md # /docs/gettingstarted (Markdown view) Source: content/docs/gettingstarted.mdx --- # ZeyOS REST API Browser A CLI tool to interact with the ZeyOS API. This tool allows you to link a ZeyOS application, generate default routes, and call API routes with ease. ## Introduction ### What is OAuth 2.0? OAuth 2.0 is an authorization framework that allows applications to obtain limited access to user accounts on an HTTP service. It works by delegating user authentication to the service that hosts the user account, and authorizing third-party applications to access the user account. Here is a schematic diagram that illustrates the basic OAuth 2.0 flow: ``` +--------+ +----------------+ | |--(A)- Authorization Request ->| | | | | Resource | | |<-(B)-- Authorization Grant ---| Owner | | | +----------------+ | | +----------------+ | |--(C)-- Authorization Grant -->| | | Client | | Authorization | | |<-(D)----- Access Token -------| Server | | | +----------------+ | | +----------------+ | |--(E)----- Access Token ------>| | | | | Resource | | |<-(F)--- Protected Resource ---| Server | +--------+ +----------------+ ``` - **Step A**: The client requests authorization from the resource owner. - **Step B**: The resource owner grants authorization. - **Step C**: The client receives the authorization grant and requests an access token from the authorization server. - **Step D**: The authorization server issues an access token. - **Step E**: The client uses the access token to request the protected resource from the resource server. - **Step F**: The resource server returns the requested resource. ### About ZeyOS ZeyOS is a comprehensive business operating system that integrates all the functions of an enterprise into a single, cohesive system. This includes CRM, ERP, groupware, and many other functionalities. ZeyOS provides an extensive API that allows developers to interact with the platform programmatically. For more information, visit the [ZeyOS API documentation](https://developers.zeyos.com/api/). ## Installation 1. Clone the repository or download the script. 2. Install the dependencies: ```bash npm install ``` 3. Link the CLI tool globally: ```bash npm link ``` ## Usage The tool requires linking a ZeyOS application to obtain the necessary OAuth 2.0 tokens and generate default routes. ### Link a New Application ```bash zeyapi link ``` Follow the prompts to enter the instance ID, client ID, and client secret. The tool will guide you through the OAuth 2.0 authorization process and save the tokens in `zeyos-api/config.json`. You will also be prompted to populate the routes directory with default routes. ### Call an API Route ```bash zeyapi run --param "=,..." [--verbose|-v] ``` #### Example ```bash zeyapi run accounts-list -p "ID=4844" ``` This will replace the `{limit}` placeholder with `5` and call the `/api/v1/accounts` route as defined in `routes/accounts-list.json`, displaying the request details and HTTP status code if `--verbose` is specified. ### Generate Default Routes ```bash zeyapi generate ``` This will fetch the Swagger JSON and generate default route files in the `routes` directory. ### List All Routes ```bash zeyapi routes ``` This will list all available route files in the `routes` directory in a table format. ## Directory Structure ``` zeyos-api/ ├── config.json # Configuration file storing instance details and tokens └── routes/ # Directory containing generated route files ``` --- AI-friendly API references: - /api/llms-full.txt - /__doc/openapi/api.json - /ai/openapi/tags.json --- ## Markdown view: /api/openapi Source: /docs/restapi.md # /api/openapi (Markdown view) Source: content/docs/restapi/Introduction.mdx --- The **ZeyOS Standard REST API** provides access to almost all of your ZeyOS data and gives you a powerful tool to connect third-party applications and other systems with ZeyOS, without having to write a custom ZeyOS app. You may access the ZeyOS Standard REST API via `https://cloud.zeyos.com/{INSTANCE}/api/v1/`, provided that you supply a valid bearer token. For new integrations, obtain the token with OAuth 2.0 via `https://cloud.zeyos.com/{INSTANCE}/oauth2/v1/` as described in the [Authentication Guide](/auth/). ### Authentication The REST API is only usable for authenticated users. Authentication is supported in two common ways: 1. **Internal apps**: If the user is already logged in to ZeyOS and you call the REST API from a browser-based ZeyOS app, the current ZeyOS session can be used. 2. **External apps**: Obtain a bearer token using the recommended [OAuth 2.0 flow](/auth/oauth2/) or use [Simple Auth](/auth/simple-auth/) for an existing integration, then send the token with every REST API request. Once a token has been obtained, include it in the `Authorization` header: ```bash curl -X POST \ -H 'Authorization: Bearer YourApiToken' \ -H 'Content-Type: application/json' \ --data '{"fields":["ID","lastname","firstname"],"limit":3}' \ https://cloud.zeyos.com/demo/api/v1/contacts/ ``` ### OpenAPI Specification The complete REST API is also published as a machine-readable **OpenAPI** document. Use it to generate API clients, import the API into tools such as Postman or Insomnia, or hand it to an AI agent: * [`/__doc/openapi/api.json`](/__doc/openapi/api.json) - REST API OpenAPI specification (alias: [`/openapi.json`](/openapi.json)) * [`/__doc/openapi/oauth2.json`](/__doc/openapi/oauth2.json) - Recommended OAuth 2.0 specification (alias: [`/openapi.oauth2.json`](/openapi.oauth2.json)) * [`/__doc/openapi/auth.json`](/__doc/openapi/auth.json) - Simple Auth specification for existing integrations (alias: [`/openapi.auth.json`](/openapi.auth.json)) The canonical source of these files is `https://cloud.zeyos.com/__doc/openapi/`. For an interactive, endpoint-by-endpoint view of the same specification, see the [REST API Reference](/api). ### Return Values and Error Handling The ZeyOS Standard REST API currently only returns JSON data and an HTTP status code indicating the outcome of a request. HTTP status code 200 or 201 are used to indicate a successful response, and the result will be a **JSON object**. When an error occurs, the HTTP status code will be 400 or greater, and the response will be a **text message**. We recommend that you treat any HTTP status code greater than or equal to 400 as an error. ### Data Retrieval The ZeyOS Standard REST API allows you to execute complex queries, including simple joins and composite filters. Let's take a look at the following example: Query (`query.json`): ```json { "fields": { "Id": "ID", "Name": "lastname", "Nickname": "extdata.nickname", "Address": "contact.address", "Postalcode": "contact.postalcode", "Town": "contact.city", "Country": "contact.country", "SalesAgent": "assigneduser.name" }, "filters": { "visibility": 0, "contact.country": {"IN": ["DE", "AT", "GB"]}, "2": [ "OR", {"lastmodified": {">": 1524472045}}, {"contact.lastmodified": {">": 1524472045}} ] }, "sort": [ "+lastname", "-contact.country" ], "limit": 3, "offset": 0 } ``` Request: ```bash $ curl -X POST \ -H 'Authorization: Bearer YourApiToken' \ -H "Content-Type: application/json" \ --data @./query.json \ https://cloud.zeyos.com/demo/api/v1/accounts/ ``` Response: ```json [{ "Id": 2, "Name": "BEQ Building Equipment", "Nickname": null, "Address": "Queensstreet", "Postalcode": "12923", "Town": "London", "Country": "GB", "SalesAgent": "Max Mueller" }, { "Id": 15, "Name": "CleanTexx", "Nickname": null, "Address": "Tower Bridge", "Postalcode": "12923", "Town": "London", "Country": "GB", "SalesAgent": null }, { "Id": 1, "Name": "Lightexx AG", "Nickname": null, "Address": "Schmittstr. 4", "Postalcode": "80172", "Town": "Munich", "Country": "DE", "SalesAgent": null }] ``` #### Field Selection The field selection references all fields you want to have included in your query results. You can either specify your field selection as an `array` or as an `object`. Using an object is useful if you want to specify alias names. In the example above, we select the field `lastname` with an alias called `Name`. If you are not certain what fields are available for which entity, you can either check the entity reference in this document or the [ZeyOS Schema Documentation](/db). Besides selecting the entity's own fields, you can also perform simple join operations within the entity's first degree relationships. In order to discover relationships, it's best to check the [ZeyOS Schema Documentation](/db), it also contains a graphical map of all entity relationships. Besides related tables you can also select `extdata` fields. `extdata` is a concept in ZeyOS which allows for storing additional values for all entities in ZeyOS. Whenever you create a new form field in ZeyOS, the field's value is stored in `extdata`. #### Filters You can specify composite filters as JSON objects and nested condition arrays: ```json { "field": "value", "field2": {"=": "value"}, "field3": {"<": "value1", ">": "value2"}, "field4": {"IN": ["value1", "value2"]}, "1": ["AND", {"field5": "value5"}, {"field6": {"!=": "value6"}}] } ``` The following filter operators are supported: * `=`: Equals * `!=`, `<>`: Not equals * `<`: Less than * `<=`: Less than or equal to * `>`: Greater than * `>=`: Greater than or equal to * `IN`: Contains (e.g. `"field": {"IN": ["value1", "value2"]}`) * `!IN`: Does not contain For `strings` you can also use the following operators: * `~`: Matches regular expression * `~*`: Matches regular expression, case-insensitive * `!~`: Not matches regular expression * `!~*`: Not matches regular expression, case-insensitive * `~~`: Is like * `~~*`: Is like, case-insensitive * `!~~`: Not like * `!~~*`: Not like, case-insensitive #### Search Queries The `query` parameter allows to specify a search string, that will be applied to all searchable strings, such as `name`. #### Sorting You can sort by multiple columns by defining an array of column names. ```json [ "field1", "+field2", "-field3" ] ``` Adding modifiers will set the sorting mode: * `+` for ascending * `-` for descending #### Pagination Sometimes the result size might be too large to be selected through one query. In such cases it makes sense to use pagination to page through the results. The first thing you need to know is the number of records in order to calculate the number of pages. This can be achieved through the `count` modifier. For example: ```json { "count": 1, "filters": { "visibility": 0, "contact.country": {"IN": ["DE", "AT", "GB"]}, "2": [ "OR", {"lastmodified": {">": 1524472045}}, {"contact.lastmodified": {">": 1524472045}} ] } } ``` Result: ```json { "count": 5 } ``` Now that you have the number of records, you can easily page through the result by using the `limit` and `offset` parameters. #### Expanding JSON and Binary Data Some table columns include JSON data or reference binary files. The `expand` parameter allows you to load the column content automatically. For example: ```json { "fields": [ "ID", "subject", "binfile" ], "expand": [ "binfile" ], "limit": 1 } ``` Request: ```bash $ curl -X POST \ -H 'Authorization: Bearer YourApiToken' \ -H "Content-Type: application/json" \ --data @./query.json \ https://cloud.zeyos.com/demo/api/v1/messages/ ``` Result: ```json [{"ID":188,"subject":"Test","binfile":{"content":"UmV0dXJuLVBhdGg6IDx..."}}] ``` This example will return the entire e-mail message as [RFC 822](https://www.ietf.org/rfc/rfc822.txt). --- AI-friendly API references: - /api/llms-full.txt - /__doc/openapi/api.json - /ai/openapi/tags.json --- ## Markdown view: /sdk Source: /docs/sdk.md # /sdk (Markdown view) Source: docs/sdk/entities.md --- # ZeyOS Entities - `accounts` - `actionsteps` - `addresses` - `applications` - `appointments` - `associations` - `campaigns` - `categories` - `comments` - `components` - `contacts` - `contacts2contacts` - `contracts` - `couponcodes` - `coupons` - `davservers` - `dunning` - `dunning2transactions` - `events` - `feedservers` - `fields` - `files` - `follows` - `groups` - `groups2users` - `invitations` - `items` - `likes` - `links` - `mailinglists` - `mailservers` - `messagereads` - `messages` - `notes` - `numcounters` - `objects` - `opportunities` - `participants` - `payments` - `permissions` - `pricelists` - `pricelists2accounts` - `prices` - `projects` - `records` - `resources` - `services` - `stocktransactions` - `storages` - `suppliers` - `tasks` - `tickets` - `transactions` - `users` - `weblets`