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

Prev Next
Post
/api/1.0/runtime/caches/identity/{envId}/invalidate

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:
  • Attribute Source ID: Limits invalidation to Identity data from a specific Identity Attribute source, which is defined as part of your Identity Template.
    • If only the Attribute Source ID is provided, all cached identity data for that source will be invalidated across all users.
  • Identity ID: Invalidates dentity data for a specific user, identified by the unique identifier (UID) as defined in the Identity template. This clears any cached data associated with that user.
    • If only the Identity ID is provided, the user's identity data will be invalidated across all cached sources.
  • If both parameters are provided, the identity data for the specified user and source will be invalidated.

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.

    Security
    HTTP
    Type bearer

    For more details about Administration API Authentication, check out the Authentication APIs documentation
    Provide your bearer token in the Authorization header when making requests to protected resources.
    Example: Authorization: Bearer 123

    Path parameters
    envId
    stringRequired

    The Environment ID can be found under the Details tab in the Environment Settings.

    Example08ae32e4-fbf3-4cc8-b3b9-3b4061d1c825
    Query parameters
    verbose
    boolean

    When true, returns a structured success payload with a textual summary and invalidated keys count.

    Defaultfalse
    Examplefalse
    Body parameters
    fullInvalidation

    Invalidate all identity caches for a template

    {
      "identityTemplate": "User"
    }
    specificUser

    Invalidate specific user's identity cache

    {
      "identityTemplate": "User",
      "identityId": "john.doe@example.com"
    }
    userAcrossTemplates

    Invalidate a specific user across all templates in the environment

    {
      "identityId": "john.doe@example.com"
    }
    specificSource

    Invalidate specific attribute source

    {
      "identityTemplate": "User",
      "attributeSourceId": "3cb6e371-c76b-408d-a9cb-6d4b260145b0"
    }
    userAndSource

    Invalidate specific user from specific source

    {
      "identityTemplate": "User",
      "identityId": "john.doe@example.com",
      "attributeSourceId": "3cb6e371-c76b-408d-a9cb-6d4b260145b0"
    }
    object

    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.

    identityTemplate
    string

    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.

    ExampleUser
    attributeSourceId
    string

    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.

    Example3cb6e371-c76b-408d-a9cb-6d4b260145b0
    identityId
    string

    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.

    Examplejohn.doe@example.com
    Responses
    200

    Identity cache invalidated successfully. Returns an empty 200 response by default; when verbose=true, returns a structured success payload.

    verboseSuccess

    Successful verbose cache invalidation

    {
      "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"
      }
    }
    Expand All
    object

    Verbose success payload returned when the verbose query parameter is true.

    status
    string
    Examplesuccess
    operation
    string
    Exampleresponse
    message
    string
    ExampleInvalidated 124 response cache keys for user john.doe@example.com across 2 scopes
    invalidatedKeysCount
    integer (int64)
    Example124
    requestId
    string
    Examplee319dc1f-96ef-4ec0-bf8f-a9df42f31ab6
    targets
    object (CacheInvalidationTargets)
    environmentId
    string
    Example08ae32e4-fbf3-4cc8-b3b9-3b4061d1c825
    identityId
    string | null
    Examplejohn.doe@example.com
    identityTemplate
    string | null
    ExampleUser
    attributeSourceId
    string | null
    Example3cb6e371-c76b-408d-a9cb-6d4b260145b0
    clientIds
    Array of string
    string
    400

    Bad Request - Missing required parameters

    missingIdentityTemplate

    Missing required identityTemplate or identityId parameter

    {
      "errors": [
        {
          "code": "ERR-001",
          "status": 400,
          "name": "InvalidRequest",
          "message": "Either identityTemplate or identityId must be provided"
        }
      ]
    }
    Expand All
    object
    errors
    Array of object (GenericError)
    Min items1
    object
    id
    string
    Min length1
    code
    string
    Min length1
    name
    string
    Min length1
    message
    string
    Min length1
    401

    Unauthorized - Invalid or missing JWT token

    unauthorized

    Missing or invalid authentication token

    {
      "errors": [
        {
          "code": "ERR-401",
          "status": 401,
          "name": "Unauthorized",
          "message": "Invalid or missing authentication token"
        }
      ]
    }
    Expand All
    object
    errors
    Array of object (GenericError)
    Min items1
    object
    id
    string
    Min length1
    code
    string
    Min length1
    name
    string
    Min length1
    message
    string
    Min length1
    424

    Failed Dependency - Unable to connect to cache service

    redisConnectionFailed

    Redis connection failure

    {
      "errors": [
        {
          "code": "ERR-424",
          "status": 424,
          "name": "FailedDependency",
          "message": "Unable to connect to Redis cache service"
        }
      ]
    }
    Expand All
    object
    errors
    Array of object (GenericError)
    Min items1
    object
    id
    string
    Min length1
    code
    string
    Min length1
    name
    string
    Min length1
    message
    string
    Min length1

    © 2024 PlainID LTD. All rights reserved.