Configurar incidentes de ServiceNow
POST /api/auth/servicenow/tasks
Solo origen canónico. POST requiere una cabecera Origin exacta y application/json. Las sesiones del navegador utilizan una cookie HttpOnly, Secure, SameSite=Strict. Las sesiones de configuración no pueden acceder a las API del tenant. Aprovisionar tenants y la auditoría global requieren un operador de plataforma; administrar miembros requiere un administrador del tenant. SSO está pospuesto. Se requieren sesión de navegador verificada de administrador del espacio de trabajo y conexión configurada con propietario actual de autorización. Lee/guarda valores predeterminados de incidentes, pagina tareas de migración (50 por página), prepara una previsualización de tarea derivada del servidor o revalida una previsualización. Guardar incrementa la revisión de conexión y borra previsualizaciones anteriores. Los campos fuente están permitidos explícitamente; se excluyen evidencias originales, campos privados del escáner y contenido de tareas proporcionado por el llamador. Las previsualizaciones caducan después de cinco minutos, vinculan actor, tarea/evidencias, asignación, revisión y generación de credencial y exponen un hash exacto de carga útil e ID de solicitud generado por el servidor. Un título de más de 160 caracteres requiere un título de tarea más corto o un resumen fijo. Los ID de referencia y reglas de campos específicas de instancia permanecen sin validar. La operación list-choices realiza una lectura acotada de opciones inglesas de categoría/subcategoría de incidentes de sys_choice (100 por página, cursor sys_id). Requiere acceso opcional de lectura a la tabla de opciones, vuelve a comprobar autorización de conexión y generación de credencial y no establece acceso de escritura ni validez de reglas de negocio. Las demás operaciones de configuración no realizan solicitudes al proveedor. No se crean incidentes.
Autenticación
Las siguientes alternativas de OpenAPI describen la autenticación aceptada. Las modificaciones desde el navegador también requieren la cabecera Origin canónica.
[
{
"browserSession": []
}
]
Parámetros
[]
Cuerpo de la solicitud
{
"required": true,
"content": {
"application/json": {
"schema": {
"oneOf": [
{
"type": "object",
"properties": {
"operation": {
"type": "string",
"const": "list-choices"
},
"connectionId": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
},
"expectedRevision": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"after": {
"type": "string",
"pattern": "^[a-f0-9]{32}$"
}
},
"required": [
"operation",
"connectionId",
"expectedRevision"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"operation": {
"type": "string",
"const": "list-tasks"
},
"connectionId": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
},
"expectedRevision": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"after": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
}
},
"required": [
"operation",
"connectionId",
"expectedRevision"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"operation": {
"type": "string",
"const": "read-mapping"
},
"connectionId": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
},
"expectedRevision": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
}
},
"required": [
"operation",
"connectionId",
"expectedRevision"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"operation": {
"type": "string",
"const": "save-mapping"
},
"connectionId": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
},
"expectedRevision": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"mapping": {
"type": "object",
"properties": {
"shortDescription": {
"oneOf": [
{
"type": "object",
"properties": {
"source": {
"type": "string",
"const": "task-title"
}
},
"required": [
"source"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"source": {
"type": "string",
"const": "constant"
},
"value": {
"type": "string",
"minLength": 1,
"maxLength": 160
}
},
"required": [
"source",
"value"
],
"additionalProperties": false
}
]
},
"includeTaskDetails": {
"type": "boolean"
},
"defaults": {
"type": "object",
"properties": {
"urgency": {
"type": "string",
"enum": [
"1",
"2",
"3"
]
},
"impact": {
"type": "string",
"enum": [
"1",
"2",
"3"
]
},
"assignment_group": {
"type": "string",
"pattern": "^[0-9a-f]{32}$"
},
"assigned_to": {
"type": "string",
"pattern": "^[0-9a-f]{32}$"
},
"cmdb_ci": {
"type": "string",
"pattern": "^[0-9a-f]{32}$"
},
"category": {
"type": "string",
"minLength": 1,
"maxLength": 80
},
"subcategory": {
"type": "string",
"minLength": 1,
"maxLength": 80
},
"customFields": {
"type": "object",
"propertyNames": {
"type": "string",
"pattern": "^(?:u_|x_)[a-z][a-z0-9_]{0,77}$"
},
"additionalProperties": {
"anyOf": [
{
"type": "string",
"maxLength": 1024
},
{
"type": "boolean"
},
{
"type": "number"
}
]
}
}
},
"additionalProperties": false
}
},
"required": [
"shortDescription",
"includeTaskDetails",
"defaults"
],
"additionalProperties": false
}
},
"required": [
"operation",
"connectionId",
"expectedRevision",
"mapping"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"operation": {
"type": "string",
"const": "prepare-task"
},
"connectionId": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
},
"expectedRevision": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"planId": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
},
"expectedPlanVersion": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
}
},
"required": [
"operation",
"connectionId",
"expectedRevision",
"planId",
"expectedPlanVersion"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"operation": {
"type": "string",
"const": "read-preview"
},
"connectionId": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
},
"expectedRevision": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"previewId": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
}
},
"required": [
"operation",
"connectionId",
"expectedRevision",
"previewId"
],
"additionalProperties": false
}
]
}
}
}
}
Respuestas
{
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"anyOf": [
{
"type": "object",
"properties": {
"items": {
"maxItems": 100,
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"pattern": "^[a-f0-9]{32}$"
},
"field": {
"type": "string",
"enum": [
"category",
"subcategory"
]
},
"value": {
"type": "string",
"minLength": 1,
"maxLength": 80
},
"label": {
"type": "string",
"minLength": 1,
"maxLength": 256
},
"dependentValue": {
"type": "string",
"maxLength": 80
}
},
"required": [
"id",
"field",
"value",
"label",
"dependentValue"
],
"additionalProperties": false
}
},
"nextAfter": {
"anyOf": [
{
"type": "string",
"pattern": "^[a-f0-9]{32}$"
},
{
"type": "null"
}
]
},
"language": {
"type": "string",
"const": "en"
},
"table": {
"type": "string",
"const": "incident"
}
},
"required": [
"items",
"nextAfter",
"language",
"table"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"configured": {
"type": "boolean"
},
"mapping": {
"type": "object",
"properties": {
"shortDescription": {
"oneOf": [
{
"type": "object",
"properties": {
"source": {
"type": "string",
"const": "task-title"
}
},
"required": [
"source"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"source": {
"type": "string",
"const": "constant"
},
"value": {
"type": "string",
"minLength": 1,
"maxLength": 160
}
},
"required": [
"source",
"value"
],
"additionalProperties": false
}
]
},
"includeTaskDetails": {
"type": "boolean"
},
"defaults": {
"type": "object",
"properties": {
"urgency": {
"type": "string",
"enum": [
"1",
"2",
"3"
]
},
"impact": {
"type": "string",
"enum": [
"1",
"2",
"3"
]
},
"assignment_group": {
"type": "string",
"pattern": "^[0-9a-f]{32}$"
},
"assigned_to": {
"type": "string",
"pattern": "^[0-9a-f]{32}$"
},
"cmdb_ci": {
"type": "string",
"pattern": "^[0-9a-f]{32}$"
},
"category": {
"type": "string",
"minLength": 1,
"maxLength": 80
},
"subcategory": {
"type": "string",
"minLength": 1,
"maxLength": 80
},
"customFields": {
"type": "object",
"propertyNames": {
"type": "string",
"pattern": "^(?:u_|x_)[a-z][a-z0-9_]{0,77}$"
},
"additionalProperties": {
"anyOf": [
{
"type": "string",
"maxLength": 1024
},
{
"type": "boolean"
},
{
"type": "number"
}
]
}
}
},
"additionalProperties": false
}
},
"required": [
"shortDescription",
"includeTaskDetails",
"defaults"
],
"additionalProperties": false
},
"revision": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
}
},
"required": [
"configured",
"mapping",
"revision"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"items": {
"maxItems": 50,
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
},
"version": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"title": {
"type": "string",
"maxLength": 200
}
},
"required": [
"id",
"version",
"title"
],
"additionalProperties": false
}
},
"nextCursor": {
"anyOf": [
{
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
},
{
"type": "null"
}
]
}
},
"required": [
"items",
"nextCursor"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"previewId": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
},
"planId": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
},
"planVersion": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"requestId": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
},
"fields": {
"type": "object",
"properties": {
"short_description": {
"type": "string",
"minLength": 1,
"maxLength": 160
},
"description": {
"type": "string",
"maxLength": 20000
},
"urgency": {
"type": "string",
"enum": [
"1",
"2",
"3"
]
},
"impact": {
"type": "string",
"enum": [
"1",
"2",
"3"
]
},
"assignment_group": {
"type": "string",
"pattern": "^[0-9a-f]{32}$"
},
"assigned_to": {
"type": "string",
"pattern": "^[0-9a-f]{32}$"
},
"cmdb_ci": {
"type": "string",
"pattern": "^[0-9a-f]{32}$"
},
"category": {
"type": "string",
"minLength": 1,
"maxLength": 80
},
"subcategory": {
"type": "string",
"minLength": 1,
"maxLength": 80
},
"customFields": {
"type": "object",
"propertyNames": {
"type": "string",
"pattern": "^(?:u_|x_)[a-z][a-z0-9_]{0,77}$"
},
"additionalProperties": {
"anyOf": [
{
"type": "string",
"maxLength": 1024
},
{
"type": "boolean"
},
{
"type": "number"
}
]
}
}
},
"required": [
"short_description"
],
"additionalProperties": false
},
"payloadHash": {
"type": "string",
"pattern": "^[a-f0-9]{64}$"
},
"createdAt": {
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
},
"expiresAt": {
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
},
"unverifiedReferences": {
"type": "array",
"items": {
"type": "string",
"enum": [
"assignment_group",
"assigned_to",
"cmdb_ci"
]
}
},
"providerValidation": {
"type": "string",
"const": "not-performed"
},
"incidentCreated": {
"type": "boolean",
"const": false
}
},
"required": [
"previewId",
"planId",
"planVersion",
"requestId",
"fields",
"payloadHash",
"createdAt",
"expiresAt",
"unverifiedReferences",
"providerValidation",
"incidentCreated"
],
"additionalProperties": false
}
]
}
}
}
},
"400": {
"description": "Validation error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"401": {
"description": "Missing/expired/revoked credential",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"403": {
"description": "Insufficient role",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"404": {
"description": "Not found",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"409": {
"description": "State or idempotency conflict",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"413": {
"description": "Body too large",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"415": {
"description": "Unsupported media type",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"429": {
"description": "Request budget exhausted; respect Retry-After",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
},
"headers": {
"Retry-After": {
"schema": {
"type": "integer",
"minimum": 1
},
"description": "Seconds until sufficient budget is expected; concurrent traffic may consume replenished capacity."
}
}
},
"500": {
"description": "Internal error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"503": {
"description": "Not configured",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
}
Las referencias como #/components/schemas/Asset se resuelven en los esquemas compartidos. Descarga el contrato OpenAPI para generar clientes. Esta página se genera automáticamente; describe la API de desarrollo implementada, no endpoints previstos.