OdyDocs

Databasebeta

A table of what you know about each contact. Ody adds and fills columns from conversations; you define your own, read and write values, find a row by phone number, and query everything with read-only SQL.

The Database is a table with one row per contact. Its columns hold what the business knows about each contact: plan, budget, renewal date, "asked about pricing". You add columns, and Ody adds them too: when a contact says something in a call, a voicemail or a text that no column holds yet, Ody creates the column, fills it, and listens for the same thing in every later conversation. Each cell is filled by someone on the team, by this API, or by Ody.

Use this API to load what you already know about your customers, to read what Ody learned from conversations, and to answer questions about all of it with SQL.

Switched on per workspace

The Database is in beta and Ody turns it on for one workspace at a time. Until it is on for yours, every endpoint on this page returns 409 failed_precondition. Write to [email protected] to ask for it.

SDK examples need v0.10.0

ody.data (TypeScript) and client.data (Python) are in v0.10.0 of the SDKs, which is not on npm or PyPI yet. With the published v0.9.0, use the cURL examples or any HTTP client.

#How the table works

RowsOne per contact. Every contact has a row, including contacts with no values yet. A row is identified by the contact's id.
ColumnsAdded by your team, by this API, or by Ody. There is no maximum number of columns. Each has a key (renewal_date) that this API and SQL use. The key is made from the name the column was created with and never changes, so renaming a column in the app does not break your integration.
ValuesTyped by the column: text, number, date, true / false, one choice, several choices.
Who filled a cellEvery filled cell records its source: user, import, api, automation or ai.

A value you write is yours. A cell written through this API gets source: "api" and is locked: Ody does not replace it with something it hears in a later conversation. This is true when you clear a cell, too. Cells that nobody has written stay open for Ody to fill.

#Columns that Ody adds

Unless the workspace has turned it off, Ody adds a column when a contact says a kind of fact that no column holds. A remodeling company whose callers mention the type of project gets a Project type column without anyone creating it. These columns have auto: true.

What this means for an integration:

  • The column list changes on its own. Read the columns with GET /data/columns or GET /data/schema when you need them. Do not keep a fixed list in your code.
  • Keys are still stable. A column Ody added keeps its key for as long as it exists, like any other.
  • A column you create is never duplicated. Ody compares names without regard to case, word order or small words: if you have Project type, Ody fills it and does not add "Type of project".
  • Deleting an auto column is remembered. Ody does not add a column with that meaning again.
  • Some things are never added. Ody does not create columns for card numbers, government IDs, passwords or health details, or for what the contact card already holds (name, phone number, e-mail, company, tags).

The workspace's owners and admins turn this on and off in the app, under Database → AI → Add columns automatically. There is no API for that switch.

#Scopes

ToScope
Read columns, rows, summaries, and run SQLcontacts:read
Write values, create a contact through upsertcontacts:write
Add, change or delete columnsdata:manage

Values are data about contacts, so they follow the contact scopes. Changing the shape of the table is a separate permission because deleting a column deletes every value in it.

#Test keys

ody_test_… keys read and write the same table as live keys. Nothing on this page sends a message or spends money, so there is nothing to simulate.

#The column object

  • id uuid — Unique identifier. Accepted anywhere a key is.
  • key string — The column's name in this API and in SQL. Lower case with underscores. Never changes.
  • name string — The name people see in the app. Up to 60 characters.
  • description string — What the column holds. When Ody fills the column, this is the instruction it follows. Up to 200 characters.
  • kind string — attribute: a fact about the contact. signal: something the contact said or asked, counted per conversation.
  • type string — text, number, date, boolean, select (one choice) or multi_select (several choices). A signal is always boolean.
  • options array of strings — The choices of a select or multi_select column.
  • allowNewOptions boolean — Whether Ody may add a choice it hears that is not in the list.
  • aiEnabled boolean — Whether Ody fills this column from calls and texts.
  • fillRule string — How Ody fills it. latest: a newer conversation replaces the value. once: the first value stays. collect: choices add up (multi_select only).
  • auto boolean — true when Ody added the column itself, from something a contact said. See Columns that Ody adds.
  • position integer — Order in the table.
  • createdAt, updatedAt timestamp — ISO 8601.

