> For the complete documentation index, see [llms.txt](https://docs.concurrence.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.concurrence.com/developer-guide/classic-api/data-access/organization-tables.md).

# Organization Tables & Schemas

Schema reference for organization tables - conversations, users, services, tools, and more.

Read-only tables that hold your organization's operational data. Each page below documents the schema for a specific area (conversations, users, services, and so on) along with a small query example to get you started.

{% hint style="info" %}
Guidelines

* Read-only tables with stable, production schemas.
* All timestamps are UTC.
* IDs are strings unless otherwise noted.
* JSON columns may contain nested objects or arrays.
* Availability varies by enabled features.
  {% endhint %}

### Available Tables

## Schema Overview

```mermaid
%%{init: {"theme":"base","themeVariables":{"fontFamily":"Inter, sans-serif","fontSize":"16px","background":"#FAF8F6","primaryColor":"#F1EAE7","primaryTextColor":"#1A1817","primaryBorderColor":"#D7D2D0","secondaryColor":"#FDFCFB","tertiaryColor":"#F6F2F0","lineColor":"#575452","textColor":"#3D3937","clusterBkg":"#FDFCFB","clusterBorder":"#E8E2DF","edgeLabelBackground":"#FAF8F6","actorBkg":"#F1EAE7","actorTextColor":"#1A1817","actorBorder":"#D7D2D0","actorLineColor":"#575452","signalColor":"#575452","signalTextColor":"#3D3937","labelBoxBkgColor":"#F1EAE7","labelBoxBorderColor":"#D7D2D0","labelTextColor":"#3D3937","loopTextColor":"#3D3937","noteBkgColor":"#F6F2F0","noteBorderColor":"#D7D2D0","noteTextColor":"#3D3937","activationBkgColor":"#F1EAE7","activationBorderColor":"#D7D2D0","altSectionBkgColor":"#FAF8F6","altSectionColor":"#3D3937"},"fontFamily":"Inter, sans-serif"}}%%
erDiagram
  ORGANIZATION ||--o{ USER : contains
  ORGANIZATION ||--o{ SERVICE : contains
  USER ||--o{ CONVERSATION : starts
  CONVERSATION ||--o{ MESSAGE : includes
  SERVICE ||--o{ CONVERSATION : powers
  CONVERSATION ||--o{ METRIC : evaluates
  ROLE ||--o{ USER : assigns
  SERVICE ||--o{ TOOL : uses
  SIMULATION ||--o{ CONVERSATION : tests
```

## Common Queries

```sql
-- Active conversations in last 7 days
SELECT COUNT(*) as active_conversations
FROM conversations
WHERE created_at >= CURRENT_DATE - INTERVAL '7 days'
  AND is_finished = false;

-- Daily message volume
SELECT DATE(created_at) as day,
       COUNT(*) as message_count
FROM messages
WHERE org_id = 'your-org-id'
GROUP BY DATE(created_at)
ORDER BY day DESC
LIMIT 30;

-- User engagement metrics
SELECT u.user_id,
       u.email,
       COUNT(DISTINCT c._id) as conversation_count
FROM users u
LEFT JOIN conversations c ON u.user_id = c.user_id
GROUP BY u.user_id, u.email;
```

{% hint style="success" %}
Browse the subpages below for detailed schemas and query examples for each table category.
{% endhint %}

## Subpages

{% content-ref url="/pages/3BOJjReV2ER9lG1Lbc8K" %}
[Conversation](/developer-guide/classic-api/data-access/organization-tables/conversation.md)
{% endcontent-ref %}

{% content-ref url="/pages/a1uGvjaYVzPUp011WWr3" %}
[User](/developer-guide/classic-api/data-access/organization-tables/user.md)
{% endcontent-ref %}

{% content-ref url="/pages/ndEs1qWrrK2X7MosLB7k" %}
[Service](/developer-guide/classic-api/data-access/organization-tables/service.md)
{% endcontent-ref %}

{% content-ref url="/pages/NHOEAyfQvE1rftI1Xv1J" %}
[Organization](/developer-guide/classic-api/data-access/organization-tables/organization.md)
{% endcontent-ref %}

{% content-ref url="/pages/vx3WApiWRLXiRJUsHXVR" %}
[Dynamic Behaviors](/developer-guide/classic-api/data-access/organization-tables/dynamic-behaviors.md)
{% endcontent-ref %}

{% content-ref url="/pages/kfW1VPtef0THEpkpAGWK" %}
[Metric](/developer-guide/classic-api/data-access/organization-tables/metric.md)
{% endcontent-ref %}

{% content-ref url="/pages/vwZM4rALcWUQUtHwlgzE" %}
[Role](/developer-guide/classic-api/data-access/organization-tables/role.md)
{% endcontent-ref %}

{% content-ref url="/pages/p9Pj4LBiaHArMQEFLrua" %}
[Tool](/developer-guide/classic-api/data-access/organization-tables/tool.md)
{% endcontent-ref %}

{% content-ref url="/pages/AYDdEWwIANWUzmjsuYVb" %}
[Simulation](/developer-guide/classic-api/data-access/organization-tables/simulation.md)
{% endcontent-ref %}

{% content-ref url="/pages/KZSX4w1PW3wTC27TC5LO" %}
[Common Query Patterns](/developer-guide/classic-api/data-access/organization-tables/common-query-patterns.md)
{% endcontent-ref %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.concurrence.com/developer-guide/classic-api/data-access/organization-tables.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
