Creating Access-Request Workflows (REST API)

This topic shows how to build a Secret Server access-request approval workflow over the REST API from any automation client — for example ServiceNow, Power Automate, or a custom script. It documents the two calls involved, the request body of the Create Step call, and a worked example.

This is a Secret Server endpoint even when you reach it through the Delinea Platform (unified mode). Every ID in the request body is a Secret Server ID, not a Delinea Platform ID.

Authentication

Obtain a bearer token and send it as Authorization: Bearer <access_token>. In unified mode, request the token from the Delinea Platform identity endpoint using scope=xpmheadless, then call the Secret Server API at your instance's /SecretServer/api base path. See the Delinea Platform unified-mode authentication flow for the token request.

Two-Call Sequence

Creating a workflow is two calls. The step is created against the template, not the workflow:

  1. Create the template — POST /v1/workflows/templates. The body (WorkflowTemplateCreateArgs) requires name and workflowType. workflowType accepts exactly two values: AccessRequest and SecretEraseRequest; any other value is rejected. The response returns the new workflowTemplateId.

  2. Create each step — POST /v1/workflows/templates/{id}/steps, where {id} is the workflowTemplateId from call 1. Submit one POST per step.

The step endpoint is /v1/workflows/templates/{id}/steps — not /v1/workflows/{id}/steps — and {id} is the template ID, not a workflow ID.

Request Body Field Reference (Create Step)

WorkflowStepTemplateCreateArgs

Field Type Description
name string Display label for the step shown in the Workflow Designer (for example, "Line Managers"). Required in practice.
order integer Position of the step in the approval chain, starting at 1. Approval at order N advances the request to order N+1. Assign unique, sequential values and submit one step per call — the API does not resolve duplicate orders.
workflowTemplateId integer ID of the parent workflow template; the same value as the {id} path parameter.
configuration object The step's approval configuration (AccessRequestStepConfigurationModel, below).

AccessRequestStepConfigurationModel (configuration)

Field Type Description
numApprovalsRequired integer Number of approvers who must approve for the request to advance (the "x of n" vote). Default 1.
approveStep integer Where the request advances when this step is approved. Set -1 to grant access (use on the final step), -2 to advance to the next step in sequence, or a positive integer equal to a later step's order to jump to that step. See Step routing values below.
expireStep integer Where the request advances when this step times out (the timeout duration is the step's expirationMinutes). Set 0 for no timeout — required on the final step, which cannot time out. On earlier steps use -2 for the next step or a positive integer equal to a later step's order. If a step times out with no target, the request stays pending — it is never automatically denied. See Step routing values below.
approverGroups array The reviewers (users and/or groups) for this step. Each entry is an AccessReviewerModel, below.

AccessReviewerModel (each approverGroups entry)

Field Type Description
groupId integer, nullable Secret Server ID of the approver (not a Delinea Platform ID). For a group, use the group ID from GET /v1/groups?filter.searchText=. This is the field that identifies who approves.
isUser boolean, nullable false = the reviewer is a group (use groupId); true = an individual user.
isOwner boolean true marks the entry as the secret's owners ("Include owners as reviewers"). Optional; defaults to false.
displayName string Optional, informational display name of the user or group. The server resolves the reviewer by ID, so this is not mandatory.
accessReviewerId integer Server-assigned identifier of the reviewer record. Send 0 on create; the server assigns it. Do not use this to specify the approver — use groupId + isUser.
workflowStepTemplateId integer Server-assigned identifier of the step. Send 0 on create; the server assigns it.
workflowTemplateId integer, nullable ID of the parent workflow template; the same value as the top-level field (redundant copy).

Step Routing Values (approveStep and expireStep)

Both approveStep and expireStep take either a special negative code or a positive step number.

Value Name Meaning
-1 STEP_DONE Ends the workflow and grants access. This is the value to use for approveStep on the final step.
-2 STEP_NEXT Advance to the next step in sequence (by order). On the last step, the server resolves this to -1 at save time.
positive N — Jump to the step whose order is N. Must be strictly greater than this step's own order.
0 STEP_NONE For expireStep: no timeout — the step does not branch on timeout. For approveStep: a legacy default that the server rewrites on save to -2 (non-final step) or -1 (final step); set -1 or -2 explicitly rather than relying on it.

Server-side validation:

  • Forward-only: a non-negative approveStep or expireStep less than or equal to the step's own order is rejected — a step cannot route to itself or to an earlier step.

  • -1 and -2 are the only valid negative codes; a value of -3 or lower is rejected.

  • expireStep = 0 is always valid and means no timeout for that step.

Worked Example

A single-step workflow whose approvers are the "Domain Admins" group (Secret Server group ID 56), against template 1234:

POST .../SecretServer/api/v1/workflows/templates/1234/steps
Authorization: Bearer <access_token>
Content-Type: application/json

{
  "configuration": {
    "approverGroups": [
      {
        "accessReviewerId": 0,
        "displayName": "Domain Admins",
        "groupId": 56,
        "isOwner": false,
        "isUser": false,
        "workflowStepTemplateId": 0,
        "workflowTemplateId": 1234
      }
    ],
    "approveStep": -1,
    "expireStep": 0,
    "numApprovalsRequired": 1
  },
  "name": "Line Managers",
  "order": 1,
  "workflowTemplateId": 1234
}

Notes on the example: accessReviewerId and workflowStepTemplateId are sent as 0 because the server assigns them; groupId 56 is a Secret Server group ID, not a Platform ID; isUser: false means the reviewer is a group. Because this single step is also the final step, approveStep is -1 (grant access) and expireStep is 0 (no timeout). In a multi-step workflow, earlier steps would instead use -2 (or a later step's order) for approveStep.

Related Topics