#Values by type

typeSendYou get back
textA string, up to 500 charactersThe string
numberA number, or a string such as "1,200"A number
date"YYYY-MM-DD" (a full ISO timestamp is cut to its day)"YYYY-MM-DD"
booleantrue / false (also "yes", "no")true / false
selectOne of the column's choices. Matching ignores case.The choice as it is spelled in the column
multi_selectA list of choicesA list
signaltrue / falsetrue / false

null clears a value. An empty cell reads as null, except a signal column, which reads as false.

A choice that is not in the list is added

Writing "Platinum" to a select column whose choices are Free and Pro adds Platinum to the column, the same as when a person types a new choice in the app. Check the value against options first if you want to refuse unknown choices.

#The row object

  • contactId uuid — The contact this row belongs to.
  • contact object — The contact's own fields: firstName, lastName, company, phone (the first number), email (the first address), tags, createdAt, lastContactedAt. On workspaces where AI Contact is on, also the card fields. Read-only here; change them with the Contacts API.
  • data object — Every column by key, with its value.
  • cells object — Only on single-row responses. The filled cells by column key, each with value, source, locked, confidence, occurrences, lastObservedAt and updatedAt.
The row object
{
  "contactId": "8b1d6f3e-2c4a-4e1b-9f0d-7a5c3e2b1a90",
  "contact": {
    "firstName": "Dana",
    "lastName": "Reyes",
    "company": "Brightline",
    "phone": "+15125550199",
    "email": "[email protected]",
    "tags": ["vip"],
    "createdAt": "2026-10-14T18:02:11.000Z",
    "lastContactedAt": "2026-11-27T16:40:02.000Z"
  },
  "data": {
    "plan": "Pro",
    "seats": 12,
    "renewal_date": "2027-03-01",
    "newsletter": true,
    "interests": ["Voice", "AI"],
    "asked_about_pricing": true
  },
  "cells": {
    "plan": {
      "value": "Pro",
      "source": "api",
      "locked": true,
      "confidence": null,
      "occurrences": 0,
      "lastObservedAt": null,
      "updatedAt": "2026-11-29T15:02:11.000Z"
    },
    "asked_about_pricing": {
      "value": true,
      "source": "ai",
      "locked": false,
      "confidence": 0.92,
      "occurrences": 3,
      "lastObservedAt": "2026-11-27T16:40:02.000Z",
      "updatedAt": "2026-11-27T16:41:30.000Z"
    }
  }
}

For a signal column, occurrences is the number of conversations it came up in.

#Contact card fields

When AI Contact is on for a workspace, a contact carries more details than a name and a company: a job title, a postal address, and what the phone network says about the number. The Database shows each of them as a column, and the contact object of a row carries them too. A workspace without AI Contact gets none of these fields: they are absent from contact, and a filter or sort on one is rejected with invalid_argument.

In contactIn a filter or sortIn SQLWhat it holds
jobTitlecontact.job_titlejob_titleJob title
headlinecontact.headlineheadlineA one-line professional headline
websitecontact.websitewebsiteThe contact's website, as a bare domain
linkedinUrlcontact.linkedin_urllinkedin_urlLinkedIn profile URL
companyDomaincontact.company_domaincompany_domainThe company's website, as a bare domain
companyLinkedinUrlcontact.company_linkedin_urlcompany_linkedin_urlThe company's LinkedIn page
secondaryPhonecontact.secondary_phonesecondary_phoneA second phone number, E.164
addressStreetcontact.address_streetaddress_streetStreet address
addressCitycontact.address_cityaddress_cityCity
addressStatecontact.address_stateaddress_stateState or region
addressPostalCodecontact.address_postal_codeaddress_postal_codeZIP or postal code
addressCountrycontact.address_countryaddress_countryCountry, ISO 3166-1 alpha-2 when known (US)
phoneLineTypecontact.phone_line_typephone_line_typemobile, landline, voip, toll_free or unknown
phoneCarriercontact.phone_carrierphone_carrierCarrier of the contact's number
callerIdNamecontact.caller_id_namecaller_id_nameCaller ID name published by the carrier
aiNotescontact.ai_notesai_notesNotes Ody took from conversations, one per line. Cannot be sorted on

