API · v1 · stable
CODEMETA OSDeveloper Center
EN
Open console
Entity · opportunities

Opportunity Schema

Schema ID
opportunity
Collection
opportunities
Permissions
  • Readopportunity_view
  • Createopportunity_create
  • Editopportunity_edit
  • Deleteopportunity_delete

Fields

Opportunity Schema

opportunities4 permissions

Schema for validating sales opportunity entities

titlestringrequired

Opportunity title

1–300 characters
descriptionstringoptional

Detailed description (plain text)

max 5000 charactersnullable
descriptionHtmlstringoptional

Rich text HTML version of the opportunity description

nullable
statusstringrequired

Pipeline status (tenant-configurable)

prioritystringoptional

Opportunity priority level

LOWNORMALHIGHCRITICAL
Default: "NORMAL"
pipelineIduuidoptional

Sales pipeline UUID (references sales_pipelines collection)

nullable
partyIduuidoptional

Customer party UUID

nullable
partyAddressIduuidoptional

Specific site/address of the associated party

Default: nullnullable
contactPartyIduuidoptional

Contact person UUID

nullable
assignedToIduuidoptional

Assigned sales rep user UUID

nullable
orgUnitIduuidoptional

Organization unit UUID

nullable
valuestringoptional

Deal value / CLV (Decimal128 as string, synced with customerLifetimeValue)

Patternnullable
onetimeRevenuestringoptional

One-time revenue (hardware, projects, migrations)

Patternnullable
monthlyRecurringstringoptional

Monthly recurring revenue (MRR)

Patternnullable
contractDurationMonthsnumberoptional

Minimum contract duration in months

1 – 120nullable
estimatedLifetimeMonthsnumberoptional

Estimated customer lifetime in months (manual override; auto-calculated from party churn data or tenant default if null)

1 – 600nullable
annualRecurringRevenuestringoptional

ARR = MRR × 12

Patternnullable
totalContractValuestringoptional

TCV = onetime + (MRR × contractDurationMonths)

Patternnullable
customerLifetimeValuestringoptional

CLV = onetime + (MRR × estimatedLifetimeMonths)

Patternnullable
weightedValuestringoptional

Weighted value = CLV × (probability / 100)

Patternnullable
currencyCodestringoptional

ISO 4217 currency code

max 3 charactersDefault: "EUR"
probabilitynumberoptional

Win probability in percent

0 – 100nullable
expectedCloseDatedateoptional

Expected close date (YYYY-MM-DD)

nullable
dueDatedateoptional

Due date — act on the opportunity by this day (YYYY-MM-DD)

nullable
sourcestringoptional

Lead source (references opportunity_sources name)

max 100 charactersnullable
contractIduuidoptional

Linked contract UUID

nullable
projectIduuidoptional

Linked project UUID

nullable
lostReasonstringoptional

Reason for losing the opportunity

max 2000 charactersnullable
mergedIntoOpportunityIduuidoptional

If set, this opportunity was merged into the referenced opportunity

nullable
mergedIntoOpportunityNumberstringoptional

Opportunity number of the opportunity this was merged into (denormalized for display)

nullable
tagsstring[]optional

Tags

Default: []nullable
attachmentsobject[]optional
Default: []nullable
s3Keystringrequired
fileNamestringrequired
mimeTypestringrequired
sizeBytesnumberrequired
uploadedAtdatetimerequired
uploadedByuuidrequired
isInternalbooleanrequired
linkedEntitiesobject[]optional
Default: []nullable
entityTypestringrequired
partyassetticketprojectuseropportunityproposalarticletaskcomplaintproblem
entityIduuidrequired
rolestringrequired
convertedToobjectoptional

Set when this opportunity was converted to another entity (ticket). The opportunity is kept — not deleted — so linked records stay reachable. Written only by the conversion routes.

read-onlynullable
entityTypestringrequired
ticketopportunitycomplaint
entityIduuidrequired
convertedAtdatetimeoptional
nullable
convertedBystringoptional
nullable
convertedFromobjectoptional

Set when this opportunity was created by converting another entity (ticket). Written only by the conversion routes.

read-onlynullable
entityTypestringrequired
ticketopportunitycomplaint
entityIduuidrequired
convertedAtdatetimeoptional
nullable
convertedBystringoptional
nullable
lineItemsobject[]optional
Default: []nullable
iduuidrequired
articleIduuidoptional

Article UUID (null = free-text manual position)

nullable
articleNamestringoptional

Denormalized article name at request time

nullable
articleNumberstringoptional

Denormalized article number at request time

nullable
quantitystringrequired

Requested quantity

Pattern
unitstringoptional

Unit label snapshot from the article (e.g. "Stk", "h")

max 100 charactersnullable
unitPricestringoptional

Quoted unit price (null = price on request)

Patternnullable
billingIntervalstringoptional

Billing interval — drives MRR/onetime auto-calculation. Null is treated as ONE_TIME.

nullONE_TIMEMONTHLYYEARLY
nullable
currencyCodestringoptional

ISO 4217 currency code

max 3 charactersnullable
sourcestringoptional

Origin of the line item

nullportalmanualproposalsales_orderai
nullable
optionalbooleanoptional

Optional position — offered, but not counted into MRR/onetime. Becomes an optional quotation position (weclapp quotationItem.optional). Missing/null = false.

