Skip to content

pacx customapi create

github-actions[bot] edited this page Jul 15, 2026 · 2 revisions

Creates a Dataverse Custom API with optional request parameters and response properties.

Usage

Create a minimal Custom API (unique name inferred from display name + solution publisher prefix):

pacx customapi create -d "Greg Sum" -s MySolution

Create with an explicit unique name:

pacx customapi create -d "Greg Sum" -n nn_GregSum -s MySolution

Create with request parameters and a response property:

pacx customapi create -d "Greg Sum" -p "Addend1:Integer, Addend2:Integer" -r Result:Integer -s MySolution

Naming conventions applied automatically:

  • Unique name (when omitted): {publisherPrefix}_{DisplayNameWithoutSpaces} — e.g. display name 'Greg Sum' with prefix 'nn' becomes nn_GregSum.
  • Request parameter unique names: {customApiUniqueName}-in-{parameterName} — e.g. nn_GregSum-in-Addend1.
  • Response property unique names: {customApiUniqueName}-out-{propertyName} — e.g. nn_GregSum-out-Result.
  • Display names for parameters/responses: inferred from the name by splitting on capital-letter boundaries — e.g. Addend1 becomes 'Addend 1'.
  • Publisher prefix validation: if --unique-name is provided, its prefix (before _) must match the solution publisher prefix; mismatches are rejected.

execute-privilege argument logic

  • If --execute-privilege is omitted, the Custom API will be created without an associated privilege.
  • If --execute-privilege is provided and a privilege with that name already exists, it will be used.

The execute-privilege argument uses a fuzzy logic to determine the actual privilege to associate with the Custom API. You can specify a substring of the actual privilege name, case insensitive (e.g. writeaccount) and, if not ambiguous, the command will fetch and use the actual privilege name (prvWriteAccount).

Arguments

Long Name Short Name Required? Description Default value Valid values
display-name d Y Human-readable name of the Custom API (e.g. 'Greg Sum'). - String
unique-name n N Unique name including publisher prefix (e.g. nn_GregSum). Inferred from --display-name and the solution publisher prefix if omitted. - String
description desc N Description of the Custom API. String
binding-type b N Binding type: Global, Entity, or EntityCollection. Global Global, Entity, EntityCollection
bound-entity be N Logical name of the entity this API is bound to (required when --binding-type is Entity or EntityCollection). - String
allowed-step-type ast N Allowed processing step type: None, AsyncOnly, or SyncAndAsync. SyncAndAsync None, AsyncOnly, SyncAndAsync
type t N Action (POST) or Function (GET). Action Action, Function
execute-privilege ep N Name of the privilege required to execute this Custom API. String
param p N Comma-separated request parameters as Name:Type (required) or Name?:Type (optional). E.g. X:Integer,Y?:String - String
response r N Comma-separated response properties as Name:Type. E.g. Result:Integer - String
solution s N Unmanaged solution unique name to add the Custom API components to. Uses the current default solution if omitted. - String

Command list

Clone this wiki locally