Skip to main content

Legacy Endpoints

Complete request/response schemas, field-level documentation, error responses, and curl examples for every K12 Safety tool using the legacy endpoint pattern.

Every request is a POST to:

POST /ai/api/tools/{tool-id}/execute

All request bodies are wrapped in a data envelope. All examples use the Development base URL. For authentication and environment details, see the API Reference Overview.

note

These schemas also apply to the Domain Routes (/ai/k12/tools/{slug}), which accept the same fields as a flat JSON body without the data wrapper.

note

For async kickoff calls, an accepted response means the job was queued. Continue using the matching status and result endpoints to confirm completion or failure. Platform observability improvements do not change the documented request bodies or successful response bodies.


EOP Editing Tools

k12-annex-editing-kickoff

Compatibility endpoint for general EOP annex editing. New integrations should use the four primary kickoff tools that match the task: k12-district-planning-kickoff, k12-facility-planning-kickoff, k12-functional-annex-kickoff, or k12-hazard-annex-kickoff. The explicit k12-functional-annex-suggest-roles-kickoff and k12-hazard-annex-suggest-roles-kickoff endpoints remain available for compatibility and direct suggest-role invocations.

All EOP kickoff tools use the same request and response schema. The tool ID selects the agent profile and execution mode.

PropertyValue
EndpointPOST /ai/api/tools/k12-annex-editing-kickoff/execute
Scenario-specific endpointsPOST /ai/api/tools/k12-district-planning-kickoff/execute, POST /ai/api/tools/k12-facility-planning-kickoff/execute, POST /ai/api/tools/k12-functional-annex-kickoff/execute, POST /ai/api/tools/k12-hazard-annex-kickoff/execute, POST /ai/api/tools/k12-functional-annex-suggest-roles-kickoff/execute, POST /ai/api/tools/k12-hazard-annex-suggest-roles-kickoff/execute
Content-Typeapplication/json

For k12-functional-annex-kickoff and k12-hazard-annex-kickoff, prompts that normalize to Suggest Roles and Responsibilities automatically switch to the suggest-role execution mode.

Request

{
"data": {
"emergencyOperationPlan": {"id": "plan-abc123", "organizationId": "org-789"},
"userId": "user-456",
"roleId": "safety-coordinator",
"form": {
"name": "Fire Safety Annex",
"field": {
"group": "Response Procedures",
"name": "evacuation_steps",
"content": "<p>Current evacuation procedures for the main building.</p>"
}
},
"prompt": "Add assembly point verification step after building clearance",
"sessionId": null,
"waitForResult": false
}
}

Request Fields

FieldTypeRequiredDescriptionConstraints
emergencyOperationPlanIdstringConditionalEOP plan ID or snapshot ID to edit against. Organization context still requires emergencyOperationPlan.organizationId.--
emergencyOperationPlanobjectConditionalFrontend-provided EOP object. Its id, emergencyOperationPlanId, planId, or eopId is normalized as the plan identifier; organizationId is used directly for district/organization details.Mutually exclusive with configuration and Master Copy identifiers
emergencyOperationPlanConfigurationIdstringConditionalEOP configuration ID for source identity. Organization context still requires emergencyOperationPlanConfiguration.organizationId.Mutually exclusive with plan and Master Copy identifiers
emergencyOperationPlanConfigurationobjectConditionalFrontend-provided configuration object. Its ID aliases are normalized as the configuration identifier; organizationId is used directly for district/organization details.Mutually exclusive with plan and Master Copy identifiers
eopMasterCopyIdstringConditionalEOP Master Copy ID for pre-EOP template form editing. Organization context still requires emergencyOperationPlanMasterCopy.organizationId; supported by the legacy and scenario-specific EOP kickoff tools for district plan, facility plan, functional annex, and hazard annex Master Copies.Mutually exclusive with plan and configuration identifiers
emergencyOperationPlanMasterCopyobjectConditionalFrontend-provided Master Copy object. Saved objects may provide id, eopMasterCopyId, or another Master Copy ID alias. organizationId is used directly for district/organization details.Mutually exclusive with plan and configuration identifiers
userIdstringYesIdentifier of the user initiating the editMinimum 1 character
roleIdstringNoOptional role identifier retained for traceability--
userTagIdsstring[]NoAlias for selected role/tag IDs. May be an empty array while frontend tag filling is pending.--
roles, userTags, generalUserTagsarrayNoFrontend-provided role/tag objects or names. These override backend-resolved role tags for prompt context when present.--
formobjectYesForm data containing the content to editSee nested fields below
form.namestringNoDisplay name of the form being edited--
form.fieldobjectYesThe specific field within the form to editSee nested fields below
form.field.groupstringNoLabel for the field's group within the form--
form.field.namestringNoName of the field being edited--
form.field.contentstringNoCurrent HTML content of the field; empty string forces prompt-only mode--
promptstringNoNatural language instruction describing the desired edit; if omitted, the AI agent uses its default editing prompt--
sessionIdstringNoSession ID for correlating multiple edits in a conversation; null starts a new session--
requestIdstringNoPre-generated request ID; usually omitted so the server generates one--
waitForResultbooleanNoWhen true, the call blocks until editing completes and returns the result synchronously; default is falseDefault: false

