> ## Documentation Index
> Fetch the complete documentation index at: https://docs.plainid.io/llms.txt
> Use this file to discover all available pages before exploring further.
# Permit Deny
> The Permit/Deny API call is a Yes/No Authorization question. It returns a response to Access Decision-related responses to a specific question detailed in the API Request. It can also optionally return additional information.
Refer to the headers below to modify your cURL sample. Check if the following headers are in the sample, if not, ensure you add it to your cURL sample before pasting into your API tool.
| Header | Value | cURL Line |
|---|---|---|
| Accept | application/json | 'accept: application/json' |
| Content-Type | application/json | 'content-type: application/json' |
In order for the relevant parameters to appear in the cURL sample, you can input the values in the interactive API console on the right under the Try It\* or the Code Sample tabs. They will then appear in the cURL sample in the correct format to use in your API tool.
\*Try It function coming soon.
## OpenAPI
````json POST /api/runtime/permit-deny/v3
{
"openapi": "3.0.3",
"info": {
"title": "Authorization APIs",
"version": "1.0",
"description": "Applications, services, and authorizers use the Authorization APIs to receive the PlainID Access Decision from the PDP",
"contact": {
"name": "PlainID",
"url": "https://plainid.com",
"email": "contact@plainid.com"
},
"termsOfService": "https://plainid.com/terms",
"license": {
"name": "Commercial",
"url": "https://plainid.com/license"
}
},
"servers": [
{
"description": "United States",
"url": "https://tenant-name.us1.plainid.io"
},
{
"description": "Europe",
"url": "https://tenant-name.eu1.plainid.io"
},
{
"description": "Canada",
"url": "https://tenant-name.ca1.plainid.io"
},
{
"description": "Local PAA",
"url": "https://your-paa.acme.local"
}
],
"tags": [
{
"name": "runtime",
"description": "runtime"
},
{
"name": "Cache Management",
"description": "Cache invalidation operations for Runtime service"
}
],
"paths": {
"/api/runtime/permit-deny/v3": {
"post": {
"tags": [
"runtime"
],
"summary": "Permit Deny",
"operationId": "PermitDeny",
"responses": {
"200": {
"description": "User gets a Permit decision",
"content": {
"application/json": {
"schema": {
"anyOf": [
{
"$ref": "#/components/schemas/permitDenyResponse"
},
{
"$ref": "#/components/schemas/assetContextPermitDenyResponse"
}
]
},
"examples": {
"Permit": {
"value": {
"data": {
"result": "PERMIT"
}
}
},
"Deny": {
"value": {
"data": {
"result": "DENY"
}
}
},
"Permit with details": {
"value": {
"data": {
"result": "PERMIT",
"response": [
{
"allowed": [
{
"path": "AS-XX-12575",
"action": "Access",
"template": "Accounts"
}
],
"denied": [],
"not_applicable": []
}
]
}
}
},
"Deny with details": {
"value": {
"data": {
"result": "DENY",
"response": [
{
"allowed": [],
"denied": [
{
"path": "AS-XX-12575",
"action": "Access1",
"template": "Accounts"
}
],
"not_applicable": []
}
]
}
}
},
"Combined permit deny": {
"value": {
"data": {
"result": "DENY",
"response": [
{
"allowed": [
{
"path": "AS-XX-12575",
"action": "Access",
"template": "Accounts"
}
],
"denied": [
{
"path": "AS-XX-1257566",
"action": "Access",
"template": "Accounts"
}
],
"not_applicable": []
}
]
}
}
}
}
}
}
},
"400": {
"description": "Bad Request"
},
"401": {
"description": "Unauthorized"
},
"403": {
"description": "Forbidden"
},
"404": {
"description": "Not Found"
},
"500": {
"description": "Internal Server Error"
},
"501": {
"description": "Not Implemented"
}
},
"requestBody": {
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"entityId": {
"type": "string",
"description": "Unique identifier of the Identity (e.g. UID)"
},
"clientId": {
"type": "string",
"description": "Client ID of the Scope
The Client ID is **required**, ensure that it is defined either in the header as `X-Client-Id` or in the body as `clientId`."
},
"clientSecret": {
"type": "string",
"description": "Client Secret ID of the Scope.
You can also authenticate with an Authorization Token (in your API tool). Note that the X-Client-Id is still required, whether in the header or the body. Refer to [Setting up an Authentication Method](https://docs.plainid.io/v1/docs/managing-scope-authentication#setting-up-an-authentication-method-in-the-scope) for more information."
},
"listOfResources": {
"description": "Contains a list of the Asset's unique identifiers:\n\n· Resource type (required)
· Prefetch\n\n· Resources - Action (optional), Path (required), and Asset Attributes (optional)",
"type": "array",
"items": {
"type": "object",
"properties": {
"resourceType": {
"type": "string",
"description": "Asset Template ID"
},
"prefetch": {
"type": "boolean",
"default": false,
"description": "Fetches the Asset Attribute based on the Asset ID at the beginning of the Access Decision calculation.\n"
},
"resources": {
"type": "array",
"items": {
"type": "object",
"properties": {
"action": {
"type": "string",
"description": "Name of the Action"
},
"path": {
"type": "string",
"description": "Unique Identifier of the Asset"
},
"assetAttributes": {
"type": "object",
"properties": {
"attribute_1": {
"type": "array",
"items": {
"type": "string"
}
},
"attribute_2": {
"type": "array",
"items": {
"type": "string"
}
}
}
}
},
"required": [
"path"
]
}
}
}
}
},
"entityTypeId": {
"type": "string",
"description": "Identity Template ID"
},
"entityAttributes": {
"type": "object",
"properties": {
"user_organization": {
"type": "array",
"items": {
"type": "string"
}
},
"user_title": {
"type": "array",
"items": {
"type": "string"
}
},
"user_business_unit": {
"type": "array",
"items": {
"type": "string"
}
},
"User_Location": {
"type": "array",
"items": {
"type": "string"
}
}
}
},
"contextData": {
"description": "Identity Context data for this request.\n\nWhen specifying this parameter, you are requesting information based on a specific parameter and its value.\n\nFor example:\nLocation where the contextData equals a specific branch.\n\nIf not defined, Dynamic Groups based on context data will not be considered in the Access Decision.",
"type": "object",
"properties": {
"string": {
"type": "array",
"items": {}
}
}
},
"environment": {
"type": "object",
"description": "Environmental parameters need to be defined in Policies as a request (in Asset Rules or Conditions) and sent in the authorization request. Only the Assets that match the parameters in request will be returned.\n\nIf not defined, parameters based on Environmental data will not be considered in the Access Decision.",
"properties": {
"string": {
"type": "array",
"items": {}
}
}
},
"additionalIdentities": {
"$ref": "#/components/schemas/additionalIdentitiesInput"
},
"remoteIp": {
"type": "string",
"minLength": 1,
"description": "IP address to be used when validating a Policy. Ensure that your IP Ranges are correct based on an [IP calculator](https://www.ipaddressguide.com/cidr).\nIf not defined, the IP considered in the calculation is taken from the X-Forwarded-For (Request header)."
},
"timeZoneOffset": {
"type": "number",
"description": "To define the offset from UTC time zone.\nUsed in Time Condition.",
"default": 0
},
"includeDetails": {
"type": "boolean",
"default": false,
"description": "Show/hide a detailed list of Resources that are allowed, denied, and not applicable."
},
"includeContext": {
"type": "boolean",
"default": false,
"description": "Show/hide the context data in the response."
},
"includeAccessPolicy": {
"type": "boolean",
"default": false,
"description": "Show/hide the name of the Policy in the response that granted the specified access."
},
"includeAccessPolicyId": {
"type": "boolean",
"default": false,
"description": "Show/hide the external id of the Policy in the response that granted the specified access."
},
"includeAssetAttributes": {
"type": "boolean",
"default": false,
"description": "Show/hide the Asset Attribute of the Assets in the response."
},
"includeDenyReason": {
"type": "boolean",
"default": false,
"description": "Include/exclude the reason for denying access to an Asset. Uses prefetch logic the evaluate the reasons.
For more details on Deny Reason, click [here](https://docs.plainid.io/apidocs/working-with-deny-reason)"
},
"includeIdentity": {
"type": "boolean",
"default": false,
"description": "Show/hide the Identity Attribute of the Identity in the response."
},
"accessTokenFormat": {
"type": "string",
"default": "JSON/JWT",
"description": "Determines the format of the response – whether `JSON`, `JWT`, or `StandardJWT`."
},
"useCache": {
"type": "boolean",
"default": true,
"description": "The Attribute will determine if the response is going to consider the cache settings or override the cache and perform a full calculation."
},
"combinedMultiValue": {
"type": "boolean",
"default": false,
"description": "Determines the evaluation of Identity Attributes relationship in access decision.\n"
},
"assetContext": {
"type": "array",
"items": {
"$ref": "#/components/schemas/assetContextRequestItem"
},
"description": "Specifies contextual asset data (e.g., resourceType, path, action) to refine authorization decisions based on asset relationships and classifications.See our article on Working with Asset Context for more information."
},
"useOptimizedAssetContextResponse": {
"type": "boolean",
"default": false,
"description": "Determines the Asset Context response structure. See our article on Working with Asset Context for more information.\n"
},
"operationalFilters": {
"type": "array",
"description": "These operational filters should affect the Runtime behavior and results by applying additional filtering which is not directly related to Authorization logic.",
"items": {
"type": "object",
"oneOf": [
{
"$ref": "#/components/schemas/identitySourcesFilterByIDs"
}
],
"discriminator": {
"propertyName": "filterType"
}
}
},
"skipUnneededOrUnavailableIdentitySources": {
"type": "boolean",
"description": "The Attribute will determine if the calculation will skip unneeded or unavailable Identity sources. Refer to the [Authorization API](https://docs.plainid.io/v1-api/apidocs/authorization-apis) article for more information.",
"default": false
},
"includePartialIdentitySourcesIndication": {
"type": "boolean",
"description": "Show/hide additionalResponseInfo in the response.",
"default": false
},
"includeCacheInfo": {
"type": "boolean",
"description": "When true, adds `additionalResponseInfo.cacheUsageInformation` to the response, showing whether the response came from cache (`usedCachedResponse`), the response-cache TTL (`responseCachePeriodSeconds`), and which identity sources served data from cache (`usedCachedIdentityData`).",
"default": false
},
"failOnCalculatedAttributesErrors": {
"type": "boolean",
"description": "Fail request when Attribute calculation fails.",
"default": true
}
},
"required": [
"entityId",
"clientId",
"listOfResources"
]
},
"examples": {
"PermitDeny": {
"value": {
"entityId": "uid838277",
"clientId": "PDASDASDASDASDASDF40",
"clientSecret": "k3DSBn5vTJuNzcar0Cpb0wICar34QwYQCat4OMay",
"entityAttributes": {
"user_organization": [
"Acme Finance"
],
"user_title": [
"Branch Clerk"
],
"user_business_unit": [
"LOB1"
],
"User_Location": [
"US"
]
},
"combinedMultiValue": false,
"listOfResources": [
{
"resourceType": "Client Profiles",
"prefetch": true,
"resources": [
{
"action": "Read",
"path": "P4",
"assetAttributes": {
"order_type": [
"credit_card"
],
"customer_type": [
"regular"
]
}
}
]
}
],
"entityTypeId": "User",
"contextData": {
"field1": [
"field1Value1",
"field1Value2"
],
"field2": [
"field2Value1",
"field2Value2"
]
},
"environment": {
"table": [
"accounts"
]
},
"additionalIdentities": [
{
"entityId": "agentA",
"entityTypeId": "Agents",
"entityAttributes": {
"agent_classification": [
"Sensitive"
]
}
},
{
"entityId": "appA",
"entityTypeId": "Applications",
"entityAttributes": {
"app_classification": [
"Confidential"
]
}
}
],
"remoteIp": "192.168.0.1",
"timeZoneOffset": 0,
"includeDetails": false,
"includeContext": false,
"includeIdentity": false,
"includeAccessPolicy": false,
"includeAccessPolicyId": false,
"includeAssetAttributes": false,
"includeDenyReason": false,
"accessTokenFormat": "JSON",
"useCache": true,
"assetContext": [
{
"key": "",
"resourceType": "Account",
"path": "",
"action": "ACCESS",
"assetAttributes": {
"accountCategory": [
"Premium"
]
}
}
],
"useOptimizedAssetContextResponse": false,
"operationalFilters": [
{
"filterType": "identitySourcesFilterByIDs",
"filterProperties": {
"filterAction": "INCLUDE",
"objectsList": [
"sourceID_123",
"sourceID_456"
]
}
},
{
"filterType": "identitySourcesFilterByIDs",
"filterProperties": {
"filterAction": "EXCLUDE",
"objectsList": [
"sourceID_789"
]
}
}
],
"skipUnneededOrUnavailableIdentitySources": false,
"includePartialIdentitySourcesIndication": false,
"includeCacheInfo": false,
"failOnCalculatedAttributesErrors": true
}
}
}
}
},
"description": ""
},
"description": "The Permit/Deny API call is a Yes/No Authorization question. It returns a response to Access Decision-related responses to a specific question detailed in the API Request. It can also optionally return additional information.
\n
Refer to the headers below to modify your cURL sample. Check if the following headers are in the sample, if not, ensure you add it to your cURL sample before pasting into your API tool.
| Header | Value | cURL Line |
|---|---|---|
| Accept | application/json | 'accept: application/json' |
| Content-Type | application/json | 'content-type: application/json' |
In order for the relevant parameters to appear in the cURL sample, you can input the values in the interactive API console on the right under the Try It\\* or the Code Sample tabs. They will then appear in the cURL sample in the correct format to use in your API tool.
\\*Try It function coming soon.
",
"parameters": [
{
"schema": {
"type": "string"
},
"name": "X-Client-Id",
"in": "header",
"description": "Client ID of the Scope
The clientId is **required**, ensure that it is defined either in the header as `X-Client-Id` or in the body as `clientId` under the `runtimeFinetune` parameter. Refer to [Setting up an Authentication Method](https://docs.plainid.io/v1/docs/managing-scope-authentication#setting-up-an-authentication-method-in-the-scope) for more information.",
"required": false
},
{
"schema": {
"type": "string"
},
"name": "X-Client-Secret",
"in": "header",
"description": "Client Secret ID of the Scope.
You can also authenticate with an Authorization Token (in your API tool). Note that the X-Client-Id is still required, whether in the header or the body as clientSecret under the `runtimeFinetune` parameter. Refer to [Setting up an Authentication Method](https://docs.plainid.io/v1/docs/managing-scope-authentication#setting-up-an-authentication-method-in-the-scope) for more information.",
"required": false
}
]
}
}
},
"components": {
"schemas": {
"permitDenyResponse": {
"type": "object",
"x-examples": {
"Example 1": {
"result": "DENY",
"response": [
{
"allowed": [
{
"path": "AS-XX-12575",
"action": "Access",
"template": "Accounts"
}
],
"denied": [
{
"path": "AS-XX-1257566",
"action": "Access",
"template": "Accounts"
}
],
"not_applicable": []
}
]
}
},
"properties": {
"result": {
"type": "string"
},
"response": {
"type": "array",
"items": {
"type": "object",
"properties": {
"allowed": {
"type": "array",
"items": {
"type": "object",
"properties": {
"path": {
"type": "string"
},
"action": {
"type": "string"
},
"template": {
"type": "string"
},
"permissions": {
"type": "array",
"items": {
"type": "object",
"properties": {
"permission": {
"type": "string"
},
"permissionId": {
"type": "string"
},
"permissionMetadata": {
"$ref": "#/components/schemas/permissionMetadata"
}
}
}
}
}
}
},
"denied": {
"type": "array",
"items": {
"type": "object",
"properties": {
"path": {
"type": "string"
},
"action": {
"type": "string"
},
"template": {
"type": "string"
}
}
}
},
"not_applicable": {
"type": "array",
"items": {
"type": "object"
}
}
}
}
},
"identity": {
"$ref": "#/components/schemas/identityResponse"
},
"additionalIdentities": {
"type": "array",
"items": {
"$ref": "#/components/schemas/identityResponse"
}
},
"additionalResponseInfo": {
"$ref": "#/components/schemas/additionalResponseInfoResponse"
}
}
},
"assetContextPermitDenyResponse": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"type": "object",
"properties": {
"assetContext": {
"type": "object",
"anyOf": [
{
"$ref": "#/components/schemas/assetContextResponseItem"
},
{
"$ref": "#/components/schemas/assetContextMergedResponseItem"
}
]
},
"output": {
"type": "object",
"properties": {
"accessResponse": {
"$ref": "#/components/schemas/permitDenyResponse"
},
"error": {
"type": "string"
}
}
}
}
}
}
}
},
"additionalIdentitiesInput": {
"type": "array",
"description": "A list of additional Identities to be considered in the Access Decision. If all identities are defined in this parameter, the root-level `entityId`, `entityTypeId`, and `entityAttributes` parameters can be omitted.",
"items": {
"type": "object",
"properties": {
"entityId": {
"type": "string",
"description": "Unique identifier of the Identity (e.g. UID)"
},
"entityTypeId": {
"type": "string",
"description": "Identity Template ID"
},
"entityAttributes": {
"description": "List of Identity Attributes and their values.",
"type": "object",
"properties": {
"string": {
"type": "array",
"items": {}
}
}
}
}
}
},
"assetContextRequestItem": {
"type": "object",
"required": [
"resourceType"
],
"properties": {
"key": {
"type": "string",
"description": "An auto-generated key to set the correlation between the requested object and the response object (optional). When working with a single assetContext object, use the “singleObjectResponse” value to align to the original structure response."
},
"resourceType": {
"type": "string"
},
"path": {
"type": "string"
},
"action": {
"type": "string"
},
"assetAttributes": {
"description": "",
"type": "object",
"properties": {
"attribute_1": {
"type": "array",
"items": {
"type": "string"
}
},
"attribute_2": {
"type": "array",
"items": {
"type": "string"
}
}
}
}
}
},
"identitySourcesFilterByIDs": {
"allOf": [
{
"$ref": "#/components/schemas/operationalFilter"
},
{
"type": "object",
"properties": {
"filterProperties": {
"type": "object",
"required": [
"filterAction",
"objectsList"
],
"properties": {
"filterAction": {
"type": "string",
"enum": [
"INCLUDE",
"EXCLUDE"
]
},
"objectsList": {
"type": "array",
"items": {
"type": "string",
"description": "Input your sourceID/s here. For information on the sourceID parameter and where to locate it, check out Managing Attribute Sources in the PlainID documentation."
}
}
}
}
}
}
]
},
"permissionMetadata": {
"type": "object",
"minProperties": 1,
"description": "Additional response metadata. This response is only returned when the `includeAccessPolicy` is set to true, and when the `permissionMetadata` object contains one or more properties. "
},
"identityResponse": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"typeName": {
"type": "string"
},
"attributes": {
"type": "object"
}
}
},
"additionalResponseInfoResponse": {
"type": "object",
"properties": {
"identitySources": {
"type": "object",
"properties": {
"skipped": {
"type": "array",
"items": {
"$ref": "#/components/schemas/identitySourceInfo"
}
},
"failed": {
"type": "array",
"items": {
"$ref": "#/components/schemas/identitySourceInfo"
}
}
}
},
"cacheUsageInformation": {
"type": "object",
"description": "Appears only when the request sets `includeCacheInfo=true`.",
"properties": {
"usedCachedResponse": {
"type": "boolean",
"description": "`true` when the entire response was served from the response (scope) cache.
`false` when the response was freshly calculated: a cache miss, `useCache=false`, no response-cache TTL configured for the scope or a request sent right after the response cache was invalidated."
},
"responseCachePeriodSeconds": {
"type": "integer",
"description": "The scope's configured response-cache TTL in seconds."
},
"usedCachedIdentityData": {
"type": "array",
"description": "The identity sources whose attribute data was served from the identity cache during this request's identity retrieval. Empty when the whole response came from the response cache (identity retrieval never ran, see `usedCachedResponse`), when every identity source configured for this request had caching disabled, or when every source was fetched fresh (including a partial fetch after a source's cache entry expired or was invalidated). ",
"items": {
"type": "object",
"properties": {
"sourceId": {
"type": "string",
"description": "The Identity Source ID"
},
"sourceName": {
"type": "string",
"description": "The Identity Source's name."
},
"cachePeriodSeconds": {
"type": "integer",
"description": "The Source's own configured identity-cache TTL, in seconds. Sources with identity caching disabled do not appear here."
}
}
}
}
}
}
}
},
"assetContextResponseItem": {
"type": "object",
"anyOf": [
{
"properties": {
"key": {
"type": "string",
"description": "An auto-generated key to set the correlation between the requested object and the response object (optional). When working with a single assetContext object, use the “singleObjectResponse” value to align to the original structure response."
}
}
},
{
"properties": {
"resourceType": {
"type": "string"
},
"path": {
"type": "string"
},
"action": {
"type": "string"
},
"assetAttributes": {
"description": "",
"type": "object",
"properties": {
"attribute_1": {
"type": "array",
"items": {
"type": "string"
}
},
"attribute_2": {
"type": "array",
"items": {
"type": "string"
}
}
}
}
}
}
]
},
"assetContextMergedResponseItem": {
"type": "object",
"properties": {
"resources": {
"type": "array",
"items": {
"$ref": "#/components/schemas/assetContextResponseItem"
}
}
}
},
"operationalFilter": {
"type": "object",
"required": [
"filterType"
],
"properties": {
"filterType": {
"type": "string"
}
},
"discriminator": {
"propertyName": "filterType"
}
},
"identitySourceInfo": {
"type": "object",
"properties": {
"sourceId": {
"type": "string"
},
"sourceName": {
"type": "string"
},
"message": {
"type": "string"
},
"attributes": {
"type": "array",
"items": {
"type": "string"
}
}
}
}
}
}
}
````