Skip to main content

K12 API Reference

The K12 Safety API exposes 17 tools organized into three workflow families plus cancellation. Two endpoint styles are available -- choose whichever fits your integration.

Endpoint StylePatternRequest BodyDocs
LegacyPOST /ai/api/tools/{tool-id}/execute{ "data": { ... } }Legacy Endpoints
Domain RoutesPOST /ai/k12/tools/{slug}{ ... } (flat JSON)Domain Routes

Both styles reach the same underlying tools, use the same authentication, and return the same data. Domain routes additionally expose workflow endpoints for sync/async execution.


Authentication

Every API call requires three headers:

HeaderValue
AuthorizationBearer {access_token} (OAuth 2.0 client credentials)
Ocp-Apim-Subscription-Key{subscription_key}
Content-Typeapplication/json

Obtaining a Token

TOKEN=$(curl -s -X POST \
"https://login.microsoftonline.com/ef3e1dbf-4cc9-4a06-bc23-71dd7a46fd1b/oauth2/v2.0/token" \
-d "client_id={CLIENT_ID}" \
-d "client_secret={CLIENT_SECRET}" \
-d "scope=api://dev-k12-aitools-t27p-api/.default" \
-d "grant_type=client_credentials" \
| jq -r '.access_token')

Tokens expire after approximately 1 hour. Cache and refresh proactively.

note

Replace {CLIENT_ID} and {CLIENT_SECRET} with your credentials. These will be provided separately by your administrator.

Environments

EnvironmentBase URLOAuth Scope
Developmenthttps://dev-k12-aitools-t27p-apim.azure-api.netapi://dev-k12-aitools-t27p-api/.default
note

The subscription key and client credentials will be provided separately by your administrator.


Tool Inventory

Tool IDDomain SlugGroupPurpose
k12-district-planning-kickoffdistrict-planning-kickoffEOP EditingStart district-level EOP planning edits
k12-facility-planning-kickofffacility-planning-kickoffEOP EditingStart facility-level EOP planning edits
k12-functional-annex-kickofffunctional-annex-kickoffEOP EditingStart functional annex editing
k12-hazard-annex-kickoffhazard-annex-kickoffEOP EditingStart hazard annex editing
k12-functional-annex-suggest-roles-kickofffunctional-annex-suggest-roles-kickoffEOP EditingSuggest missing roles for a functional annex
k12-hazard-annex-suggest-roles-kickoffhazard-annex-suggest-roles-kickoffEOP EditingSuggest missing roles for a hazard annex
k12-annex-editing-kickoffannex-editing-kickoffEOP EditingCompatibility kickoff for general EOP annex editing
k12-annex-editing-statusannex-editing-statusEOP EditingPoll editing status
k12-annex-editing-resultannex-editing-resultEOP EditingFetch editing result
k12-qrg-generation-kickoffqrg-generation-kickoffQRG GenerationStart QRG generation from EOP
k12-qrg-generation-statusqrg-generation-statusQRG GenerationPoll generation status
k12-qrg-generation-resultqrg-generation-resultQRG GenerationFetch generated QRGs
k12-qrg-editing-kickoffqrg-editing-kickoffQRG EditingStart QRG section editing
k12-qrg-editing-statusqrg-editing-statusQRG EditingPoll editing status
k12-qrg-editing-resultqrg-editing-resultQRG EditingFetch editing result
k12-cancel-task-requestcancel-task-requestCancellationCancel EOP editing job
k12-qrg-cancelqrg-cancelCancellationCancel QRG generation or editing job

Async Integration Pattern

All tool groups follow the same three-step pattern: kickoff, poll, fetch.

Status Values

StatusTerminalUsed By
acceptedNoAll workflows
processing / PROCESSINGNoEOP/QRG Editing (lowercase), QRG Generation (uppercase)
success / SUCCESSYesEOP/QRG Editing (lowercase), QRG Generation (uppercase)
error / ERRORYesEOP/QRG Editing (lowercase), QRG Generation (uppercase)
cancelled / CANCELLEDYesEOP/QRG Editing (lowercase), QRG Generation (uppercase)
warning

EOP Editing and QRG Editing use lowercase statuses. QRG Generation uses UPPERCASE. Your polling logic must handle both conventions.


Error Responses

HTTP StatusMeaning
400Missing required fields or invalid format (legacy endpoints)
401Invalid or expired token, or missing subscription key
403Token lacks the required scope for this environment
404Tool ID or resource not found
422Validation error (domain routes; also legacy for some tool-level errors)
429Rate limit exceeded
500Internal server error

Next Steps