---
updatedAt: 2026-08-24T15:48:49.000Z
agentTools:
  siteIndex: https://techdocs.akamai.com/llms.txt
  projectIndex: https://techdocs.akamai.com/application-security/llms.txt
---

# Create a custom PII type

This creates a new custom PII type for an editable, non-active configuration version. Reference the returned `customPiiId` from the `customPiiEntities` of a PII rule on that same version. The response's `Location` header gives you the new custom PII type's URL.

# OpenAPI definition

```json
{
  "externalDocs": {
    "description": "See documentation for Akamai's Application Security API",
    "url": "https://techdocs.akamai.com/application-security/reference"
  },
  "info": {
    "license": {
      "name": "Apache 2.0",
      "url": "https://www.apache.org/licenses/LICENSE-2.0.html"
    },
    "title": "Firewall for AI Configuration",
    "version": "v1"
  },
  "openapi": "3.0.1",
  "paths": {
    "/fai-configurations/{faiConfigId}/versions/{version}/custom-pii-types": {
      "post": {
        "description": "This creates a new custom PII type for an editable, non-active configuration version. Reference the returned `customPiiId` from the `customPiiEntities` of a PII rule on that same version. The response's `Location` header gives you the new custom PII type's URL.",
        "externalDocs": {
          "description": "See documentation for this operation in Akamai's Application Security API",
          "url": "https://techdocs.akamai.com/application-security/reference/post-custom-pii-type"
        },
        "operationId": "post-custom-pii-type",
        "parameters": [
          {
            "description": "Identifier for the FAI configuration.",
            "example": "12345",
            "in": "path",
            "name": "faiConfigId",
            "required": true,
            "schema": {
              "pattern": "^[0-9]+$",
              "type": "string"
            },
            "x-akamai": {
              "file-path": "parameters/fai-config-id-path.yaml"
            }
          },
          {
            "description": "Version number of the FAI configuration.",
            "example": 5,
            "in": "path",
            "name": "version",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "x-akamai": {
              "file-path": "parameters/fai-version-path.yaml"
            }
          },
          {
            "description": "For customers who manage more than one account, this [runs the operation from another account](https://techdocs.akamai.com/developer/docs/manage-many-accounts-with-one-api-client). The Identity and Access Management API provides a [list of available account switch keys](https://techdocs.akamai.com/iam-api/reference/get-client-account-switch-keys).",
            "in": "query",
            "name": "accountSwitchKey",
            "required": false,
            "schema": {
              "example": "1-5C0YLB:1-8BYUX",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "customPiiName": "Internal Project Code",
                "patterns": [
                  "^PRJ-[A-Z]{3}-\\d{4}$"
                ]
              },
              "schema": {
                "additionalProperties": false,
                "description": "Request body for creating or updating a custom PII type. The server assigns the custom PII type identifier.",
                "properties": {
                  "customPiiName": {
                    "description": "The human-readable name for this custom PII type. This descriptive name helps administrators understand what type of sensitive data this definition detects. It appears in configuration management interfaces and audit logs for clarity and governance purposes. Must be unique within the configuration version.",
                    "maxLength": 255,
                    "minLength": 1,
                    "type": "string"
                  },
                  "patterns": {
                    "description": "List of regular expression patterns that define how to detect this custom PII type in content. Each pattern is a regular expression string that matches the specific format of the sensitive data. Multiple patterns can be provided to account for format variations, such as with or without delimiters, and different prefix conventions. Patterns evaluate using standard regular expression syntax and should be carefully tested to balance detection accuracy with false positive rates. When multiple patterns are provided, content matching any pattern is considered a match for this custom PII type.",
                    "items": {
                      "description": "A regular expression pattern to detect the custom PII type. The pattern uses standard regular expression syntax and can be optimized for the specific data format being detected. Consider edge cases, format variations, and potential false positives when designing patterns. Example patterns: `EMP-[0-9]{6}` for employee IDs like `EMP-123456`, or `\\b[A-Z]{3}-[0-9]{4}-[A-Z]{2}\\b` for custom reference codes.",
                      "maxLength": 500,
                      "minLength": 1,
                      "type": "string"
                    },
                    "minItems": 1,
                    "type": "array"
                  }
                },
                "required": [
                  "customPiiName",
                  "patterns"
                ],
                "type": "object",
                "x-akamai": {
                  "file-path": "schemas/custom-pii-type-request.yaml"
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "example": {
                  "customPiiId": "10042",
                  "customPiiName": "Internal Project Code",
                  "patterns": [
                    "^PRJ-[A-Z]{3}-\\d{4}$"
                  ]
                },
                "schema": {
                  "additionalProperties": false,
                  "description": "Represents a custom personally identifiable information (PII) type definition for detecting organization-specific sensitive data patterns. Custom PII types extend beyond the platform's predefined PII entity types,  such as credit cards, SSNs, and email addresses, to enable detection of proprietary or domain-specific sensitive identifiers such as employee IDs, internal account numbers, custom reference codes, or industry-specific data formats. Each custom PII type is defined using one or more regular expression patterns that match the sensitive data format. Once created, reference the returned `customPiiId` from a PII rule's `customPiiEntities` on that same version.",
                  "properties": {
                    "customPiiId": {
                      "description": "__Read-only__ Identifies this custom PII type within the configuration version. Use it to reference the custom PII type in PII detection rules, specifically in their `customPiiEntities` array.",
                      "maxLength": 19,
                      "minLength": 1,
                      "pattern": "^[0-9]+$",
                      "readOnly": true,
                      "type": "string"
                    },
                    "customPiiName": {
                      "description": "The human-readable name for this custom PII type. This descriptive name helps administrators understand what type of sensitive data this definition detects. It appears in configuration management interfaces and audit logs for clarity and governance purposes. Must be unique within the configuration version.",
                      "maxLength": 255,
                      "minLength": 1,
                      "type": "string"
                    },
                    "patterns": {
                      "description": "List of regular expression patterns that define how to detect this custom PII type in content. Each pattern is a regular expression string that matches the specific format of the sensitive data. Multiple patterns can be provided to account for format variations, such as with or without delimiters, and different prefix conventions. Patterns evaluate using standard regular expression syntax and should be carefully tested to balance detection accuracy with false positive rates. When multiple patterns are provided, content matching any pattern is considered a match for this custom PII type.",
                      "items": {
                        "description": "A regular expression pattern to detect the custom PII type. The pattern uses standard regular expression syntax and can be optimized for the specific data format being detected. Consider edge cases, format variations, and potential false positives when designing patterns. Example patterns: `EMP-[0-9]{6}` for employee IDs like `EMP-123456`, or `\\b[A-Z]{3}-[0-9]{4}-[A-Z]{2}\\b` for custom reference codes.",
                        "maxLength": 500,
                        "minLength": 1,
                        "type": "string"
                      },
                      "minItems": 1,
                      "type": "array"
                    }
                  },
                  "required": [
                    "customPiiId",
                    "customPiiName",
                    "patterns"
                  ],
                  "type": "object",
                  "x-akamai": {
                    "file-path": "schemas/custom-pii-type.yaml"
                  }
                }
              }
            },
            "description": "Custom PII entity created successfully.",
            "headers": {
              "Location": {
                "description": "The absolute URL of the newly created custom PII type. Returned in the 201 Created response. You can retrieve the new custom PII type with [List custom PII types](ref:get-custom-pii-types).",
                "required": true,
                "schema": {
                  "example": "https://{hostname}/appsec/v1/fai-configurations/12345/versions/5/custom-pii-types/10042",
                  "type": "string"
                },
                "x-akamai": {
                  "file-path": "headers/location-custom-pii-type.yaml"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/problem+json": {
                "example": {
                  "detail": "faiConfigId must be a number, but the request has \"abc\". Use a faiConfigId from List FAI configurations.",
                  "instance": "https://problems.luna.akamaiapis.net/appsec/error-instances/00241e66342ab3ed",
                  "status": 400,
                  "title": "Invalid Input Error",
                  "type": "https://problems.luna.akamaiapis.net/appsec/error-types/INVALID-INPUT-ERROR"
                },
                "schema": {
                  "additionalProperties": true,
                  "description": "Details the errors you can receive.",
                  "properties": {
                    "detail": {
                      "description": "The detailed error message.",
                      "type": "string"
                    },
                    "fieldErrors": {
                      "description": "Pointers to fields for which invalid input was provided, whose values are messages detailing the reason this input was invalid for this field.",
                      "type": "object"
                    },
                    "instance": {
                      "description": "The non-referenceable URI that indicates the error instance.",
                      "example": "https://problems.luna.akamaiapis.net/api-definitions/error-instances/d54686b5-21cb-4ab7-a8d6-a92282cf1749",
                      "type": "string"
                    },
                    "status": {
                      "description": "The HTTP status code.",
                      "example": 404,
                      "type": "integer"
                    },
                    "title": {
                      "description": "The error title.",
                      "example": "Not Found",
                      "type": "string"
                    },
                    "type": {
                      "description": "The URL for the error type.",
                      "example": "https://problems.luna.akamaiapis.net/api-definitions/error-types/NOT-FOUND",
                      "type": "string"
                    }
                  },
                  "required": [
                    "title",
                    "type",
                    "detail",
                    "instance",
                    "status"
                  ],
                  "type": "object",
                  "x-akamai": {
                    "file-path": "schemas/problem-details.yaml"
                  }
                }
              }
            },
            "description": "[Bad request](ref:400). The request isn't valid, for example an id that isn't a number, a missing or out-of-range field, a value that isn't allowed, or rule settings that conflict. The `detail` names the field, the value sent, and what to change.",
            "x-akamai": {
              "file-path": "errors/400-fai.yaml"
            }
          },
          "401": {
            "content": {
              "application/problem+json": {
                "example": {
                  "detail": "The signature does not match",
                  "instance": "https://problems.luna.akamaiapis.net/appsec/error-instances/d54686b5-21cb-4ab7-a8d6-a92282cf1749",
                  "status": 401,
                  "title": "Not authorized",
                  "type": "https://problems.luna-dev.akamaiapis.net/-/pep-authn/deny"
                },
                "schema": {
                  "additionalProperties": true,
                  "description": "Details the errors you can receive.",
                  "properties": {
                    "detail": {
                      "description": "The detailed error message.",
                      "type": "string"
                    },
                    "fieldErrors": {
                      "description": "Pointers to fields for which invalid input was provided, whose values are messages detailing the reason this input was invalid for this field.",
                      "type": "object"
                    },
                    "instance": {
                      "description": "The non-referenceable URI that indicates the error instance.",
                      "example": "https://problems.luna.akamaiapis.net/api-definitions/error-instances/d54686b5-21cb-4ab7-a8d6-a92282cf1749",
                      "type": "string"
                    },
                    "status": {
                      "description": "The HTTP status code.",
                      "example": 404,
                      "type": "integer"
                    },
                    "title": {
                      "description": "The error title.",
                      "example": "Not Found",
                      "type": "string"
                    },
                    "type": {
                      "description": "The URL for the error type.",
                      "example": "https://problems.luna.akamaiapis.net/api-definitions/error-types/NOT-FOUND",
                      "type": "string"
                    }
                  },
                  "required": [
                    "title",
                    "type",
                    "detail",
                    "instance",
                    "status"
                  ],
                  "type": "object",
                  "x-akamai": {
                    "file-path": "schemas/problem-details.yaml"
                  }
                }
              }
            },
            "description": "[Unauthorized](ref:401).",
            "x-akamai": {
              "file-path": "errors/401.yaml"
            }
          },
          "403": {
            "content": {
              "application/problem+json": {
                "example": {
                  "detail": "You don't have permission to read configuration 12345. Ask your Akamai administrator for access to the group that owns it.",
                  "instance": "https://problems.luna.akamaiapis.net/fai-config-api/error-instances/00264e4851db2f06",
                  "status": 403,
                  "title": "This operation is invalid",
                  "type": "https://problems.luna.akamaiapis.net/fai-config-api/error-types/FORBIDDEN-OPERATION"
                },
                "schema": {
                  "additionalProperties": true,
                  "description": "Details the errors you can receive.",
                  "properties": {
                    "detail": {
                      "description": "The detailed error message.",
                      "type": "string"
                    },
                    "fieldErrors": {
                      "description": "Pointers to fields for which invalid input was provided, whose values are messages detailing the reason this input was invalid for this field.",
                      "type": "object"
                    },
                    "instance": {
                      "description": "The non-referenceable URI that indicates the error instance.",
                      "example": "https://problems.luna.akamaiapis.net/api-definitions/error-instances/d54686b5-21cb-4ab7-a8d6-a92282cf1749",
                      "type": "string"
                    },
                    "status": {
                      "description": "The HTTP status code.",
                      "example": 404,
                      "type": "integer"
                    },
                    "title": {
                      "description": "The error title.",
                      "example": "Not Found",
                      "type": "string"
                    },
                    "type": {
                      "description": "The URL for the error type.",
                      "example": "https://problems.luna.akamaiapis.net/api-definitions/error-types/NOT-FOUND",
                      "type": "string"
                    }
                  },
                  "required": [
                    "title",
                    "type",
                    "detail",
                    "instance",
                    "status"
                  ],
                  "type": "object",
                  "x-akamai": {
                    "file-path": "schemas/problem-details.yaml"
                  }
                }
              }
            },
            "description": "[Forbidden](ref:403). You don't have the access this operation needs, or your account isn't entitled to a feature the request uses, such as a rule, the `MODIFY` action, or `languages`. The `detail` says which access or entitlement to ask for.",
            "x-akamai": {
              "file-path": "errors/403-fai.yaml"
            }
          },
          "404": {
            "content": {
              "application/problem+json": {
                "example": {
                  "detail": "Configuration 12345 doesn't exist in your account. Check the faiConfigId, or run List FAI configurations to find it.",
                  "instance": "https://problems.luna.akamaiapis.net/fai-config-api/error-instances/0026e8bba97ea06e",
                  "status": 404,
                  "title": "Not Found",
                  "type": "https://problems.luna.akamaiapis.net/fai-config-api/error-types/NOT-FOUND"
                },
                "schema": {
                  "additionalProperties": true,
                  "description": "Details the errors you can receive.",
                  "properties": {
                    "detail": {
                      "description": "The detailed error message.",
                      "type": "string"
                    },
                    "fieldErrors": {
                      "description": "Pointers to fields for which invalid input was provided, whose values are messages detailing the reason this input was invalid for this field.",
                      "type": "object"
                    },
                    "instance": {
                      "description": "The non-referenceable URI that indicates the error instance.",
                      "example": "https://problems.luna.akamaiapis.net/api-definitions/error-instances/d54686b5-21cb-4ab7-a8d6-a92282cf1749",
                      "type": "string"
                    },
                    "status": {
                      "description": "The HTTP status code.",
                      "example": 404,
                      "type": "integer"
                    },
                    "title": {
                      "description": "The error title.",
                      "example": "Not Found",
                      "type": "string"
                    },
                    "type": {
                      "description": "The URL for the error type.",
                      "example": "https://problems.luna.akamaiapis.net/api-definitions/error-types/NOT-FOUND",
                      "type": "string"
                    }
                  },
                  "required": [
                    "title",
                    "type",
                    "detail",
                    "instance",
                    "status"
                  ],
                  "type": "object",
                  "x-akamai": {
                    "file-path": "schemas/problem-details.yaml"
                  }
                }
              }
            },
            "description": "[Not found](ref:404). A resource in the URL doesn't exist: the configuration, version, custom PII type, application, access key, or activation. The `detail` names the missing id and where to find valid ones.",
            "x-akamai": {
              "file-path": "errors/404-fai.yaml"
            }
          },
          "409": {
            "content": {
              "application/problem+json": {
                "example": {
                  "detail": "Version 4 of FAI configuration 12345 is ACTIVE, so you can't create custom PII types on it. A version that's pending activation or has ever been activated can't be changed. Clone the version and make your changes on the clone.",
                  "instance": "https://problems.luna.akamaiapis.net/fai-config-api/error-instances/9a9a0cd4db9808b4",
                  "status": 409,
                  "title": "Conflict",
                  "type": "https://problems.luna.akamaiapis.net/fai-config-api/error-types/CONFLICT"
                },
                "schema": {
                  "additionalProperties": true,
                  "description": "Details the errors you can receive.",
                  "properties": {
                    "detail": {
                      "description": "The detailed error message.",
                      "type": "string"
                    },
                    "fieldErrors": {
                      "description": "Pointers to fields for which invalid input was provided, whose values are messages detailing the reason this input was invalid for this field.",
                      "type": "object"
                    },
                    "instance": {
                      "description": "The non-referenceable URI that indicates the error instance.",
                      "example": "https://problems.luna.akamaiapis.net/api-definitions/error-instances/d54686b5-21cb-4ab7-a8d6-a92282cf1749",
                      "type": "string"
                    },
                    "status": {
                      "description": "The HTTP status code.",
                      "example": 404,
                      "type": "integer"
                    },
                    "title": {
                      "description": "The error title.",
                      "example": "Not Found",
                      "type": "string"
                    },
                    "type": {
                      "description": "The URL for the error type.",
                      "example": "https://problems.luna.akamaiapis.net/api-definitions/error-types/NOT-FOUND",
                      "type": "string"
                    }
                  },
                  "required": [
                    "title",
                    "type",
                    "detail",
                    "instance",
                    "status"
                  ],
                  "type": "object",
                  "x-akamai": {
                    "file-path": "schemas/problem-details.yaml"
                  }
                }
              }
            },
            "description": "[Conflict](ref:409). Another custom PII type on the version already uses that `customPiiName`, or the custom PII type for this configuration can't be created or changed because its `activationStatus` isn't `INACTIVE` or `FAILED`. Clone the configuration using [Clone an FAI configuration version](ref:post-fai-configuration-version-clone), then edit the clone, which inherits the custom PII types.",
            "x-akamai": {
              "file-path": "errors/409-fai-custom-pii-not-editable.yaml"
            }
          },
          "500": {
            "content": {
              "application/problem+json": {
                "example": {
                  "detail": "Something went wrong while processing the request. Try again later. If it keeps happening, contact Akamai support and include the instance value.",
                  "instance": "https://problems.luna.akamaiapis.net/appsec/error-instances/00276fe0962da3a9",
                  "status": 500,
                  "title": "Internal Server Error",
                  "type": "https://problems.luna.akamaiapis.net/appsec/error-types/INTERNAL-SERVER-ERROR"
                },
                "schema": {
                  "additionalProperties": true,
                  "description": "Details the errors you can receive.",
                  "properties": {
                    "detail": {
                      "description": "The detailed error message.",
                      "type": "string"
                    },
                    "fieldErrors": {
                      "description": "Pointers to fields for which invalid input was provided, whose values are messages detailing the reason this input was invalid for this field.",
                      "type": "object"
                    },
                    "instance": {
                      "description": "The non-referenceable URI that indicates the error instance.",
                      "example": "https://problems.luna.akamaiapis.net/api-definitions/error-instances/d54686b5-21cb-4ab7-a8d6-a92282cf1749",
                      "type": "string"
                    },
                    "status": {
                      "description": "The HTTP status code.",
                      "example": 404,
                      "type": "integer"
                    },
                    "title": {
                      "description": "The error title.",
                      "example": "Not Found",
                      "type": "string"
                    },
                    "type": {
                      "description": "The URL for the error type.",
                      "example": "https://problems.luna.akamaiapis.net/api-definitions/error-types/NOT-FOUND",
                      "type": "string"
                    }
                  },
                  "required": [
                    "title",
                    "type",
                    "detail",
                    "instance",
                    "status"
                  ],
                  "type": "object",
                  "x-akamai": {
                    "file-path": "schemas/problem-details.yaml"
                  }
                }
              }
            },
            "description": "[Internal server error](ref:500). Something failed on Akamai's side. Try again later. If it keeps happening, contact Akamai support with the `instance` value.",
            "x-akamai": {
              "file-path": "errors/500-fai.yaml"
            }
          }
        },
        "summary": "Create a custom PII type",
        "tags": [
          "Custom PII types"
        ],
        "x-akamai": {
          "path-info": "/fai-configurations/{faiConfigId}/versions/{version}/custom-pii-types"
        }
      },
      "x-akamai": {
        "file-path": "paths/fai-configuration-custom-pii-types.yaml"
      }
    }
  },
  "servers": [
    {
      "url": "https://{hostname}/appsec/v1"
    }
  ],
  "tags": [
    {
      "description": "Manage PII keys for configurations.",
      "name": "Custom PII types"
    }
  ],
  "x-akamai": {
    "auth-type": "EDGE_GRID",
    "file-path": "07-fai-configuration.yaml"
  },
  "x-readme": {
    "explorer-enabled": false,
    "samples-languages": [
      "curl",
      "python",
      "node"
    ]
  }
}
```

# Sibling pages

* [List custom PII types](https://techdocs.akamai.com/application-security/reference/get-custom-pii-types.md)
* [Update a custom PII type](https://techdocs.akamai.com/application-security/reference/put-custom-pii-type.md)