Exactly one identity source must be provided: emergencyOperationPlanId/emergencyOperationPlan, emergencyOperationPlanConfigurationId/emergencyOperationPlanConfiguration, or eopMasterCopyId/emergencyOperationPlanMasterCopy. District/organization details are resolved only from the explicit organizationId on the selected request object; the workflow no longer discovers organization IDs indirectly from EOP, configuration, or Master Copy IDs.

Response (Async -- waitForResult: false)

{
"requestId": "req-7f3a2b1c-d4e5-6789-abcd-ef0123456789",
"sessionId": "sess-a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"status": "accepted",
"message": "Editing job accepted and queued for processing",
"workflowRunId": "wf-run-9e8d7c6b-5a4f-3210-fedc-ba9876543210"
}

Response (Sync -- waitForResult: true)

{
"requestId": "req-7f3a2b1c-d4e5-6789-abcd-ef0123456789",
"sessionId": "sess-a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"status": "success",
"message": "Edit completed successfully",
"isEdit": true,
"responseStatus": "success",
"agentResponse": {
"text": "<p>Current evacuation procedures for the main building.</p><p>After confirming all rooms are clear, verify assembly point headcount against the roster before releasing the all-clear signal.</p>"
}
}

Response Fields

FieldTypeDescription
requestIdstringUnique identifier for this editing job
sessionIdstringSession identifier; pass this to subsequent edits for conversation continuity
statusstringaccepted (async) or success / error (sync)
messagestringHuman-readable status message
workflowRunIdstringWorkflow execution identifier (async mode only)
isEditbooleanWhether the response represents an edit operation (sync mode only)
responseStatusstringFinal processing status (sync mode only)
agentResponseobjectContains the AI-generated output (sync mode only)
agentResponse.textstringThe edited HTML content returned by the AI agent

Error Responses

HTTP StatusCondition
400None or more than one of emergencyOperationPlanId/emergencyOperationPlan, emergencyOperationPlanConfigurationId/emergencyOperationPlanConfiguration, and eopMasterCopyId/emergencyOperationPlanMasterCopy provided, or missing/invalid userId or roleId
401Invalid or expired bearer token or missing subscription key
404Specified EOP plan not found
429Rate limit exceeded
500Internal processing error

curl Example (using emergencyOperationPlan object)

curl -X POST "https://dev-k12-aitools-t27p-apim.azure-api.net/ai/api/tools/k12-annex-editing-kickoff/execute" \
-H "Authorization: Bearer $TOKEN" \
-H "Ocp-Apim-Subscription-Key: $SUBSCRIPTION_KEY" \
-H "Content-Type: application/json" \
-d '{
"data": {
"emergencyOperationPlan": {"id": "plan-abc123", "organizationId": "org-789"},
"userId": "user-456",
"roleId": "safety-coordinator",
"form": {
"name": "Fire Safety Annex",
"field": {
"group": "Response Procedures",
"name": "evacuation_steps",
"content": "<p>Current evacuation procedures for the main building.</p>"
}
},
"prompt": "Add assembly point verification step after building clearance"
}
}'

curl Example (using emergencyOperationPlanConfiguration object)

Use this variant for pre-EOP configuration-stage plans where the frontend sends configuration identity plus explicit organization context.

curl -X POST "https://dev-k12-aitools-t27p-apim.azure-api.net/ai/api/tools/k12-annex-editing-kickoff/execute" \
-H "Authorization: Bearer $TOKEN" \
-H "Ocp-Apim-Subscription-Key: $SUBSCRIPTION_KEY" \
-H "Content-Type: application/json" \
-d '{
"data": {
"emergencyOperationPlanConfiguration": {"id": "config-xyz789", "organizationId": "org-789"},
"userId": "user-456",
"roleId": "safety-coordinator",
"form": {
"name": "Fire Safety Annex",
"field": {
"group": "Response Procedures",
"name": "evacuation_steps",
"content": "<p>Current evacuation procedures for the main building.</p>"
}
},
"prompt": "Add assembly point verification step after building clearance"
}
}'

k12-annex-editing-status

Check the current status of one or more EOP annex editing jobs.

PropertyValue
EndpointPOST /ai/api/tools/k12-annex-editing-status/execute
Content-Typeapplication/json

Request

{
"data": {
"requestIds": ["req-7f3a2b1c-d4e5-6789-abcd-ef0123456789"]
}
}

Request Fields

FieldTypeRequiredDescriptionConstraints
requestIdsarray of stringsYesOne or more request IDs to checkEach string minimum 1 character

Response

[
{
"requestId": "req-7f3a2b1c-d4e5-6789-abcd-ef0123456789",
"sessionId": "sess-a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"status": "processing"
}
]