Each is text or null. They are the same fields the Contacts API returns, and that is where you change them: the Database API reads them and never writes them. Values are returned as stored. A state can be TX on one contact and Texas on another when a person typed one of them, so prefer contains or a list of spellings over an exact match on an address field.

Contacts in Texas on a mobile line
curl -G https://api.ody.co/v1/api/data/rows \
  -H "Authorization: Bearer $ODY_API_KEY" \
  --data-urlencode 'filter=[{"column":"contact.address_state","op":"is","value":"TX"},{"column":"contact.phone_line_type","op":"is","value":"mobile"}]'

#Describe the table

GET/v1/api/data/schema

Returns the workspace's columns and the two tables that POST /data/query can read, with the exact SQL name and type of every column. Call this first when you write SQL, or give it to an AI assistant so it uses real column names.

Scope: contacts:read

Returns { columns: Column[], tables: Table[], limits }. Each table column has name, sql (how to write it in a query), type and description.

curl https://api.ody.co/v1/api/data/schema \
  -H "Authorization: Bearer $ODY_API_KEY"
Response
{
  "columns": [
    { "id": "5c1e…", "key": "plan", "name": "Plan", "kind": "attribute", "type": "select", "options": ["Free", "Pro"], "aiEnabled": false, "fillRule": "latest", "auto": false },
    { "id": "9a40…", "key": "project_type", "name": "Project type", "kind": "attribute", "type": "select", "options": ["Kitchen", "Bathroom"], "aiEnabled": true, "fillRule": "latest", "auto": true }
  ],
  "tables": [
    {
      "name": "contacts",
      "description": "One row per contact: the contact's own fields and one column per data column.",
      "columns": [
        { "name": "id", "sql": "id", "type": "id", "description": "The contact's id." },
        { "name": "name", "sql": "name", "type": "text", "description": "First and last name together." },
        { "name": "plan", "sql": "plan", "type": "text", "description": "Plan (one of: Free, Pro)", "columnKey": "plan" }
      ]
    },
    { "name": "observations", "description": "One row per thing Ody heard a contact say, with when and where.", "columns": [] }
  ],
  "limits": { "queryRows": 1000, "queryChars": 4000, "queryTimeoutMs": 5000, "pageSize": 100 }
}

#List columns

GET/v1/api/data/columns

Returns the columns in table order.

Scope: contacts:read

Returns { columns: Column[] }.

curl https://api.ody.co/v1/api/data/columns \
  -H "Authorization: Bearer $ODY_API_KEY"

#Add a column

POST/v1/api/data/columns

Creates a column. kind and type cannot be changed afterwards. There is no maximum number of columns. A column you create has auto: false.

With aiEnabled: true, Ody starts filling the column from new calls and texts, using description as its instruction. A signal column that Ody fills needs a description. Ody does not fill columns for card numbers, government IDs, passwords or health details.

Scope: data:manage

Body

  • name string required — Up to 60 characters. The key is made from it.
  • kind string — attribute (default) or signal.
  • type string — text (default), number, date, boolean, select, multi_select. Ignored for a signal.
  • description string — Up to 200 characters.
  • options array of strings — Up to 50 choices of up to 80 characters.
  • allowNewOptions boolean — Default false.
  • aiEnabled boolean — Default false.
  • fillRule string — latest (default), once or collect.

Returns 201 with { column }.

curl https://api.ody.co/v1/api/data/columns \
  -H "Authorization: Bearer $ODY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Plan",
    "type": "select",
    "options": ["Free", "Pro", "Enterprise"]
  }'

#Change a column

PATCH/v1/api/data/columns/:column

Changes a column, addressed by key or id. Only the fields you send change. key, kind and type never change. Removing a choice from options does not remove it from rows that already hold it.

Scope: data:manage

Body — any of name, description, options, allowNewOptions, aiEnabled, fillRule.

Returns { column }.

