Rethink Carbon
Guides

CDOP API profile (proposal)

Status: draft, written with milestone M1 of the reference API. Offered to the CDOP Technical Working Group as a companion to the document schemas.

The CDOP schemas say what a document contains. They do not say how a server identifies records, how a client detects change, how lists are paged, how errors look, or how one registry's status words compare with another's. Two conformant servers could still be impossible to synchronise with the same client. This profile fills that gap. Everything in it is implemented by the reference API, so each rule can be tried against a running server.

The key words MUST, SHOULD and MAY are used in the usual sense.

1. Identifiers

1.1 Strings everywhere

Every identifier MUST be a JSON string. Integers do not carry registry-native ids (VCS-4721) and an unscoped small integer cannot join two documents. See CDOP-FB-011.

The reference API uses opaque, prefixed, ULID-shaped ids: a three-letter prefix, an underscore, and 26 Crockford base32 characters.

PrefixEntityPrefixEntity
prjprojectuntunit block
ississuancevalvalidation event
vrfverification eventestestimation
esvestimation vintageagragreement
gisgeolocation filedocdocument
accaccountorgorganisation
mstmilestoneevtevent
whkwebhookwhdwebhook delivery
trftransferretretirement
cnlcancellationbpebuffer pool entry
pshproject status recordushunit status record

Seeded ids are derived from a hash of a tag, so a reseed reproduces them. Ids minted at runtime carry a millisecond time component and sort by creation time.

1.2 The CDOP URN

project.project_identifier is the global identifier. Its grammar:

Code
cdop-urn = "cdop:" registry ":" native-id [ ":" batch ] registry = 1*( ALPHA / DIGIT / "-" ) ; slug of the registry that minted native-id native-id = 1*( VCHAR except ":" ) ; the registry's own project id, verbatim batch = 1*( VCHAR except ":" ) ; an issuance batch within the project

Examples: cdop:ukl:104000000012345, cdop:verra:4721, cdop:verra:4721:B2.

The registry slug is the authority. The reference API keeps one slug per CDOP registry name (35 names) in its registry table, with the registry's URL and a project_url_template. A country is not an authority: one registry issues ids across many countries, and a project can change registry but not country. The upstream examples use cdop:KEN:VCS-4721, which this profile does not recommend. See CDOP-FB-010.

issuance.issuance[].batch_identifier is the project URN with a batch suffix.

A server MUST resolve any URN it knows:

Code
GET /v2/identifiers/cdop:verra:4721 → 303 See Other, Location: /v2/projects/prj_… GET /v2/identifiers/cdop:verra:4721:B2 → 303 See Other, Location: /v2/issuances/iss_…

1.3 Native ids beside global ids

A resource MUST carry both the URN and the registry's native id (current_registry_project_id). The native id is what a human types into the registry's website.

2. Timestamps and versions

FieldMeaningFormat
created_atWhen the server first stored the recordRFC 3339 date-time, UTC
modified_atWhen any field of the record, or of a child record, last changedRFC 3339 date-time, UTC
versionInteger, incremented on every changeinteger
*_onReal-world dates (registered, validated, issued)date
*_atSystem timesdate-time

Rules:

  • A child change (a new status record, a document, a unit block) MUST bump the parent project's modified_at and version. This makes modified_since on the project collection behave like a registry's own "modified date" filter.
  • ETag on a single resource is "v<version>". If-None-Match with a matching tag MUST return 304 Not Modified. Collections use a weak ETag.
  • Writes that can conflict (actions, PUT of a pod document) SHOULD honour If-Match. A stale tag returns 412 with problem type precondition-failed.
  • Registry records are append-only in spirit. A server MUST NOT hard-delete a project, issuance or unit block that has been published. Corrections are new status records. Where a row is removed in the database, the event feed carries a org.cdop.row.changed event with data.op = "delete" so consumers can reconcile.

3. Pagination

Collections use opaque cursors, never offsets.