Response Fields

The response is an array with one entry per requested ID:

FieldTypeDescription
requestIdstringThe request ID that was queried
sessionIdstringAssociated session identifier
statusstringCurrent status: accepted, processing, success, error, or cancelled

Error Responses

HTTP StatusCondition
400requestIds is missing, empty, or contains empty strings
401Invalid or expired bearer token or missing subscription key
429Rate limit exceeded

curl Example

curl -X POST "https://dev-k12-aitools-t27p-apim.azure-api.net/ai/api/tools/k12-annex-editing-status/execute" \
-H "Authorization: Bearer $TOKEN" \
-H "Ocp-Apim-Subscription-Key: $SUBSCRIPTION_KEY" \
-H "Content-Type: application/json" \
-d '{
"data": {
"requestIds": ["req-7f3a2b1c-d4e5-6789-abcd-ef0123456789"]
}
}'

k12-annex-editing-result

Fetch the final result of a completed EOP annex editing job.

PropertyValue
EndpointPOST /ai/api/tools/k12-annex-editing-result/execute
Content-Typeapplication/json

Request

{
"data": {
"requestId": "req-7f3a2b1c-d4e5-6789-abcd-ef0123456789"
}
}

Request Fields

FieldTypeRequiredDescriptionConstraints
requestIdstringYesThe editing job request IDMinimum 1 character

Response (Success)

{
"requestId": "req-7f3a2b1c-d4e5-6789-abcd-ef0123456789",
"sessionId": "sess-a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"status": "success",
"message": "<p>Current evacuation procedures for the main building.</p><p>After confirming all rooms are clear, verify assembly point headcount against the roster before releasing the all-clear signal.</p>",
"isEdit": true
}

Response (Error)

{
"requestId": "req-7f3a2b1c-d4e5-6789-abcd-ef0123456789",
"sessionId": "sess-a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"status": "error",
"message": "AI processing failed: unable to generate edited content"
}

Response Fields

FieldTypeDescription
requestIdstringThe editing job request ID
sessionIdstringAssociated session identifier
statusstringTerminal status: success or error
messagestringOn success: the edited HTML content. On error: a description of the failure.
isEditbooleantrue when the response contains edited content

Error Responses

HTTP StatusCondition
400requestId is missing or empty
401Invalid or expired bearer token or missing subscription key
404No result found for the specified request ID
429Rate limit exceeded

curl Example

curl -X POST "https://dev-k12-aitools-t27p-apim.azure-api.net/ai/api/tools/k12-annex-editing-result/execute" \
-H "Authorization: Bearer $TOKEN" \
-H "Ocp-Apim-Subscription-Key: $SUBSCRIPTION_KEY" \
-H "Content-Type: application/json" \
-d '{
"data": {
"requestId": "req-7f3a2b1c-d4e5-6789-abcd-ef0123456789"
}
}'

QRG Generation Tools

k12-qrg-generation-kickoff

Start QRG generation from an Emergency Operation Plan. The system processes each annex in the EOP, classifies it, identifies target roles, and generates structured Quick Reference Guides.

PropertyValue
EndpointPOST /ai/api/tools/k12-qrg-generation-kickoff/execute
Content-Typeapplication/json

Request

{
"data": {
"emergencyOperationPlanId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"generalUserTagIds": ["d4e5f6a7-b8c9-0123-defg-456789abcdef", "e5f6a7b8-c9d0-1234-efgh-56789abcdef0"],
"sessionId": null,
"waitForResult": false
}
}

Request Fields

FieldTypeRequiredDescriptionConstraints
emergencyOperationPlanIdstringYesUUID of the Emergency Operation Plan to generate QRGs fromValid UUID format
generalUserTagIdsarray of stringsNoFilter generation to specific role tags; if omitted, all EOP roles are usedEach entry must be a valid UUID
sessionIdstringNoSession identifier for grouping related operations; null starts a new session--
requestIdstringNoPre-generated request ID; usually omitted so the server generates one--
waitForResultbooleanNoWhen true, blocks until generation completes and returns the full resultDefault: false

Response (Async -- status: accepted)

{
"requestId": "gen-b2c3d4e5-f6a7-8901-bcde-f12345678901",
"sessionId": "sess-c3d4e5f6-a7b8-9012-cdef-0123456789ab",
"status": "accepted",
"message": "QRG generation accepted and queued for processing"
}

Response (Sync -- status: success)

Note: The kickoff endpoint (both sync and async) always returns lowercase status values (accepted, success, error). The status polling and result endpoints return UPPERCASE values (PROCESSING, SUCCESS, ERROR, CANCELLED).