curl -X PATCH https://api.ody.co/v1/api/data/columns/plan \
  -H "Authorization: Bearer $ODY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "name": "Tier", "options": ["Free", "Pro", "Enterprise", "Partner"] }'

#Delete a column

DELETE/v1/api/data/columns/:column

Deletes the column, every value in it, and the history behind those values. This cannot be undone.

Deleting a column that Ody added (auto: true) also tells Ody not to add a column with that meaning again.

Scope: data:manage

Returns { ok: true }.

curl -X DELETE https://api.ody.co/v1/api/data/columns/plan \
  -H "Authorization: Bearer $ODY_API_KEY"

#Summarise a column

GET/v1/api/data/columns/:column/summary

Counts one column across all contacts: how many contacts have a value, how many of those Ody filled, the most common values, and the range of a number or date column.

This is how you count a multi_select column by choice, which SQL cannot group.

Scope: contacts:read

Returns { summary }.

curl https://api.ody.co/v1/api/data/columns/plan/summary \
  -H "Authorization: Bearer $ODY_API_KEY"
Response
{
  "summary": {
    "column": "plan",
    "name": "Plan",
    "contacts": 1840,
    "filled": 1212,
    "filledByAi": 430,
    "top": [
      { "value": "Pro", "count": 701 },
      { "value": "Free", "count": 455 },
      { "value": "Enterprise", "count": 56 }
    ],
    "numbers": null,
    "dates": null,
    "occurrences": null
  }
}

#List rows

GET/v1/api/data/rows

Returns one page of rows, one per contact, newest contact first unless you sort. Use q, filter and sort to narrow and order the page. For totals and grouping, use SQL.

Scope: contacts:read

Query parameters

  • q string — Search name, company, phone and e-mail.
  • filter string — A JSON list of up to 20 filters. All of them must match. See below.
  • sort string — A column key, or contact.name, contact.company, contact.created_at. With AI Contact on, also a card field such as contact.address_state (every card field except contact.ai_notes).
  • dir string — asc (default) or desc.
  • limit integer — 1–100, default 50.
  • cursor string — nextCursor from the previous page.

A filter is { "column", "op", "value" }. column is a column key, or one of contact.name, contact.phone, contact.email, contact.company, contact.tags, contact.created_at. With AI Contact on, it can also be a card field, written contact.address_state or contact.addressState. op is one of is, is_not, contains, not_contains, gt, gte, lt, lte, empty, not_empty. empty and not_empty take no value.

Returns { rows: Row[], total: number, nextCursor: string | null }. total counts every matching contact, not only this page. Rows in a list have no cells.

curl -G https://api.ody.co/v1/api/data/rows \
  -H "Authorization: Bearer $ODY_API_KEY" \
  --data-urlencode 'filter=[{"column":"plan","op":"is","value":"Pro"},{"column":"seats","op":"gte","value":10}]' \
  --data-urlencode 'sort=renewal_date'

#Find a row by phone number or e-mail

GET/v1/api/data/rows/lookup

Returns the row of the contact who has this phone number or e-mail address. Send exactly one of the two. This is the call to make when a conversation starts and your agent needs to know who it is talking to.

Phone numbers are matched in E.164. A number written another way, such as (512) 555-0199, is converted first.

Scope: contacts:read

Query parameters

  • phone string — E.164. URL-encode the + as %2B.
  • email string — Matching ignores case.

Returns { row }, or 404 not_found when no contact has it.

curl "https://api.ody.co/v1/api/data/rows/lookup?phone=%2B15125550199" \
  -H "Authorization: Bearer $ODY_API_KEY"

#Get a row

GET/v1/api/data/rows/:contactId

Returns one contact's row, with cells.

Scope: contacts:read

Returns { row }.

curl https://api.ody.co/v1/api/data/rows/8b1d6f3e-2c4a-4e1b-9f0d-7a5c3e2b1a90 \
  -H "Authorization: Bearer $ODY_API_KEY"

#Set values on a row

PUT/v1/api/data/rows/:contactId

Sets the columns you send on one contact's row and leaves the other columns alone. null clears a value.

