Skip to main content

Update a Policy

Updates one or more fields on an existing policy. Only include the fields you want to change.
PATCH /v1/docks/:dockId/policies/:policyId

Path Parameters

ParameterTypeDescription
dockIdstringThe dock ID
policyIdstringThe policy ID

Request Body

ParameterTypeRequiredDescription
namestringOptionalUpdated display name
recipestring/JSONOptionalUpdated policy recipe definition

Example Request

curl -X PATCH https://api.docyard.io/v1/docks/dock_01HQ3K.../policies/pol_01HQ3P... \
  -H "Authorization: Bearer dk_live_a1b2c3d4..." \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Standard Mortgagee Access (Updated)",
    "recipe": {
      "access": "read",
      "artifactTypes": ["declaration-page", "coi", "endorsement"],
      "requireFactors": ["email_verified"],
      "expiresInDays": 120
    }
  }'

Response

Returns the full updated policy object.
{
  "id": "pol_01HQ3P...",
  "dockId": "dock_01HQ3K...",
  "name": "Standard Mortgagee Access (Updated)",
  "recipe": {
    "access": "read",
    "artifactTypes": ["declaration-page", "coi", "endorsement"],
    "requireFactors": ["email_verified"],
    "expiresInDays": 120
  },
  "status": "DRAFT",
  "currentVersion": 3,
  "createdAt": "2025-01-15T11:00:00.000Z",
  "updatedAt": "2025-01-22T09:15:00.000Z"
}

Error Handling

StatusCondition
400recipe is not a valid policy definition
401Missing or invalid API key
404Policy or dock not found
Updating a policy’s recipe does not automatically create a new version. Use Create Version to snapshot the current state before making changes.