{
"requestId": "gen-b2c3d4e5-f6a7-8901-bcde-f12345678901",
"sessionId": "sess-c3d4e5f6-a7b8-9012-cdef-0123456789ab",
"status": "success",
"data": {
"root": [
{
"name": "Fire Safety - Teachers",
"organizationId": "org-d4e5f6a7-b8c9-0123-4567-89abcdef0123",
"type": "EMERGENCY",
"functionality": null,
"hazard": "FIRE",
"generalUserTagManagementType": "ASSIGN_SELECTED",
"generalUserTagIds": ["d4e5f6a7-b8c9-0123-defg-456789abcdef"],
"contentBlocks": [
{
"type": "BEFORE",
"content": "<ul><li>Know the location of fire extinguishers and pull stations</li><li>Review evacuation routes posted in each classroom</li><li>Verify emergency contact lists are current</li></ul>"
},
{
"type": "DURING",
"content": "<ul><li>Activate the nearest fire alarm pull station</li><li>Direct students to exit via the designated evacuation route</li><li>Close classroom doors and windows when leaving</li><li>Take attendance roster and student medications</li></ul>"
},
{
"type": "AFTER",
"content": "<ul><li>Account for all students at the assembly point</li><li>Report any missing students to the incident commander</li><li>Do not re-enter the building until authorized</li><li>Document the incident for administrative review</li></ul>"
}
]
}
]
}
}

Response Fields (Accepted)

FieldTypeDescription
requestIdstringUnique identifier for this generation job
sessionIdstringSession identifier
statusstringaccepted
messagestringConfirmation message

Response Fields (Success Result)

FieldTypeDescription
requestIdstringThe generation job request ID
sessionIdstringSession identifier
statusstringSUCCESS
dataobjectContainer for generated QRGs
data.rootarrayList of generated QRG objects

Each QRG object in data.root:

FieldTypeDescription
namestringDisplay name for the QRG (max 200 characters)
organizationIdstringOrganization this QRG belongs to
typestringQRG category: FUNCTIONAL or EMERGENCY
functionalitystring or nullFunctional category (e.g., EVACUATION, LOCKDOWN, SHELTER_IN_PLACE) when type is FUNCTIONAL; null for emergency types
hazardstring or nullHazard category (e.g., FIRE, ACTIVE_SHOOTER, TORNADO) when type is EMERGENCY; null for functional types
generalUserTagManagementTypestringRole assignment mode: ASSIGN_SELECTED or ASSIGN_ALL
generalUserTagIdsarray of stringsAssigned role tag UUIDs
contentBlocksarrayQRG content organized by phase
contentBlocks[].typestringPhase: BEFORE, DURING, or AFTER
contentBlocks[].contentstringHTML content for this phase

Response (Error)

{
"requestId": "gen-b2c3d4e5-f6a7-8901-bcde-f12345678901",
"sessionId": "sess-c3d4e5f6-a7b8-9012-cdef-0123456789ab",
"status": "ERROR",
"message": "AI processing failed: 6/6 annexes failed AI classification",
"errors": [
"[classify:Fire Safety Annex] AI classification failed: PermissionDenied",
"[classify:Tornado Annex] AI classification failed: PermissionDenied"
]
}

Error Responses

HTTP StatusCondition
400Missing or invalid emergencyOperationPlanId
401Invalid or expired bearer token or missing subscription key
404EOP plan not found
429Rate limit exceeded
500Internal processing error

curl Example

curl -X POST "https://dev-k12-aitools-t27p-apim.azure-api.net/ai/api/tools/k12-qrg-generation-kickoff/execute" \
-H "Authorization: Bearer $TOKEN" \
-H "Ocp-Apim-Subscription-Key: $SUBSCRIPTION_KEY" \
-H "Content-Type: application/json" \
-d '{
"data": {
"emergencyOperationPlanId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"generalUserTagIds": ["d4e5f6a7-b8c9-0123-defg-456789abcdef"],
"waitForResult": false
}
}'

k12-qrg-generation-status

Check the status of one or more QRG generation jobs.

PropertyValue
EndpointPOST /ai/api/tools/k12-qrg-generation-status/execute
Content-Typeapplication/json

Request

{
"data": {
"requestIds": ["gen-b2c3d4e5-f6a7-8901-bcde-f12345678901"]
}
}

Request Fields

FieldTypeRequiredDescriptionConstraints
requestIdsarray of stringsYesOne or more generation job request IDs to checkEach string minimum 1 character

Response

[
{
"requestId": "gen-b2c3d4e5-f6a7-8901-bcde-f12345678901",
"sessionId": "sess-c3d4e5f6-a7b8-9012-cdef-0123456789ab",
"status": "PROCESSING",
"message": "Processing annex 3 of 6"
}
]

Response Fields

The response is an array with one entry per requested ID:

FieldTypeDescription
requestIdstringThe request ID that was queried
sessionIdstringAssociated session identifier
statusstringCurrent status: accepted, PROCESSING, SUCCESS, ERROR, or CANCELLED
messagestringOptional progress or status detail
note

QRG generation statuses use uppercase values (PROCESSING, SUCCESS, ERROR, CANCELLED). The initial acceptance status is lowercase accepted.

Error Responses