The call is all or nothing: if one value does not fit its column, nothing is written and the error names the column.

Scope: contacts:write

Body

  • data object required — Column key → value.

Returns { row }.

curl -X PUT https://api.ody.co/v1/api/data/rows/8b1d6f3e-2c4a-4e1b-9f0d-7a5c3e2b1a90 \
  -H "Authorization: Bearer $ODY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "data": { "plan": "Enterprise", "seats": 40, "renewal_date": null } }'

#Find or create a contact and set values

POST/v1/api/data/rows/upsert

Finds the contact by id, phone number or e-mail and sets values on its row. When no contact has the phone number or e-mail, the contact is created first. Use it to load rows from a CRM, a spreadsheet, an order system or an enrichment tool without looking up contact ids.

  • Values are checked first. If one value does not fit its column, the call fails and nothing is created or written.
  • An existing contact's own fields are not changed. contact is used only when a contact is created. Use PATCH /contacts/:id to change a name or company.
  • A number that already called or texted is matched. Ody creates a contact for every new number, so the upsert finds it rather than adding a second one.

One call writes one row. To load many rows, send one call per row and stay under the rate limit of 600 requests a minute.

Scope: contacts:write

Body

  • match object required — Exactly one of contactId, phone, email.
  • contact object — For a new contact: firstName, lastName, company, phone, email, tags.
  • data object — Column key → value.

Returns 201 with { row, created: true } when the contact was created, 200 with { row, created: false } when it existed. A contactId that does not exist returns 404.

curl https://api.ody.co/v1/api/data/rows/upsert \
  -H "Authorization: Bearer $ODY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "match": { "phone": "+15125550199" },
    "contact": { "firstName": "Dana", "lastName": "Reyes", "company": "Brightline" },
    "data": { "plan": "Pro", "seats": 12, "renewal_date": "2027-03-01" }
  }'

#Query with SQL

POST/v1/api/data/query

Runs one read-only SELECT over two tables: contacts (one row per contact, with your columns) and observations (one row per thing Ody heard a contact say). The full dialect, with examples, is on Database: SQL reference.

Your statement is not sent to the database as written. Ody parses it, checks every name against your columns, and builds its own query with every value bound as a parameter. That is why only the listed keywords and functions work, and why an unsupported query fails with a message that says what to change.

Scope: contacts:read

Body

  • sql string required — One SELECT statement, up to 4,000 characters.

Returns { columns, rows, rowCount, truncated }. columns gives the name and type of each output column, and each row is an object keyed by those names. A call returns at most 1,000 rows; truncated: true means more rows matched, and you can page with LIMIT and OFFSET. A query that runs longer than 5 seconds is stopped and returns 400.

curl https://api.ody.co/v1/api/data/query \
  -H "Authorization: Bearer $ODY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "sql": "SELECT plan, count(*) AS contacts FROM contacts WHERE asked_about_pricing GROUP BY plan ORDER BY contacts DESC" }'
Response
{
  "columns": [
    { "name": "plan", "type": "text" },
    { "name": "contacts", "type": "number" }
  ],
  "rows": [
    { "plan": "Pro", "contacts": 212 },
    { "plan": "Free", "contacts": 87 }
  ],
  "rowCount": 2,
  "truncated": false
}

#Errors

Errors use the standard envelope. The ones specific to the Database:

StatuscodeWhen
400invalid_argumentA value does not fit its column, data names a column that does not exist, a filter is malformed, or the SQL is not supported. The message names the column or the position in the query.
403permission_deniedThe key lacks contacts:read, contacts:write or data:manage.
404not_foundThe contact or the column does not exist. A column 404 lists the keys that do.
409failed_preconditionThe Database is not switched on for this workspace.

#Not available yet

  • Webhooks. There is no event when a cell changes. Poll with GET /data/rows, or query observations by observed_at.
  • Bulk writes. One call writes one row.
  • The contact's words. observations gives the value, date and channel of what Ody heard, not the quote. The quote is shown in the app.
Last updated Sun Nov 29 2026 00:00:00 GMT+0000 (Coordinated Universal Time)Something wrong on this page? Tell us