ParameterMeaning
limitPage size. Default 20. Maximum 100 (250 for unit blocks).
cursorOpaque token from the previous page's _links.next. Invalid tokens return 400 with problem type cursor-invalid.
sortA field name, with a leading - for descending. Each collection publishes its sortable fields.

Responses carry total (an exact count), limit, and _links.next, _links.prev, _links.first, _links.up and a templated _links.search. Paging is keyset-based on the sort value plus the record id, so a page is stable while rows are inserted.

4. modified_since

GET /v2/projects?modified_since=2026-09-01T00:00:00Z&sort=modified_at returns every project whose modified_at is at or after the instant, oldest first. A client that stores the last modified_at it saw and repeats the query has a complete, ordered change list at the project level. The reference API indexes (modified_at, id) for this query.

For finer detail, or for deletions, use the events model.

5. Events

5.1 Envelope

Events are CloudEvents 1.0, structured JSON.

AttributeValue
idevt_…
sourceAbsolute URL of the resource that changed
typeSee 5.2
subjectThe entity id
timeBusiness time of the change (effective_at)
datacontenttypeapplication/json
dataschemaURL of the event's JSON Schema (apps/api/schemas/events/*.schema.json)
sequence (extension)The outbox sequence as a string; the SSE id and Last-Event-ID
actor, origin (extensions)Who caused it; api, simulator, seed or db
correlationid (extension)The Idempotency-Key of the request that caused it
apiversion (extension)The API version

data is { entity, id, project_id, action, status: { from, to, status_reason, effective_at, is_current }, changes, version, _links }.

5.2 Types

Rule 1: every append of a status record is org.cdop.<entity>.status.changed, for entity in project, unit, issuance, validation, verification, estimation, geolocation_file, agreement.

Rule 2: facts that are not status changes have their own types: org.cdop.project.created, org.cdop.project.updated, org.cdop.unit.issued, org.cdop.unit.transferred, org.cdop.unit.split, org.cdop.unit.converted, org.cdop.buffer_pool.deposited, org.cdop.buffer_pool.released, org.cdop.buffer_pool.reversal_covered, org.cdop.document.added, org.cdop.document.replaced, org.cdop.milestone.completed, org.cdop.milestone.overdue, org.cdop.account.created, org.cdop.account.updated, org.cdop.row.changed (a database-side edit captured by trigger), org.cdop.webhook.ping.

5.3 Transports

TransportRouteNotes
Server-sent eventsGET /v2/eventsFilters types (glob), project_id, subject. Resume with Last-Event-ID or since. Replays from the outbox, then goes live. Heartbeat every 15 s.
Pull feedGET /v2/changes?since=&types=&project_id=&limit=&wait=A HAL page of events. wait long-polls up to 30 s.
WebhooksPOST /v2/webhooks, …/actions/ping, …/deliveriesSigned per the Standard Webhooks specification. 8 retries over about 8 hours, then auto-disable.

Events are kept for 180 days or 500 000 rows. A Last-Event-ID older than retention returns a problem with a resync link to the collection.

5.4 Exactly-once for producers

Each event has a dedupe_key. Retried requests and re-runs of the simulator or the seed do not duplicate events.

6. Formats

Servers MUST emit, and the schema SHOULD declare:

Kind of fieldformat
Links: *_link, *_url, website, documenturi (absolute)
Email addressesemail
Real-world datesdate
Timestamps (file_created_on, *_at)date-time

See CDOP-FB-018 for the list of untyped fields in v2.0.

7. Required tiers

required in v2.0 is derived mechanically and includes Private fields (CDOP-FB-005, CDOP-FB-019). This profile proposes one annotation per field:

Code
x-cdop-required-tier: core | registry | private | optional
  • core: present in every public document.
  • registry: present once a registry record exists.
  • private: present only in documents exchanged under an agreement; never in the public required set.
  • optional: everything else.