HTTP StatusCondition
400requestIds is missing, empty, or contains empty strings
401Invalid or expired bearer token or missing subscription key
429Rate limit exceeded

curl Example

curl -X POST "https://dev-k12-aitools-t27p-apim.azure-api.net/ai/api/tools/k12-qrg-generation-status/execute" \
-H "Authorization: Bearer $TOKEN" \
-H "Ocp-Apim-Subscription-Key: $SUBSCRIPTION_KEY" \
-H "Content-Type: application/json" \
-d '{
"data": {
"requestIds": ["gen-b2c3d4e5-f6a7-8901-bcde-f12345678901"]
}
}'

k12-qrg-generation-result

Fetch the full result of a completed QRG generation job, including all generated QRGs and processing statistics.

PropertyValue
EndpointPOST /ai/api/tools/k12-qrg-generation-result/execute
Content-Typeapplication/json

Request

{
"data": {
"requestId": "gen-b2c3d4e5-f6a7-8901-bcde-f12345678901"
}
}

Request Fields

FieldTypeRequiredDescriptionConstraints
requestIdstringYesThe generation job request IDMinimum 1 character

Response (SUCCESS)

{
"requestId": "gen-b2c3d4e5-f6a7-8901-bcde-f12345678901",
"sessionId": "sess-c3d4e5f6-a7b8-9012-cdef-0123456789ab",
"status": "SUCCESS",
"data": {
"root": [
{
"name": "Fire Safety - Teachers",
"organizationId": "org-d4e5f6a7-b8c9-0123-4567-89abcdef0123",
"type": "EMERGENCY",
"functionality": null,
"hazard": "FIRE",
"generalUserTagManagementType": "ASSIGN_SELECTED",
"generalUserTagIds": ["d4e5f6a7-b8c9-0123-defg-456789abcdef"],
"contentBlocks": [
{
"type": "BEFORE",
"content": "<ul><li>Know the location of fire extinguishers and pull stations</li></ul>"
},
{
"type": "DURING",
"content": "<ul><li>Activate the nearest fire alarm pull station</li><li>Direct students to evacuate via designated routes</li></ul>"
},
{
"type": "AFTER",
"content": "<ul><li>Account for all students at the assembly point</li><li>Report missing students to the incident commander</li></ul>"
}
]
}
]
},
"aiStats": {
"totalAnnexes": 6,
"aiClassifySuccess": 6,
"aiClassifyError": 0,
"aiGroupsSuccess": 6,
"aiGroupsError": 0,
"aiRolesSuccess": 6,
"aiRolesError": 0,
"aiGenerateSuccess": 12,
"aiGenerateError": 0
},
"warning": null
}

Response (ERROR)

{
"requestId": "gen-b2c3d4e5-f6a7-8901-bcde-f12345678901",
"sessionId": "sess-c3d4e5f6-a7b8-9012-cdef-0123456789ab",
"status": "ERROR",
"message": "AI processing failed: 6/6 annexes failed AI classification",
"errors": [
"[classify:Fire Safety Annex] AI classification failed: PermissionDenied",
"[classify:Tornado Annex] AI classification failed: PermissionDenied"
],
"aiStats": {
"totalAnnexes": 6,
"aiClassifySuccess": 0,
"aiClassifyError": 6,
"aiGroupsSuccess": 0,
"aiGroupsError": 0,
"aiRolesSuccess": 0,
"aiRolesError": 0,
"aiGenerateSuccess": 0,
"aiGenerateError": 0
}
}

Response (PROCESSING / CANCELLED)

{
"requestId": "gen-b2c3d4e5-f6a7-8901-bcde-f12345678901",
"sessionId": "sess-c3d4e5f6-a7b8-9012-cdef-0123456789ab",
"status": "PROCESSING"
}
{
"requestId": "gen-b2c3d4e5-f6a7-8901-bcde-f12345678901",
"sessionId": "sess-c3d4e5f6-a7b8-9012-cdef-0123456789ab",
"status": "CANCELLED"
}

Response Fields

FieldTypeDescription
requestIdstringThe generation job request ID
sessionIdstringSession identifier
statusstringSUCCESS, ERROR, PROCESSING, or CANCELLED
dataobjectPresent on SUCCESS; contains generated QRGs
data.rootarrayList of generated QRG objects (see QRG object fields in the kickoff section)
messagestringPresent on ERROR; describes the failure
errorsarray of stringsPresent on ERROR; individual error messages per annex or AI stage
aiStatsobjectProcessing statistics (present on SUCCESS and ERROR)
warningstring or nullOptional warning message for partial success scenarios

aiStats fields:

FieldTypeDescription
totalAnnexesnumberTotal number of annexes processed
aiClassifySuccessnumberAnnexes successfully classified
aiClassifyErrornumberAnnexes that failed classification
aiGroupsSuccessnumberAnnexes with successful group extraction
aiGroupsErrornumberAnnexes that failed group extraction
aiRolesSuccessnumberAnnexes with successful role mapping
aiRolesErrornumberAnnexes that failed role mapping
aiGenerateSuccessnumberQRGs successfully generated
aiGenerateErrornumberQRG generation failures

