Ana içeriğe geç

AI Content-Safety Categories API

Endpoints

Authentication

All endpoints require authentication using a Personal API Access Token.

Permissions

  • Admin Only - All endpoints on this page require admin privileges (sysAdmin user or a user with the ADMIN role). This is a platform-level catalog; a project-scoped AI_DEVELOPMENT token is not sufficient here. See Project-Scoped Surface below for the endpoints a project token can use.

Fields

FieldTypeRequiredDescription
namestringYesUnique category name within the visible scope
codestringYesShort category code, lower-cased on save. Shipped rows use AILuminate codes (vcr, ipv, spc_hlt, …)
topicTextstringYesThe canonical (English) definition used for embedding-similarity comparison
topicTextTrstringNoTurkish twin of topicText
displayNamestringNoLabel shown in the catalog; defaults to name when blank
displayNameTrstringNoTurkish twin of displayName
groupstringNoPHYSICAL, NON_PHYSICAL or CONTEXTUAL. Blank is derived from code for shipped codes, otherwise defaults to NON_PHYSICAL; any other value is rejected
descriptionstringNoFree-text description
descriptionTrstringNoTurkish twin of description
llamaGuardCodestringNoLlama Guard 3 safety code (S1S13). Leave empty for your own categories — see below
gdprArticle9booleanNoMarks a category touching GDPR Art.9 special-category personal data
taxonomyVersionstringNoSource taxonomy version for shipped rows
enabledbooleanNoWhether the category is active (defaults to true)
projectIdstringread-onlyScope the category belongs to (admin for global)
builtInbooleanread-onlytrue for Mongock-seeded rows, false for user-created

builtIn is server-owned and ignored in request bodies — a client cannot forge a built-in entry.

Notes

llamaGuardCode is optional and should stay empty on categories you add. The AILuminate-to-Llama-Guard mapping lives in product code and only covers the shipped 14 rows; a category you create has no counterpart. Inventing an S-code makes an external judge's verdict trace back to the wrong category.

Shipped categories are editable and deletable, and deletion is permanent. Mongock deduplicates changesets by id and no seed changeset is runAlways=true, so a seed that has already run does not run again — a deleted shipped category does not reappear on a version upgrade. It returns only if a future release ships an explicit re-seed changeset. Rewording one is allowed but breaks its link to the cited MLCommons standard.

No redeploy is implied. Off-Topic Protection policies snapshot-copy topicText rather than referencing a category id, so writes here never change a policy that already uses one.

Project-Scoped Surface

Besides the admin/global endpoints above (/apiops/settings/ai-topic-category-presets/...), the same family is exposed under a project-scoped path, so a project's own AI_DEVELOPMENT token can read the effective catalog and manage its own entries without platform ADMIN privileges:

GET /apiops/projects/{projectName}/ai-topic-category-presets/
GET /apiops/projects/{projectName}/ai-topic-category-presets/{entryName}/
POST /apiops/projects/{projectName}/ai-topic-category-presets/{entryName}/
PUT /apiops/projects/{projectName}/ai-topic-category-presets/{entryName}/
DELETE /apiops/projects/{projectName}/ai-topic-category-presets/{entryName}/

Same 5-endpoint shape, request/response bodies and field surface as the admin endpoints — only the base path, scope resolution and permission differ:

Admin surface (/apiops/settings/...)Project surface (/apiops/projects/{projectName}/...)
Scope resolutionOptional ?projectId= query parameter (default admin/global scope){projectName} path segment, resolved to the caller's own project — never a query parameter
PermissionSystem admin (sysAdmin user or ADMIN role)AI_DEVELOPMENT + VIEW (read) / MANAGE (write) in the project
Read visibilityEntries in the resolved scope onlyUnion of built-in ∪ admin-shared ∪ this project's own entries
Write visibilityAny entry in the resolved scopeOnly entries this project owns. A name that resolves only to a built-in or admin-shared row is treated as not existing for this project: POST creates a project-owned copy, while PUT/DELETE report it as not found