Skip to main content
POST
Create Access Policy

Authentication and permissions

Token requirements: User-based token (OAuth) or Organization-scoped API key or Workspace-scoped API key. Send a bearer access token for one of these identities. The permissions and resource restrictions below also apply.
Permissions joined by + are all required; or separates alternatives. Full-access keys still cannot call endpoints marked unsupported. Workspace keys must allow every workspace checked by the request. OAuth access depends on the user’s roles and resource access.
  • Default request: Both approval fields are omitted, or the supplied approval field is empty.
  • Attach an approval procedure: With a non-empty approval_procedure_id, the procedure must be a named approval procedure in the requested workspace.
  • Create inline approval rules: A non-empty approval_procedure creates inline rules for this policy. It is mutually exclusive with approval_procedure_id. Custom workflows must belong to the requested workspace; user and group approvers must belong to its organization.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
teamId
string
required

The ID of the workspace.

name
string
required

The name of the access policy.

description
string

A description of the access policy.

maxAccessMinutes
integer<int32> | null

The maximum number of minutes that access can be granted for (optional).

requireBusinessJustification
boolean | null

Whether a business justification is required when requesting access (optional).

The recommended duration in minutes for access requests (optional).

requireOnBehalfOfConfirmation
boolean | null

Whether requests made on behalf of others require the target user's confirmation (optional).

scopedId
string | null

Stable, workspace-scoped identity for the policy (apo_ + 22 base62 chars). Omit to have one minted. Must be unique within the workspace; reserved sentinel values (the workspace-default policy) are rejected.

approvalProcedureId
string | null

The ID of a named approval procedure that must approve requests for roles governed by the policy. Omit or send an empty ID when no named approval procedure is required. Attaching requires permission to view approval procedures.

requireFormConfirmation
boolean | null

Collect access requests with a form rather than a chat conversation.

approvalProcedure
approval_procedure · object

Inline approval rules, mutually exclusive with approval_procedure_id. Omit both approval fields to create without approval. An empty step list without a timeout means no approval. A timeout requires nonempty steps; omitted timeout uses 30 days. Custom workflows must be live and deployed in the policy's workspace. Automatic self-approval is enabled; approval justification requirements still apply. Notifications are not suppressed. Use the Approval Procedure API for manual self-approval or muted notifications.

Response

200 - application/json

Success

data
data · object

The created access policy.