Error Responses

HTTP StatusCondition
400requestId is missing or empty
401Invalid or expired bearer token or missing subscription key
404No result found for the specified request ID
429Rate limit exceeded

curl Example

curl -X POST "https://dev-k12-aitools-t27p-apim.azure-api.net/ai/api/tools/k12-qrg-generation-result/execute" \
-H "Authorization: Bearer $TOKEN" \
-H "Ocp-Apim-Subscription-Key: $SUBSCRIPTION_KEY" \
-H "Content-Type: application/json" \
-d '{
"data": {
"requestId": "gen-b2c3d4e5-f6a7-8901-bcde-f12345678901"
}
}'

QRG Editing Tools

k12-qrg-editing-kickoff

Start an AI-assisted edit of a specific section (BEFORE, DURING, or AFTER) within an existing Quick Reference Guide.

PropertyValue
EndpointPOST /ai/api/tools/k12-qrg-editing-kickoff/execute
Content-Typeapplication/json

Request

{
"data": {
"userId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"roleId": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
"section": "BEFORE",
"content": "<ul><li>Know evacuation routes</li></ul>",
"prompt": "Add a bullet about checking fire extinguisher locations",
"sessionId": null,
"quickReferenceGuide": {
"name": "Fire Safety Procedures",
"type": "FUNCTIONAL",
"instructionFor": "FIRE",
"generalUserTagManagementType": "ASSIGN_SELECTED",
"generalUserTags": [
{
"label": "Teachers",
"value": "c3d4e5f6-a7b8-9012-cdef-0123456789ab"
}
],
"organization": {
"id": "d4e5f6a7-b8c9-0123-4567-89abcdef0123",
"name": "Lincoln Elementary",
"type": "FACILITY",
"parent": {
"id": "e5f6a7b8-c9d0-1234-5678-9abcdef01234",
"name": "Springfield School District",
"type": "DISTRICT"
}
}
}
}
}

Request Fields

FieldTypeRequiredDescriptionConstraints
userIdstringYesUUID of the user initiating the editValid UUID
roleIdstringYesUUID of the user's roleValid UUID
sectionstringYesWhich QRG section to editBEFORE, DURING, or AFTER
contentstringYesCurrent HTML content of the section--
promptstringYesNatural language instruction for the editMinimum 1 character
sessionIdstringNoSession UUID for conversation continuity; null starts a new sessionValid UUID if provided
quickReferenceGuideobjectYesMetadata about the QRG being editedSee nested fields below

quickReferenceGuide fields:

FieldTypeRequiredDescriptionConstraints
namestringYesDisplay name of the QRGMaximum 200 characters
typestringYesQRG categoryFUNCTIONAL or EMERGENCY
instructionForstringYesCategory label (e.g., FIRE, EVACUATION, LOCKDOWN)Minimum 1 character
generalUserTagManagementTypestringYesHow roles are assignedASSIGN_SELECTED or ASSIGN_ALL
generalUserTagsarrayYesRole tags assigned to this QRGMinimum 1 entry if ASSIGN_SELECTED
generalUserTags[].labelstringYesRole display name--
generalUserTags[].valuestringNoRole tag UUIDValid UUID if provided
organizationobjectNoFacility and district contextSee nested fields below

organization fields:

FieldTypeRequiredDescriptionConstraints
idstringYesOrganization UUIDValid UUID
namestringYesOrganization display name--
typestringYesOrganization levelFACILITY or DISTRICT
parentobjectNoParent district (required when type is FACILITY)See nested fields below

parent fields:

FieldTypeRequiredDescriptionConstraints
idstringYesParent district UUIDValid UUID
namestringYesDistrict display name--
typestringYesAlways DISTRICTLiteral: DISTRICT

Response (Accepted)

{
"requestId": "edit-f6a7b8c9-d0e1-2345-fghi-6789abcdef01",
"sessionId": "sess-a7b8c9d0-e1f2-3456-ghij-789abcdef012",
"status": "accepted",
"message": "QRG editing job accepted and queued for processing"
}

Response (Error)

{
"requestId": "edit-f6a7b8c9-d0e1-2345-fghi-6789abcdef01",
"sessionId": "sess-a7b8c9d0-e1f2-3456-ghij-789abcdef012",
"status": "error",
"message": "Validation failed: section must be BEFORE, DURING, or AFTER"
}

Response Fields

FieldTypeDescription
requestIdstringUnique identifier for this editing job
sessionIdstringSession identifier for subsequent operations
statusstringaccepted or error
messagestringConfirmation or error description

Error Responses

HTTP StatusCondition
400Missing required field, invalid section value, or empty prompt
401Invalid or expired bearer token or missing subscription key
429Rate limit exceeded
500Internal processing error

curl Example

