> ## 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. # Identity Cache Invalidation > Performs a cache invalidation operation for identity data in the PAAs related to the relevant Environment.

When to use this API

Use this API when identity-related data changes—such as group membership, attribute values, or source assignments—and you want to immediately clear outdated entries from the Identity cache.
Example Use Case: Identity data is cached for each user during the first Authorization request and will be invalidated when the user logs off an Application. So during the next login to the Application, fresh data will be re-fetched for the current Authorization session.

Using this API

Authentication

A valid PlainID Platform JWT is required in the `Authorization` header. Refer to our Get Access Token API to retrieve a valid JWT for the Bearer Token.

How to use this API

Provide at least one of identityTemplate or identityId in the request body.
To invalidate all identity caches for a specific template in Environment's PAAs, send a JSON object in the request body with the Identity Template ID only. The identityId is optional when identityTemplate is provided, and required if identityTemplate is absent. To invalidate all identity caches for a specific template in Environment's PAAs, send a JSON object in the request body with the Identity Template ID only. The invalidation can be applied broadly for all Identity Source data and for all users, or scoped down using these **optional** parameters in the request body:

Notice

When accessing the Authorization APIs, the URL base/prefix depends on your PlainID PDP location:
  • United States Cloud PDP - `https://tenant-name.us1.plainid.io`
  • Canadian Cloud PDP - `https://tenant-name.ca1.plainid.io`
  • European Cloud PDP - `https://tenant-name.eu1.plainid.io`
  • Local PAA - `https://your-paa.acme.local`

  • For more information on which Asset Types to use with your PAA or Cloud PDP, refer to Managing Asset Types.

    cURL Sample Guidelines

    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.


    Important note about headers

    Refer to the headers below to modify your cURL sample. Check if the following headers are in the sample—if not, ensure you add them before pasting into your API tool.

    Headers

    Header Value cURL Line
    Accept application/json 'accept: application/json'
    Content-Type application/json 'content-type: application/json'
    X-Request-ID (optional) UUID 'X-Request-ID: {uuid}'

    Note: RequestID Header (optional): You may include an X-Request-ID header for traceability. If not provided, the system will generate one automatically.

    ## OpenAPI ````json POST /api/1.0/runtime/caches/identity/{envId}/invalidate { "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" } ], "paths": { "/api/1.0/runtime/caches/identity/{envId}/invalidate": { "post": { "tags": [ "Cache Management" ], "summary": "Identity Cache Invalidation", "operationId": "InvalidateIdentityCache", "security": [ { "bearerAuth": [] } ], "description": "Performs a cache invalidation operation for identity data in the PAAs related to the relevant Environment.

    \n

    When to use this API

    Use this API when identity-related data changes—such as group membership, attribute values, or source assignments—and you want to immediately clear outdated entries from the Identity cache.
    \nExample Use Case: Identity data is cached for each user during the first Authorization request and will be invalidated when the user logs off an Application. So during the next login to the Application, fresh data will be re-fetched for the current Authorization session.
    \n

    Using this API

    \n

    Authentication

    A valid PlainID Platform JWT is required in the `Authorization` header. Refer to our Get Access Token API to retrieve a valid JWT for the Bearer Token.

    How to use this API

    Provide at least one of identityTemplate or identityId in the request body.
    To invalidate all identity caches for a specific template in Environment's PAAs, send a JSON object in the request body with the Identity Template ID only. The identityId is optional when identityTemplate is provided, and required if identityTemplate is absent. To invalidate all identity caches for a specific template in Environment's PAAs, send a JSON object in the request body with the Identity Template ID only. The invalidation can be applied broadly for all Identity Source data and for all users, or scoped down using these **optional** parameters in the request body: \n\n\n\n\n

    Notice

    When accessing the Authorization APIs, the URL base/prefix depends on your PlainID PDP location:
  • United States Cloud PDP - `https://tenant-name.us1.plainid.io`
  • Canadian Cloud PDP - `https://tenant-name.ca1.plainid.io`
  • European Cloud PDP - `https://tenant-name.eu1.plainid.io`
  • Local PAA - `https://your-paa.acme.local`

  • \nFor more information on which Asset Types to use with your PAA or Cloud PDP, refer to Managing Asset Types.
    \n

    cURL Sample Guidelines

    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.


    \n

    Important note about headers

    Refer to the headers below to modify your cURL sample. Check if the following headers are in the sample—if not, ensure you add them before pasting into your API tool.

    \n

    Headers

    \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    HeaderValuecURL Line
    Acceptapplication/json'accept: application/json'
    Content-Typeapplication/json'content-type: application/json'
    X-Request-ID (optional)UUID'X-Request-ID: {uuid}'

    \nNote: RequestID Header (optional): You may include an X-Request-ID header for traceability. If not provided, the system will generate one automatically.

    ", "parameters": [ { "name": "envId", "in": "path", "required": "true", "schema": { "type": "string" }, "description": "The Environment ID can be found under the Details tab in the Environment Settings.", "example": "08ae32e4-fbf3-4cc8-b3b9-3b4061d1c825" }, { "name": "verbose", "in": "query", "required": "false", "schema": { "type": "boolean", "default": "false" }, "example": "false", "description": "When true, returns a structured success payload with a textual summary and invalidated keys count." } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InvalidateIdentityCacheRequest" }, "examples": { "fullInvalidation": { "summary": "Invalidate all identity caches for a template", "value": { "identityTemplate": "User" } }, "specificUser": { "summary": "Invalidate specific user's identity cache", "value": { "identityTemplate": "User", "identityId": "john.doe@example.com" } }, "userAcrossTemplates": { "summary": "Invalidate a specific user across all templates in the environment", "value": { "identityId": "john.doe@example.com" } }, "specificSource": { "summary": "Invalidate specific attribute source", "value": { "identityTemplate": "User", "attributeSourceId": "3cb6e371-c76b-408d-a9cb-6d4b260145b0" } }, "userAndSource": { "summary": "Invalidate specific user from specific source", "value": { "identityTemplate": "User", "identityId": "john.doe@example.com", "attributeSourceId": "3cb6e371-c76b-408d-a9cb-6d4b260145b0" } } } } } }, "responses": { "200": { "description": "Identity cache invalidated successfully. Returns an empty 200 response by default; when verbose=true, returns a structured success payload.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CacheInvalidationSuccessResponse" }, "examples": { "verboseSuccess": { "summary": "Successful verbose cache invalidation", "value": { "status": "success", "operation": "identity", "message": "Invalidated 37 identity cache keys for user john.doe@example.com across 4 identity templates", "invalidatedKeysCount": "37", "requestId": "7d0f56ff-7816-4565-ac07-4cd772e196ea", "targets": { "environmentId": "08ae32e4-fbf3-4cc8-b3b9-3b4061d1c825", "identityId": "john.doe@example.com" } } } } } } }, "400": { "description": "Bad Request - Missing required parameters", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GenericErrorsArray" }, "examples": { "missingIdentityTemplate": { "summary": "Missing required identityTemplate or identityId parameter", "value": { "errors": [ { "code": "ERR-001", "status": "400", "name": "InvalidRequest", "message": "Either identityTemplate or identityId must be provided" } ] } } } } } }, "401": { "description": "Unauthorized - Invalid or missing JWT token", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GenericErrorsArray" }, "examples": { "unauthorized": { "summary": "Missing or invalid authentication token", "value": { "errors": [ { "code": "ERR-401", "status": "401", "name": "Unauthorized", "message": "Invalid or missing authentication token" } ] } } } } } }, "424": { "description": "Failed Dependency - Unable to connect to cache service", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GenericErrorsArray" }, "examples": { "redisConnectionFailed": { "summary": "Redis connection failure", "value": { "errors": [ { "code": "ERR-424", "status": "424", "name": "FailedDependency", "message": "Unable to connect to Redis cache service" } ] } } } } } } } } } }, "components": { "schemas": { "InvalidateIdentityCacheRequest": { "type": "object", "description": "Provide at least one of identityTemplate or identityId.
    To invalidate all identity caches in Environment's PAAs for a specific template, send a JSON object in the request body with the Identity Template ID only. To invalidate a single user across all templates in the environment, send identityId only.", "properties": { "identityTemplate": { "type": "string", "description": "The Identity Template ID where the identity is defined. Optional when identityId is provided. You can find this in your Identity Workspace Settings. For more information, refer to Identity Workspace Settings in the PlainID documentation.", "example": "User" }, "attributeSourceId": { "type": "string", "description": "The identifier of the Attribute Source to limit the invalidation to identities from a specific source. For information on the sourceID parameter and where to locate it, check out Managing Attribute Sources in the PlainID documentation.", "example": "3cb6e371-c76b-408d-a9cb-6d4b260145b0" }, "identityId": { "type": "string", "description": "The Identity UID to invalidate, as modeled and mapped in the Identity Template. Note: This is the same user ID that is used when sending an Authorization request with the `entityId` parameter. Optional when identityTemplate is provided, and required if identityTemplate is absent.", "example": "john.doe@example.com" } } }, "CacheInvalidationSuccessResponse": { "type": "object", "description": "Verbose success payload returned when the verbose query parameter is true.", "properties": { "status": { "type": "string", "example": "success" }, "operation": { "type": "string", "example": "response" }, "message": { "type": "string", "example": "Invalidated 124 response cache keys for user john.doe@example.com across 2 scopes" }, "invalidatedKeysCount": { "type": "integer", "format": "int64", "example": "124" }, "requestId": { "type": "string", "example": "e319dc1f-96ef-4ec0-bf8f-a9df42f31ab6" }, "targets": { "$ref": "#/components/schemas/CacheInvalidationTargets" } }, "required": [ "status", "operation", "message", "invalidatedKeysCount", "requestId", "targets" ] }, "GenericErrorsArray": { "type": "object", "properties": { "errors": { "type": "array", "uniqueItems": "true", "minItems": "1", "items": { "$ref": "#/components/schemas/GenericError" } } }, "required": [ "errors" ], "x-examples": { "example-1": { "errors": [ { "id": "XXXX", "code": "YYYY", "message": "Invalid request" } ] } } }, "CacheInvalidationTargets": { "type": "object", "properties": { "environmentId": { "type": "string", "example": "08ae32e4-fbf3-4cc8-b3b9-3b4061d1c825" }, "identityId": { "type": "string", "nullable": "true", "example": "john.doe@example.com" }, "identityTemplate": { "type": "string", "nullable": "true", "example": "User" }, "attributeSourceId": { "type": "string", "nullable": "true", "example": "3cb6e371-c76b-408d-a9cb-6d4b260145b0" }, "clientIds": { "type": "array", "items": { "type": "string" } } } }, "GenericError": { "type": "object", "properties": { "id": { "type": "string", "minLength": "1" }, "code": { "type": "string", "minLength": "1" }, "name": { "type": "string", "minLength": "1" }, "message": { "type": "string", "minLength": "1" } }, "required": [ "id", "code", "message", "name" ] } } } } ````