required at each level is then generated from the tier, not from nested requireds. The existing annotations keep their meaning with canonical lowercase values: x-cdop-mutability: immutable | mutable, x-cdop-public-private: public | private.

8. Project lifecycle

8.1 The normalised enum

lifecycle_stage has eight values. Six form an ordered ladder; two are exits.

Code
draft → listed → registered → validated → verified → retired ↘ withdrawn (any) → rejected
ValueMeaning
draftKnown to a developer or code administrator; not yet accepted by a registry.
listedPublicly listed on a registry before registration (Verra "Listed", pipeline).
registeredAccepted onto the registry; UK codes register before validation.
validatedDesign validated by a VVB and accepted by the registry. Verra "Registered" maps here.
verifiedAt least one verification completed; verified units exist or are issuing.
retiredCrediting finished; the project is closed.
withdrawnLeft the registry before completion (withdrawn, de-registered, not delivered, inactive).
rejectedRefused by the code administrator, VVB or registry.

is_on_hold is an orthogonal boolean. Every project carries the triple registry_status {code, vocabulary}, CDOP status (the projected record) and lifecycle_stage.

8.2 CDOP project_status (17) → lifecycle

CDOP valuelifecycle_stage
Originationdraft
Pre-feasibilitydraft
Feasibilitydraft
Project design draftingdraft
Project design finalizationdraft
Listedlisted
Validationlisted
Validatedvalidated
Registeredregistered
Approvedvalidated
Authorizedvalidated
Verified and issuingverified
Completedretired
Withdrawnwithdrawn
De-registeredwithdrawn
Inactivewithdrawn
Rejectedrejected

8.3 CAD Trust project status (9) → lifecycle

CAD Trust valuelifecycle_stage
Listedlisted
Registeredregistered
Validatedvalidated
Verifiedverified
Certifiedverified
Completedretired
Withdrawnwithdrawn
Inactivewithdrawn
Rejectedrejected

8.4 Woodland Carbon Code native codes (UK Land Carbon Registry)

Owner is the seat whose action moves the project on. Source: apps/api/src/domain/lifecycle/wcc.ts.

Native codeNameOwnerlifecycle_stageCDOP status
NEWNewdeveloperdraftProject design drafting
PENDING_REVIEW_UNDER_DEVELOPMENT_ACTOR1Under Development - Pending Review (Customer)developerdraftProject design finalization
PENDING_REVIEW_UNDER_DEVELOPMENT_ACTOR2Under Development - Pending Review (Program)code_admindraftProject design finalization
PENDING_REVIEW_UNDER_DEVELOPMENT_ACTOR3Under Development - Pending Review (System)registrydraftProject design finalization
DEVELOPMENTUnder DevelopmentdeveloperregisteredRegistered
PENDING_REVIEW_ACTOR4Pending Review (Customer)developerregisteredValidation
PENDING_REVIEW_ACTOR5Pending Review (Validator)vvbregisteredValidation
PENDING_REVIEW_ACTOR6Pending Review (Program)code_adminregisteredValidation
PENDING_REVIEW_ACTOR7Pending Review (System)registryregisteredValidation
PENDING_PAYMENT_ACTOR7Pending PaymentregistryregisteredValidation
VALIDATEDValidatedregistryvalidatedValidated
SELF_ASSESSEDSelf AssesseddevelopervalidatedValidated
VERIFIEDVerifiedregistryverifiedVerified and issuing
NOT_DELIVEREDNot Deliveredcode_adminwithdrawnDe-registered
RETIREDRetireddeveloperretiredCompleted
WITHDRAWNWithdrawndeveloperwithdrawnWithdrawn
REJECTEDRejectedregistryrejectedRejected

Transitions follow the registry's own action names (SUBMIT_ACTOR1, APPROVE_ACTOR2, NEED_MORE_INFORMATION_ACTOR5, VALIDATE_ACTOR4, PENDING_PAYMENT_ACTOR7, NOT_DELIVERED, WITHDRAW, VERIFY, RETIRE_PROJECT). Each has an intent (submit, approve, more_info, reject, hold, release, withdraw, verify, issue, other) that the events and templates use.