curl -X POST "https://dev-k12-aitools-t27p-apim.azure-api.net/ai/api/tools/k12-qrg-editing-kickoff/execute" \
-H "Authorization: Bearer $TOKEN" \
-H "Ocp-Apim-Subscription-Key: $SUBSCRIPTION_KEY" \
-H "Content-Type: application/json" \
-d '{
"data": {
"userId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"roleId": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
"section": "BEFORE",
"content": "<ul><li>Know evacuation routes</li></ul>",
"prompt": "Add a bullet about checking fire extinguisher locations",
"quickReferenceGuide": {
"name": "Fire Safety Procedures",
"type": "FUNCTIONAL",
"instructionFor": "FIRE",
"generalUserTagManagementType": "ASSIGN_SELECTED",
"generalUserTags": [
{ "label": "Teachers", "value": "c3d4e5f6-a7b8-9012-cdef-0123456789ab" }
],
"organization": {
"id": "d4e5f6a7-b8c9-0123-4567-89abcdef0123",
"name": "Lincoln Elementary",
"type": "FACILITY",
"parent": {
"id": "e5f6a7b8-c9d0-1234-5678-9abcdef01234",
"name": "Springfield School District",
"type": "DISTRICT"
}
}
}
}
}'

k12-qrg-editing-status

Check the status of one or more QRG editing jobs.

PropertyValue
EndpointPOST /ai/api/tools/k12-qrg-editing-status/execute
Content-Typeapplication/json

Request

{
"data": {
"requestIds": ["edit-f6a7b8c9-d0e1-2345-fghi-6789abcdef01"]
}
}

Request Fields

FieldTypeRequiredDescriptionConstraints
requestIdsarray of stringsYesOne or more editing job request IDs to checkEach string minimum 1 character

Response

[
{
"requestId": "edit-f6a7b8c9-d0e1-2345-fghi-6789abcdef01",
"sessionId": "sess-a7b8c9d0-e1f2-3456-ghij-789abcdef012",
"status": "processing",
"message": "AI agent is editing the BEFORE section"
}
]

Response Fields

The response is an array with one entry per requested ID:

FieldTypeDescription
requestIdstringThe request ID that was queried
sessionIdstringAssociated session identifier
statusstringCurrent status: accepted, processing, success, error, or cancelled
messagestringOptional progress detail
note

QRG editing statuses use lowercase values (processing, success, error, cancelled).

Error Responses

HTTP StatusCondition
400requestIds is missing, empty, or contains empty strings
401Invalid or expired bearer token or missing subscription key
429Rate limit exceeded

curl Example

curl -X POST "https://dev-k12-aitools-t27p-apim.azure-api.net/ai/api/tools/k12-qrg-editing-status/execute" \
-H "Authorization: Bearer $TOKEN" \
-H "Ocp-Apim-Subscription-Key: $SUBSCRIPTION_KEY" \
-H "Content-Type: application/json" \
-d '{
"data": {
"requestIds": ["edit-f6a7b8c9-d0e1-2345-fghi-6789abcdef01"]
}
}'

k12-qrg-editing-result

Fetch the result of a completed QRG editing job, including the AI-edited section content.

PropertyValue
EndpointPOST /ai/api/tools/k12-qrg-editing-result/execute
Content-Typeapplication/json

Request

{
"data": {
"requestId": "edit-f6a7b8c9-d0e1-2345-fghi-6789abcdef01"
}
}

Request Fields

FieldTypeRequiredDescriptionConstraints
requestIdstringYesThe editing job request IDMinimum 1 character

Response (Success)

{
"requestId": "edit-f6a7b8c9-d0e1-2345-fghi-6789abcdef01",
"sessionId": "sess-a7b8c9d0-e1f2-3456-ghij-789abcdef012",
"status": "success",
"message": "<ul><li>Know evacuation routes</li><li>Verify fire extinguisher locations in hallways and common areas</li></ul>",
"isEdit": true
}

Response (Error)

{
"requestId": "edit-f6a7b8c9-d0e1-2345-fghi-6789abcdef01",
"sessionId": "sess-a7b8c9d0-e1f2-3456-ghij-789abcdef012",
"status": "error",
"message": "AI processing failed: unable to generate edited content for the BEFORE section"
}

Response (Processing / Accepted / Cancelled)

{
"requestId": "edit-f6a7b8c9-d0e1-2345-fghi-6789abcdef01",
"sessionId": "sess-a7b8c9d0-e1f2-3456-ghij-789abcdef012",
"status": "processing",
"message": "Edit is still in progress"
}

Response Fields

FieldTypeDescription
requestIdstringThe editing job request ID
sessionIdstringAssociated session identifier
statusstringsuccess, error, processing, accepted, or cancelled
messagestringOn success: the edited HTML content. On error: a description of the failure. On other statuses: progress detail.
isEditbooleantrue when the response contains edited content (present on success only)

Error Responses

HTTP StatusCondition
400requestId is missing or empty
401Invalid or expired bearer token or missing subscription key
404No result found for the specified request ID
429Rate limit exceeded

