canonical: https://jentic.com/apis/dalil-ai.supabase.co/dalil-ai

# Dalil Ai Supabase Dalil OAuth Resource API

Jentic publishes the only available OpenAPI specification for Dalil OAuth Resource API, keeping it validated and agent-ready. Dalil is an AI-led CRM that exposes leads, contacts, accounts, deals, and calendar events to OAuth-authenticated clients via 45 endpoints running on Supabase Edge Functions. The API covers full CRUD on each CRM resource, plus inbound webhook handlers for emails and calendar events, OAuth token issuance and refresh, user invite and lifecycle endpoints, and a metadata namespace for groups, custom fields, tags, labels, stages, and priorities.

## For AI agents

Create and update leads, contacts, accounts, deals, and calendar events in the Dalil AI CRM through OAuth-authenticated REST endpoints.

## Scope

Does not handle marketing campaign sends, support ticketing, or product analytics - use for Dalil CRM lead, contact, account, deal, and calendar event management only.

## Capabilities

- Create or search leads with partial-match and exact-AND search modes
- Create or update contacts and pull a polling feed of all contact records
- Create or update accounts and search the account book by criteria
- Manage deals through the pipeline with create, search, and update operations
- Create, update, and delete calendar events tied to a Dalil user
- Issue and refresh OAuth tokens for an integration app and resolve user identity via `/oauth/me`
- Invite, update, and delete Dalil users via the user-management endpoints

## Use cases

### Lead Capture From External Forms

Marketing tools that capture leads through web forms or third-party advertising platforms post the captured payload to POST /leads to create the lead in Dalil. The agent then optionally calls GET `/leads/search_by_and` to deduplicate against existing records before creation, ensuring a clean lead book without manual cleanup.

Example prompt: POST {"email":"jane@acme.com","first_name":"Jane"} to /leads after confirming GET `/leads/search_by_and` returns no match.

### Pipeline Reporting Sync

BI teams that need a daily snapshot of the Dalil deal pipeline call GET `/deals/polling_trigger` and write the response into a warehouse table. Combining the deal pull with GET `/metadata/core/stage` gives meaningful stage names rather than internal IDs, so dashboards show 'Negotiation' rather than a UUID.

Example prompt: Call GET `/deals/polling_trigger` plus GET `/metadata/core/stage` and join the results into a warehouse 'fact_deal_daily' table.

### Calendar-Driven Activity Logging

When a sales rep books a meeting in their calendar, the inbound /calendar-event-webhook hands the event to Dalil, which then surfaces it via GET /events. An agent reads the events feed daily and creates matching activity records against the deal owner so coaching reviews see the meeting cadence without manual logging.

Example prompt: Call GET /events for the past day, group by user_id, and POST a daily activity summary to a Slack channel.

### Tenant Bootstrapping for a New Customer

When a new Dalil customer onboards, an integration agent provisions the workspace by calling POST /user-invite for each team member, GET `/metadata/groups` and `/metadata/custom-fields` to mirror configuration from a template tenant, and POST /generate-integration-app-token to set up the integration credentials. This replaces hours of click-through onboarding.

Example prompt: Loop the new-customer team email list and POST /user-invite for each, then POST /generate-integration-app-token and store the result in the integration vault.

### Agent-Driven CRM Updates

An AI agent acting as a sales assistant takes a meeting note and updates the matching Dalil deal: it calls GET `/deals/search` to find the deal, then PUT `/deals/update` with the new stage, amount, and next-step. Through Jentic the OAuth bearer token is scoped per call so the agent never sees the raw client secret.

Example prompt: Given a meeting transcript, GET `/deals/search` by company name and PUT `/deals/update` with stage='Negotiation' and the parsed amount.

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| POST | `/leads` | Create a new lead |
| GET | `/leads/search` | Search leads (partial match) |
| POST | `/contacts` | Create a new contact |
| POST | `/deals` | Create a deal |
| PUT | `/deals/update` | Update a deal |
| POST | `/events` | Create a calendar event |
| POST | `/oauth/token` | Generate OAuth tokens |
| GET | `/oauth/me` | Get current user info |

## Key resources

- **Leads** — Top-of-funnel records with create, search, update, and bulk retrieval
- **Contacts** — Person records with search and polling endpoints
- **Accounts** — Company records with create, search, and update
- **Deals** — Pipeline opportunity records with full CRUD
- **Events** — Calendar events including create, update, delete, and webhook handlers
- **OAuth** — Token issuance, refresh, identity, and public-key endpoints
- **User management** — User invite, update, delete, and metadata endpoints
- **Metadata** — Groups, custom fields, tags, labels, stages, and priorities

