---
title: "Decision tree"
method: POST
path: "/api/v2/authz/decisiontree"
tags: ["Authorizer"]
---

# Decision tree

`POST /api/v2/authz/decisiontree`

## Request

- The document declares no server URL.
- Auth: API key in header `authorization` and API key in header `aserto-tenant-id`
- TypeScript: <https://skmtc.dev/aserto/apis/aserto-authorizer-v2-authorizer-proto/docs/api/v2/authz/decisiontree/post.ts> (a function with typed inputs; its response is checked against the schema)

Returns decision tree for given identity context.

## Request body

- V2DecisionTreeRequest
  - `identity_context` ApiIdentityContext
    - `identity` string
    - `type` 'IDENTITY_TYPE_UNKNOWN' | 'IDENTITY_TYPE_NONE' | 'IDENTITY_TYPE_SUB' | 'IDENTITY_TYPE_JWT' | 'IDENTITY_TYPE_MANUAL': Identity types, describes the payload type of the identity field inside the IdentityContext message. - IDENTITY_TYPE_UNKNOWN: Unknown, value not set, requests will fail with identity type not set error. - IDENTITY_TYPE_NONE: None, no explicit identity context set, equals anonymous. - IDENTITY_TYPE_SUB: Sub(ject), identity field contains an oAUTH subject. - IDENTITY_TYPE_JWT: JWT, identity field contains a JWT access token. - IDENTITY_TYPE_MANUAL: Manual, propagates thw identity field as-is, without validation, into the input object.
  - `options` V2DecisionTreeOptions
    - `path_separator` 'PATH_SEPARATOR_UNKNOWN' | 'PATH_SEPARATOR_DOT' | 'PATH_SEPARATOR_SLASH'
  - `policy_context` ApiPolicyContext
    - `decisions` string[]
    - `path` string
  - `policy_instance` ApiPolicyInstance
    - `instance_label` string
    - `name` string
  - `resource_context` object

## Response `200`

A successful response.

- V2DecisionTreeResponse
  - `path` object
  - `path_root` string

## Other responses

- `default`: An unexpected error response.

## Changes

- **2023-03-01** `3f1fb0547ca2`: 2 info
  - the endpoint scheme security `AuthorizerAPIKey AND TenantID` was added to the API
  - the endpoint scheme security `AuthorizerAPIKey` was removed from the API
- **2023-02-22** `c8bce422c925`: 2 info
  - api tag `Authorizer` added
  - api tag `authorizer` removed

[Operation history](https://skmtc.dev/aserto/apis/aserto-authorizer-v2-authorizer-proto/changes/api/v2/authz/decisiontree/post.md)

---

[API](https://skmtc.dev/aserto/apis/aserto-authorizer-v2-authorizer-proto.md) - [All operations](https://skmtc.dev/aserto/apis/aserto-authorizer-v2-authorizer-proto/llms.txt) - [OpenAPI document](https://skmtc.dev/aserto/apis/aserto-authorizer-v2-authorizer-proto/revisions/bbe9be3b1f57?raw)