curl Example

curl -X POST "https://dev-k12-aitools-t27p-apim.azure-api.net/ai/api/tools/k12-qrg-editing-result/execute" \
-H "Authorization: Bearer $TOKEN" \
-H "Ocp-Apim-Subscription-Key: $SUBSCRIPTION_KEY" \
-H "Content-Type: application/json" \
-d '{
"data": {
"requestId": "edit-f6a7b8c9-d0e1-2345-fghi-6789abcdef01"
}
}'

Cancellation

k12-cancel-task-request

Cancel a pending or in-progress EOP editing job. The tool marks the job as cancelled and stops further processing on a best-effort basis.

PropertyValue
EndpointPOST /ai/api/tools/k12-cancel-task-request/execute
Content-Typeapplication/json

Request

{
"data": {
"requestId": "req-7f3a2b1c-d4e5-6789-abcd-ef0123456789"
}
}

Request Fields

FieldTypeRequiredDescriptionConstraints
requestIdstringYesThe request ID of the EOP editing job to cancelMinimum 1 character
dryRunbooleanNoWhen true, returns what would be cancelled without executing the cancellationDefault: false

Response (Success)

{
"status": "success",
"message": "Request cancelled successfully"
}

Response (Error)

{
"status": "error",
"message": "Request not found or already in a terminal state"
}

Response Fields

FieldTypeDescription
statusstringsuccess if cancellation was applied; error if the job could not be cancelled
messagestringHuman-readable description of the outcome

Error Responses

HTTP StatusCondition
400requestId is missing or empty
401Invalid or expired bearer token or missing subscription key
404No job found for the specified request ID
409Job is already in a terminal state and cannot be cancelled
429Rate limit exceeded

curl Example

curl -X POST "https://dev-k12-aitools-t27p-apim.azure-api.net/ai/api/tools/k12-cancel-task-request/execute" \
-H "Authorization: Bearer $TOKEN" \
-H "Ocp-Apim-Subscription-Key: $SUBSCRIPTION_KEY" \
-H "Content-Type: application/json" \
-d '{
"data": {
"requestId": "req-7f3a2b1c-d4e5-6789-abcd-ef0123456789"
}
}'
note

Cancellation is best-effort. If the AI agent is mid-processing when cancellation is received, the current operation may complete before the job terminates. Always verify the final status via the status endpoint after issuing a cancel request.


k12-qrg-cancel

Cancel a pending or in-progress QRG generation or editing job. This tool covers both QRG Generation and QRG Editing workflows.

PropertyValue
EndpointPOST /ai/api/tools/k12-qrg-cancel/execute
Content-Typeapplication/json

Request

{
"data": {
"requestId": "gen-b2c3d4e5-f6a7-8901-bcde-f12345678901",
"jobType": "generation"
}
}

Request Fields

FieldTypeRequiredDescriptionConstraints
requestIdstringYesThe request ID of the job to cancelMinimum 1 character
jobTypestringNoType of job to cancelgeneration or editing; default: generation

Response (Success)

{
"status": "success"
}

Response (Error)

{
"status": "error"
}

Response Fields

FieldTypeDescription
statusstringsuccess if cancellation was applied; error if the job could not be cancelled (e.g., already completed or not found)

Error Responses

HTTP StatusCondition
400requestId is missing or empty
401Invalid or expired bearer token or missing subscription key
404No job found for the specified request ID
409Job is already in a terminal state and cannot be cancelled
429Rate limit exceeded

curl Example

curl -X POST "https://dev-k12-aitools-t27p-apim.azure-api.net/ai/api/tools/k12-qrg-cancel/execute" \
-H "Authorization: Bearer $TOKEN" \
-H "Ocp-Apim-Subscription-Key: $SUBSCRIPTION_KEY" \
-H "Content-Type: application/json" \
-d '{
"data": {
"requestId": "gen-b2c3d4e5-f6a7-8901-bcde-f12345678901",
"jobType": "generation"
}
}'
note

Cancellation is best-effort. If the AI pipeline is mid-step when cancellation is received, the current step may complete before the job terminates. Always verify the final status via the status endpoint after issuing a cancel request.


Status Convention Summary

Different tool families use different status casing. Your integration must normalize these values before comparison.

Tool FamilyStatus ConventionValues
EOP Editing (k12-annex-editing-*)Lowercaseaccepted, processing, success, error, cancelled
QRG Generation (k12-qrg-generation-*)Uppercaseaccepted, PROCESSING, SUCCESS, ERROR, CANCELLED
QRG Editing (k12-qrg-editing-*)Lowercaseaccepted, processing, success, error, cancelled
EOP Cancel (k12-cancel-task-request)Lowercasesuccess, error
QRG Cancel (k12-qrg-cancel)Lowercasesuccess, error
note

The initial accepted status from kickoff tools is always lowercase across all families. Only subsequent statuses differ in casing.


Next Steps