## Why Jentic

- **Setup:** Wiring Dalil by hand means learning its bearer auth, running the `/oauth/token` exchange, and pointing every call at the Supabase Edge Function base yourself. Through Jentic you install once, import the Dalil OAuth Resource API from the API Directory, store the credential once, and your agent calls it.
- **Permission scoping:** Dalil identifies leads, contacts, and deals through the request body rather than a resource id in the path, so limit the agent to the operations it needs, such as creating a lead or updating a deal. Every operation the agent can run is one you added to that allowed set.
- **Credential handling:** Your Dalil client credentials and issued bearer tokens are stored once, encrypted, by your own Jentic One instance and injected at execution time. They never enter the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'create a Dalil lead' or 'update a Dalil deal', and Jentic returns the matching operation with its input schema so the agent calls the right endpoint without reading the Supabase Edge Function definitions.

## Related APIs

- **HubSpot Marketing Events API** — Mature CRM with deeper marketing automation and a much wider API surface than Dalil.
- **Pipedrive API** — SMB-focused pipeline CRM with similar deal-stage and contact model.
- **Salesforce API** — Enterprise CRM platform with much wider customisation and a heavier integration footprint.
- **Zendesk API** — Customer support ticket data that can be synced into Dalil contact records for a unified view.

## FAQ

### Why is there no official OpenAPI spec for Dalil OAuth Resource API?

Dalil does not publish an OpenAPI specification. Jentic generates and maintains this spec so that AI agents and developers can call Dalil OAuth Resource API via structured tooling. It is validated against the live API and kept up to date. Get started with Jentic One, the self-hosted execution layer.

### What authentication does the Dalil OAuth Resource API use?

The API uses HTTP Bearer authentication backed by an OAuth 2.0 flow. Clients call POST `/oauth/token` to obtain an access token, then pass it as Authorization: Bearer <token> on every CRM call. POST `/oauth/refresh` trades a refresh token for a fresh access token. Through Jentic the OAuth client credentials and access tokens are stored encrypted in the vault and surfaced to the agent as scoped runtime credentials.

### Can I create a lead with the Dalil API?

Yes. POST /leads accepts the lead's email, name, and any custom field values configured in the tenant. To deduplicate first, call GET `/leads/search_by_and` with the email value before creation; the API also exposes `/leads/search` for partial-match queries and `/leads/polling_trigger` for full-list retrieval.

### What are the rate limits for the Dalil OAuth Resource API?

The Dalil API runs on Supabase Edge Functions, which apply per-project concurrency limits rather than a documented per-second cap. Treat 25 concurrent requests as a practical ceiling and pace bulk syncs through the polling_trigger endpoints rather than firing many parallel search calls.

### How do I update a Dalil deal through Jentic?

Install pip install jentic and run an agent with the search query 'update a deal in Dalil'. Jentic returns the PUT `/deals/update` operation with its input schema; the agent supplies the deal ID and the fields to change (stage, amount, owner) and calls execute. The OAuth bearer token is fetched from your Jentic One instance for the call.

### Can I import all contacts in one call?

Use GET `/contacts/polling_trigger` to retrieve every contact record. The endpoint is intended for polling-style sync jobs that mirror the Dalil contact book into another system on a schedule, with `/contacts/search` reserved for ad-hoc lookups.

### Does the Dalil API expose webhooks for inbound events?

Yes. POST /email-receive-webhook, POST /email-bulk-process-webhook, and POST /calendar-event-webhook accept inbound payloads from email and calendar providers, and the API processes the event into the matching CRM record. These are configured at the integration provider rather than enabled through this API surface.

### Can I limit what my agent is allowed to do with the Dalil API?

Yes. Because you run Jentic One yourself, your own rules decide which Dalil operations and credentials the agent can use, so you can allow it to create a lead with POST /leads while withholding update or delete calls such as PUT `/deals/update.` Dalil identifies leads, contacts, and deals through the request body rather than an id in the path, so scoping happens at the operation level: every endpoint the agent can reach is one you added to its allowed set. Your Dalil OAuth client credentials and bearer tokens stay with your Jentic One instance and are injected at execution time, so the agent never handles the raw secret.
