Manage sales opportunities/deals in Dalil AI CRM — create, read, update, delete, search, and list opportunity records including deal name, amount (in micros), stage, close date, and point-of-contact associations.
Dalil AI: Opportunity API Skills
Quick Reference
Base URL:
https://app.usedalil.aiAuth:
Authorization: Bearer {apiKey}Content-Type:
application/json(POST/PATCH requests only)Accept:
application/json(GET requests)Resource path:
/rest/opportunities
GraphQL search (POST /graphql):
searchInputis a plainString!variable — do NOT pass as an object{query: "...", includedObjectNameSingulars: [...]}(causes type error)limitmust be hardcoded in the query string — do NOT pass as a$limitvariable (causes type error)Returns IDs only — always follow up with REST to fetch full records
Endpoints
Operation | Method | Path | Required Fields |
|---|---|---|---|
Create | POST |
|
|
Get | GET |
|
|
List | GET |
| — |
Update | PATCH |
|
|
Delete | DELETE |
|
|
Search by name | POST |
|
|
Create Opportunity
Request Body
Required Fields
name(string) — Opportunity name
Optional Fields
amount.amountMicros(number) — Deal amount in micros (multiply by 1,000,000)amount.currencyCode(string) — Three-letter currency code, e.g. "USD"stage(string) — Pipeline stage in UPPER_SNAKE_CASE:DISCOVERY,PROPOSAL,NEGOTIATION,CLOSED_WON,CLOSED_LOSTcloseDate(string) — Expected close date in ISO 8601 formatcompanyId(UUID) — Associated companypointOfContactId(UUID) — Main contact personownerId(UUID) — Opportunity owner (workspace member)
Update Opportunity
Send only fields to update. Same shapes as create. name is also updatable.
Get Opportunity
List Opportunities
Delete Opportunity
Search Pattern
Search by name only (GraphQL + REST):
Step 1 — GraphQL:
POST to https://app.usedalil.ai/graphql
Step 2 — Fetch:
Filter Examples
Gotchas
Amount is in micros —
$50,000=50000000000micros. Multiply actual amount by 1,000,000.Stage values are UPPER_SNAKE_CASE — Use
CLOSED_WON, notClosed Wonorclosed_won.Amount is a nested object — Use
{ "amount": { "amountMicros": 50000000000, "currencyCode": "USD" } }.Close date is ISO 8601 — Use format
2024-06-15T00:00:00.000Z.Search is name-only — Unlike Person/Company, no field-specific search (email, domain, etc.).
GraphQL search returns IDs only — Follow up with
GET /rest/opportunities?filter=id[in]:[id1,id2]to fetch full records.Amount filter uses nested path — Use
amount.amountMicros[gt]:value.GraphQL
limitmust be hardcoded, not a variable — Passing$limit: Intas a variable causes a type error. Inline it directly:limit: 5.depth=1responses are large — Usedepth=0if you only need the opportunity's own fields without relations.URL-encode GET filter params — Filter strings contain special characters (
[,],:) that break manually constructed URLs. Use URL encoding when making requests (e.g.,curl -G --data-urlencode "filter=...").