8.5 Peatland Code native codes (UK Land Carbon Registry)

Source: apps/api/src/domain/lifecycle/pc.ts.

Native codeNameOwnerlifecycle_stageCDOP status
NEWNewdeveloperdraftProject design drafting
PENDING_CUST_DEVUnder Development - Pending Review (Customer)developerdraftProject design finalization
PENDING_REVIEW_UNDER_DEVELOPMENT_3RD_PARTYUnder Development - Pending Review (Program)code_admindraftProject design finalization
PENDING_MOP_UNDER_DEVUnder Development - Pending Review (System)registrydraftProject design finalization
DEVELOPMENTUnder DevelopmentdeveloperregisteredRegistered
PENDING_REVIEW_VALIDATION_CUSTOMERPending Review (Customer)developerregisteredValidation
PENDING_REVIEW_VALIDATION_VALIDATORPending Review (Validator)vvbregisteredValidation
PENDING_3RD_VALPending Review (Program)code_adminregisteredValidation
PENDING_REVIEW_VALIDATION_MARKITPending Review (System)registryregisteredValidation
VALIDATED_PENDING_PAYMENTValidated - Pending PaymentregistryregisteredValidation
VALIDATEDValidatedregistryvalidatedValidated
PENDING_VALIDATOR_RESTORATION_VALIDATIONPending Restoration Validation (Validator)vvbvalidatedValidated
PENDING_MOP_RESTORATION_VALIDATIONPending Restoration Validation (System)registryvalidatedValidated
RESTORATION_VALIDATEDRestoration ValidatedregistryvalidatedValidated
VERIFIEDVerifiedregistryverifiedVerified and issuing
RETIREDRetireddeveloperretiredCompleted
WITHDRAWNWithdrawndeveloperwithdrawnWithdrawn
REJECTEDRejectedregistryrejectedRejected

8.6 International standards (simplified, to be verified)

VCS, Gold Standard, ACR, Plan Vivo and Puro share one simplified ex-post machine in apps/api/src/domain/lifecycle/generic.ts. State names approximate the public registries' vocabularies and are flagged for review with each program.

Native codelifecycle_stageCDOP status
UNDER_DEVELOPMENTdraftProject design drafting
LISTEDlistedListed
UNDER_VALIDATIONlistedValidation
REGISTRATION_REQUESTEDlistedValidated
REGISTERED (GS: Certified Design)validatedRegistered
VERIFICATION_APPROVAL_REQUESTEDvalidatedRegistered
UNITS_ISSUED (GS: Certified Project; ACR: Verified; Puro: Output Audited)verifiedVerified and issuing
ON_HOLDvalidatedInactive
CREDITING_PERIOD_ENDED (ACR: Completed; Plan Vivo: Archived; Puro: Removed)retiredCompleted
INACTIVEwithdrawnInactive
WITHDRAWNwithdrawnWithdrawn
REJECTEDrejectedRejected

9. Unit blocks

9.1 The canonical machine

One resource is one credit block (a serial range with one owner and one state). States: pending, active, on_hold, buffer, retired, cancelled, expired, plus a free state_reason. Source: apps/api/src/domain/lifecycle/units.ts.

FromActionActorToEvent
pendingactivateregistryactiveorg.cdop.unit.status.changed
pendingconvertregistrycancelledorg.cdop.unit.converted
pendingtransferholderpendingorg.cdop.unit.transferred
activeholdregistryon_holdorg.cdop.unit.status.changed
activetransferholderactiveorg.cdop.unit.transferred
activeretireholderretiredorg.cdop.unit.status.changed
activecancelregistrycancelledorg.cdop.unit.status.changed
activeexpireregistryexpiredorg.cdop.unit.status.changed
activedeposit_bufferregistrybufferorg.cdop.buffer_pool.deposited
on_holdreleaseregistryactiveorg.cdop.unit.status.changed
on_holdcancelregistrycancelledorg.cdop.unit.status.changed
bufferrelease_bufferregistryactiveorg.cdop.buffer_pool.released
buffercancel_bufferregistrycancelledorg.cdop.buffer_pool.reversal_covered

