Skip to main content

Publish a Policy

Publishes a policy to a specific lifecycle stage. Policies follow a promotion path: DRAFT -> PILOT -> PRODUCTION. Use staged rollout to validate policies with a subset of recipients before enforcing across the full catalog.
POST /v1/docks/:dockId/policies/:policyId/publish

Path Parameters

ParameterTypeDescription
dockIdstringThe dock ID
policyIdstringThe policy ID

Request Body

ParameterTypeRequiredDescription
stagestringOptionalTarget stage: sandbox, pilot, or production. Defaults to the next stage in the lifecycle
scheduledEnforceDatestringOptionalISO 8601 date when the policy should begin enforcement

Example: Mortgagee Policy — Pilot

Validate the passphrase + mTLS policy with a subset of mortgagees before full rollout:
curl -X POST https://api.docyard.io/v1/docks/dock_01HQ3K.../policies/pol_01HQ3P.../publish \
  -H "Authorization: Bearer dk_live_a1b2c3d4..." \
  -H "Content-Type: application/json" \
  -d '{ "stage": "pilot" }'

Example: Mortgagee Policy — Production

After pilot validation, promote to production:
curl -X POST https://api.docyard.io/v1/docks/dock_01HQ3K.../policies/pol_01HQ3P.../publish \
  -H "Authorization: Bearer dk_live_a1b2c3d4..." \
  -H "Content-Type: application/json" \
  -d '{ "stage": "production" }'

Example: Auditor Policy — Scheduled Enforcement

Schedule the auditor’s time-boxed policy to activate on the engagement start date:
curl -X POST https://api.docyard.io/v1/docks/dock_01HQ3K.../policies/pol_01HQ3Q.../publish \
  -H "Authorization: Bearer dk_live_a1b2c3d4..." \
  -H "Content-Type: application/json" \
  -d '{
    "stage": "production",
    "scheduledEnforceDate": "2025-01-15T00:00:00.000Z"
  }'

Response

{
  "id": "pol_01HQ3P...",
  "dockId": "dock_01HQ3K...",
  "name": "Mortgagee Bulk API Access",
  "status": "PRODUCTION",
  "currentVersion": 3,
  "publishedAt": "2025-01-22T10:00:00.000Z"
}

Lifecycle Stages

StageDescriptionTypical Use
DRAFTPolicy is being authored and tested. Not enforced.Initial recipe creation
PILOTActive for a subset of recipients for validation.Test with 5-10 mortgagees
PRODUCTIONFully enforced for all assigned recipients.Live access control

Error Handling

StatusCondition
400Invalid stage value or policy cannot be promoted to the requested stage
400scheduledEnforceDate is in the past
401Missing or invalid API key
404Policy or dock not found
You can skip stages by explicitly specifying the stage parameter, but it is recommended to follow the full promotion path. Run a simulation before publishing to identify non-compliant recipients. For auditor policies with auto_expire: true, the time window in the recipe controls when access ends — no manual revocation is needed.