nullable
requestedAtdatetimeoptional

When the article was added to the opportunity

nullable
notestringoptional

Per-item note (e.g. customer remark)

max 1000 charactersnullable
alternativesobject[]optional

Alternative positions offered alongside this line (e.g. cheaper / premium variant). Not aggregated into MRR/onetime.

Default: []nullable
iduuidrequired
articleIduuidoptional
nullable
articleNamestringoptional
nullable
articleNumberstringoptional
nullable
quantitystringoptional
Patternnullable
unitstringoptional
max 100 charactersnullable
unitPricestringoptional
Patternnullable
billingIntervalstringoptional
nullONE_TIMEMONTHLYYEARLY
nullable
currencyCodestringoptional
max 3 charactersnullable
notestringoptional
max 1000 charactersnullable
risksobject[]optional

Internal calculation risks of the offer (extra effort, delivery, price, scope)

max 12 itemsDefault: []nullable
iduuidrequired
titlestringrequired
1–120 characters
detailstringoptional
max 500 charactersnullable
effectstringoptional
nullhourspricedeliveryscopeother
nullable
sourcestringoptional
nullmanualai
nullable
assumptionsstring[]optional

Customer-facing assumptions / scope boundaries the offer is based on (one sentence each)

max 12 itemsDefault: []nullable
statusChangedAtdatetimeoptional

Timestamp of the last status change (drives time_in_status / time_to_status targets, ADR 0117a)

nullable
inboundReplyAckedAtdatetimeoptional

Timestamp at which the latest inbound prospect email was acknowledged as "handled, no reply needed". Clears the awaiting-reply badge when >= the last inbound email time; a newer inbound email re-arms the badge. Mirrors ticket.inboundReplyAckedAt.

nullable
inboundReplyAckedBystringoptional

User who acknowledged the latest inbound prospect email (see inboundReplyAckedAt).

nullable
awaitingReplyPinnedAtdate-time[]optional

Timestamps of unanswered inbound customer emails that were carried over by a merge and that the standard computation can no longer see. The awaiting-reply badge derives from "inbound emails newer than the last OUTBOUND email of the record" — after a merge that comparison spans two formerly independent conversations, so a reply in one thread silently marks an open question in the other as answered. The merge therefore pins the affected timestamps here; the badge counts them in addition to the computed ones. Cleared by ack-inbound-reply. Server-managed (see merge.service.ts).

nullable
snoozedUntildatetimeoptional

Opportunity is snoozed until this timestamp; hidden from active pipeline views

nullable
snoozedByuuidoptional

User who snoozed the opportunity

nullable
snoozedAtdatetimeoptional

When the opportunity was snoozed

nullable
snoozeReasonstringoptional

Reason provided when snoozing

max 500 charactersnullable
snoozeFollowUpTaskIduuidoptional

ID of the follow-up task created at snooze time (due at snoozedUntil). Cleared on unsnooze.

nullable
snoozeWokenAtdatetimeoptional

Set by the snooze-wakeup worker when snoozedUntil passed. snoozedUntil/snoozeReason stay in place so the board can flag the opportunity as "Wiedervorlage fällig" (red) until a user acts on it; it also makes the wakeup fire exactly once. Cleared on snooze/unsnooze. Absent on documents predating the field = never woken (no backfill needed).

nullable
targetsobject[]optional

Denormalized active service targets (ADR 0117a)

nullable
stageIdstringrequired
stageKindstringrequired
time_to_first_responsetime_in_statustime_to_statustime_to_close
stageStatusstringoptional
nullable
stageLabelstringoptional
nullable
bindingnessstringrequired
contractualinternal
deadlinedatetimerequired
breachedAtdatetimeoptional
nullable
completedAtdatetimeoptional
nullable
profileIduuidrequired
sourceRefobjectoptional

Provenance marker for the source system a weclapp-born opportunity was imported from (ADR 0220). The weclapp sync anchor lives in externalReferences[system="weclapp"], NOT here.

Default: nullnullable
systemstringrequired

Source system identifier (e.g. weclapp)

idstringrequired

Entity ID in the source system

externalReferencesobject[]optional

Cross-system linking refs (e.g. weclapp). The weclapp entry is the identity anchor for the bidirectional opportunity sync (ADR 0220). Read/written by the inbound + outbound sync workers and indexed for duplicate prevention.

Default: []nullable
systemstringrequired
max 100 characters
externalIdstringrequired
max 200 characters
externalVersionstringoptional
nullable
externalNumberstringoptional
max 200 charactersnullable
syncedAtdatetimeoptional
nullable
lastSyncCorrelationIdstringoptional
nullable
lastInboundHashstringoptional
max 64 charactersnullable
lastOutboundHashstringoptional
max 64 charactersnullable

Standard endpoints

This resource follows the platform's generic CRUD contract. Read the conventions for pagination, idempotency, optimistic locking and audit. The most important endpoints:

  • GET /api/v1/opportunities — List, paginated + filterable
  • GET /api/v1/opportunities/<id> — Single entity
  • POST /api/v1/opportunities — Create
  • PATCH /api/v1/opportunities/<id> — Partial update
  • DELETE /api/v1/opportunities/<id> — Soft delete
  • GET /api/v1/opportunities/<id>/timeline — Audit + activities

Search