A transfer changes the owner and MAY split the block; a split returns the new blocks in _embedded.created, each with a cdop:source-block link. Conversion of a pending unit (PIU) into a verified unit (WCU, PCU) at verification is a cancel with reason conversion plus a new block whose source_block_id points back.

9.2 Projection onto CDOP unit.status

Canonical statestate_reasonCDOP status
pending, activeanyActive
on_holdpending_transferPending Transfer
on_holdaccepted_pending_paymentAccepted Pending Payment
on_holdotherOn Hold
bufferanyDeposited Released
retiredanyRetired
cancelled, expiredanyCancelled

9.3 Cross-walk to the CAD Trust picklist

As encoded in units.ts (flagged for verification against the CAD Trust v2 picklist):

Canonical stateCAD Trust
pendingIssued
activeHeld
on_holdInactive
bufferBuffer
retiredRetired
cancelledCancelled
expiredExpired

10. Other machines

EntityStates
IssuancePre-issuance → Pending Issuance → Issuing → Complete or Failed. Verified is a precondition, not a state (CDOP-FB-014).
EstimationUnvalidated → Validated → Superseded. One is_current per project.
Geolocation fileThe CDOP file_status enum as published.
Validation, verificationAppend-only events with their own status (planned, submitted, in_review, changes_requested, completed, rejected, expired/withdrawn).

11. Errors

Errors are RFC 9457 application/problem+json. type is an absolute URL under /problems/, and each slug has a page.

SlugHTTPWhen
not-found404Unknown resource
validation-failed422Bad query or body for our own routes
illegal-transition409Action not allowed in the current state; lists allowed_actions and links cdop:state-machine
role-not-permitted403Key role cannot perform the action
unauthenticated401Write without a key
precondition-failed412Stale If-Match
idempotency-key-reused422Same key, different request
schema-conformance422Payload fails the CDOP schema; carries Ajv errors
unknown-pod404Unknown CDOP document name
cursor-invalid400Undecodable cursor
rate-limited429Anonymous bucket exhausted
conflict409Other conflicts
internal500Unexpected error

Write requests are checked in this order: authentication, role, state, body, precondition, then the transaction.

12. Authentication

Reads are anonymous, with a per-IP token bucket. Writes carry Authorization: Bearer cdop_<keyid>.<64hex>. Servers store only a SHA-256 of the key. Roles: developer, vvb, code_admin, registry, admin, sandbox. MCP clients that cannot set headers MAY put the key in the path (/mcp/<token>).

13. Headers

HeaderMeaning
X-CDOP-Schema-Version2.1.0+363b194: schema version plus the short upstream commit
X-API-VersionThe API's semantic version
X-CDOP-ConformanceOn ?strict=1 documents: which placeholders were emitted and why
Link: <…>; rel="describedby"The JSON Schema of a CDOP document
ETag, If-None-Match, If-MatchSee section 2
Idempotency-KeyOn actions; echoed as the CloudEvents correlationid

14. Open questions for the TWG

  1. Identifiers: is the registry slug the right URN authority, and who maintains the slug list?
  2. Status records: add effective_at, recorded_at, actor and sequence, and adopt a normalised lifecycle enum beside the native code?
  3. Full List: is it a per-unit document, or should unit and vintage become arrays?
  4. Parallel arrays: move to one object per vintage and per validation event?
  5. Verification: adopt an event-shaped verification record (monitoring period, claimed and verified quantities, explicit deductions)?
  6. This profile: maintain an API companion alongside the schema?
Last modified on