Compartir a través de


Creación de agentInstance

Espacio de nombres: microsoft.graph

Importante

Las API de la versión /beta de Microsoft Graph están sujetas a cambios. No se admite el uso de estas API en aplicaciones de producción. Para determinar si una API está disponible en la versión 1.0, use el selector de Versión.

Cree un nuevo objeto agentInstance .

Esta API está disponible en las siguientes implementaciones nacionales de nube.

Servicio global Gobierno de EE. UU. L4 Us Government L5 (DOD) China operada por 21Vianet

Permissions

Elija el permiso o los permisos marcados como con privilegios mínimos para esta API. Use un permiso o permisos con privilegios superiores solo si la aplicación lo requiere. Para obtener más información sobre los permisos delegados y de aplicación, consulte Tipos de permisos. Para obtener más información sobre estos permisos, consulte la referencia de permisos.

Tipo de permiso Permisos con privilegios mínimos Permisos con privilegios más altos
Delegado (cuenta profesional o educativa) AgentInstance.ReadWrite.All No disponible.
Delegado (cuenta personal de Microsoft) No admitida. No admitida.
Aplicación AgentInstance.ReadWrite.All AgentInstance.ReadWrite.ManagedBy

Importante

Cuando se usan permisos delegados, al usuario autenticado se le debe asignar un rol de Microsoft Entra compatible o un rol personalizado con un permiso de rol admitido. Administrador del Registro de agente es el rol con privilegios mínimos admitido para esta operación.

Solicitud HTTP

POST /agentRegistry/agentInstances

Encabezados de solicitud

Nombre Descripción
Authorization {token} de portador. Obligatorio. Obtenga más información sobre la autenticación y la autorización.
Content-Type application/json. Obligatorio.

Cuerpo de la solicitud

En el cuerpo de la solicitud, proporcione una representación JSON del objeto agentInstance .

Puede especificar las siguientes propiedades al crear una agentInstance.

Propiedad Tipo Description
ownerIds Colección string Lista de identificadores de propietario de la instancia del agente. Obligatorio.
managedBy Cadena Identificador de aplicación que administra este agente. Opcional.
originatingStore Cadena Nombre del almacén o sistema donde se originó el agente. Opcional.
displayName Cadena Nombre para mostrar de la instancia del agente. Obligatorio.
sourceAgentId Cadena Identificador de agente original del sistema de origen. Opcional.
agentIdentityBlueprintId Cadena Identificador del plano técnico de identidad del agente. Opcional.
agentIdentityId Cadena Identificador de identidad del agente de Entra. Opcional.
agentUserId Cadena Identificador de usuario asociado al agente. Opcional.
URL Cadena Dirección URL del punto de conexión de la instancia del agente. Opcional.
preferredTransport Cadena Protocolo de transporte preferido (JSONRPC, GRPC, HTTP+JSON). Opcional.
additionalInterfaces colección agentInterface Interfaces o transportes adicionales admitidos por el agente (dirección URL, transporte). Opcional.
Firmas colección agentCardSignature Firmas digitales para la instancia del agente (protegida, firma, encabezado). Opcional.

Respuesta

Si se ejecuta correctamente, este método devuelve un 201 Created código de respuesta y un objeto agentInstance en el cuerpo de la respuesta.

Ejemplos

Ejemplo 1: Creación de una agentInstance con un nuevo agentCardManifest

Solicitud

En el ejemplo siguiente se muestra la solicitud.

POST https://graph.microsoft.com/beta/agentRegistry/agentInstances
Content-Type: application/json

{
  "id": "Security Copilot Platform Agent: 00222",
  "ownerIds": [
    "daf58b0e-44e1-433c-b6b0-ca70cae320b8",
    "b9108c41-d2d2-4e78-b073-92f57b752bd0"
  ],
  "managedBy": "719cc904-9700-4e08-9941-fd826cc84c60",
  "originatingStore": "Microsoft Security Copilot",
  "createdBy": "d47bffae-411a-4de9-8548-05e79bc01f0d",
  "displayName": "Conditional Access Agent",
  "sourceAgentId": "00222",
  "agentIdentityBlueprintId": "d0108c41-d2d2-4e78-b073-92f57b752bd0",
  "agentIdentityId": "dd108c41-d2d2-4e78-b073-92f57b752bd0",
  "agentUserId": "ee108c41-d2d2-4e78-b073-92f57b752bd0",
  "createdDateTime": "2025-01-01T00:00:00.1234567Z",
  "lastModifiedDateTime": "2025-01-01T00:00:00.1234567Z",
  "url": "https://conditional-access-agent.example.com/a2a/v1",
  "preferredTransport": "JSONRPC",
  "additionalInterfaces": [
    {
      "url": "https://conditional-access-agent.example.com/a2a/v1",
      "transport": "JSONRPC"
    },
    {
      "url": "https://conditional-access-agent.example.com/a2a/grpc",
      "transport": "GRPC"
    },
    {
      "url": "https://conditional-access-agent.example.com/a2a/json",
      "transport": "HTTP+JSON"
    }
  ],
  "signatures": [
    {
      "protected": "eyJhbGciOiJFUzI1NiIsImtpZCI6ImRpZDp3ZWI6Y29udG9zby5leGFtcGxlI2tleS0xIiwidHlwIjoiYWdlbnRjYXJkK2p3cyJ9",
      "signature": "xOSim9oMw_CdZM-qDhmwpB5fJcBx5I30yh-FZULd1j9ruPEUBnJzmfCynNfH1KgmJ2B7ulAYc7D2iIb-4Ul-8w",
      "header": {
        "kidHint": "contoso-key-1",
        "nonce": "f1e9b6c3-2f3a-4a3a-b604-1f9af3f2a9c0"
      }
    }
  ],
  "agentCardManifest": {
    "ownerIds": [
      "0ef68a76-e247-41dd-947b-41282760a2ac"
    ],
    "originatingStore": "Copilot Studio",
    "displayName": "Conditional Access Agent Card",
    "description": "Manages organizational conditional access policies",
    "iconUrl": "https://example.com/icon.png",
    "provider": {
      "organization": "Test Organization",
      "url": "https://test.com"
    },
    "protocolVersion": "1.0",
    "version": "1.0.0",
    "documentationUrl": "https://example.com/docs",
    "capabilities": {
      "streaming": false,
      "pushNotifications": false,
      "stateTransitionHistory": true,
      "extensions": [
        {
          "uri": "https://contoso.example.com/a2a/capabilities/secureMessaging",
          "description": null,
          "required": false,
          "params": {
            "useHttps": true
          }
        }
      ]
    },
    "defaultInputModes": [
      "application/json"
    ],
    "defaultOutputModes": [
      "application/json",
      "text/html"
    ],
    "supportsAuthenticatedExtendedCard": true,
    "skills": [
      {
        "id": "threat-detection",
        "displayName": "Threat Detection",
        "description": "Detect security threats in real-time",
        "tags": [
          "security",
          "threat",
          "detection"
        ],
        "examples": [
          "Analyze this log for threats",
          "Check for malware"
        ],
        "inputModes": [
          "application/json",
          "text/plain"
        ],
        "outputModes": [
          "application/json",
          "text/html"
        ]
      }
    ]
  }
}

Respuesta

En el ejemplo siguiente se muestra la respuesta.

Nota: Se puede acortar el objeto de respuesta que se muestra aquí para mejorar la legibilidad.

HTTP/1.1 201 Created
Content-Type: application/json

{
  "id": "Security Copilot Platform Agent: 00222",
  "ownerIds": [
    "daf58b0e-44e1-433c-b6b0-ca70cae320b8",
    "b9108c41-d2d2-4e78-b073-92f57b752bd0"
  ],
  "managedBy": "719cc904-9700-4e08-9941-fd826cc84c60",
  "originatingStore": "Microsoft Security Copilot",
  "createdBy": "d47bffae-411a-4de9-8548-05e79bc01f0d",
  "displayName": "Conditional Access Agent",
  "sourceAgentId": "00222",
  "agentIdentityBlueprintId": "d0108c41-d2d2-4e78-b073-92f57b752bd0",
  "agentIdentityId": "dd108c41-d2d2-4e78-b073-92f57b752bd0",
  "agentUserId": "ee108c41-d2d2-4e78-b073-92f57b752bd0",
  "createdDateTime": "2025-01-01T00:00:00.1234567Z",
  "lastModifiedDateTime": "2025-01-01T00:00:00.1234567Z",
  "url": "https://conditional-access-agent.example.com/a2a/v1",
  "preferredTransport": "JSONRPC",
  "additionalInterfaces": [
    {
      "url": "https://conditional-access-agent.example.com/a2a/v1",
      "transport": "JSONRPC"
    },
    {
      "url": "https://conditional-access-agent.example.com/a2a/grpc",
      "transport": "GRPC"
    },
    {
      "url": "https://conditional-access-agent.example.com/a2a/json",
      "transport": "HTTP+JSON"
    }
  ],
  "signatures": [
    {
      "protected": "eyJhbGciOiJFUzI1NiIsImtpZCI6ImRpZDp3ZWI6Y29udG9zby5leGFtcGxlI2tleS0xIiwidHlwIjoiYWdlbnRjYXJkK2p3cyJ9",
      "signature": "xOSim9oMw_CdZM-qDhmwpB5fJcBx5I30yh-FZULd1j9ruPEUBnJzmfCynNfH1KgmJ2B7ulAYc7D2iIb-4Ul-8w",
      "header": {
        "kidHint": "contoso-key-1",
        "nonce": "f1e9b6c3-2f3a-4a3a-b604-1f9af3f2a9c0"
      }
    }
  ]
}

Ejemplo 2: Creación de una agentInstance y referencia a un agente existenteCardManifest

Solicitud

En el ejemplo siguiente se muestra la solicitud.

POST https://graph.microsoft.com/beta/agentRegistry/agentInstances
Content-Type: application/json

{
  "id": "Security Copilot Platform Agent: 00222",
  "ownerIds": [
    "daf58b0e-44e1-433c-b6b0-ca70cae320b8",
    "b9108c41-d2d2-4e78-b073-92f57b752bd0"
  ],
  "managedBy": "719cc904-9700-4e08-9941-fd826cc84c60",
  "originatingStore": "Microsoft Security Copilot",
  "createdBy": "d47bffae-411a-4de9-8548-05e79bc01f0d",
  "displayName": "Conditional Access Agent",
  "sourceAgentId": "00222",
  "agentIdentityBlueprintId": "d0108c41-d2d2-4e78-b073-92f57b752bd0",
  "agentIdentityId": "dd108c41-d2d2-4e78-b073-92f57b752bd0",
  "agentUserId": "ee108c41-d2d2-4e78-b073-92f57b752bd0",
  "createdDateTime": "2025-01-01T00:00:00.1234567Z",
  "lastModifiedDateTime": "2025-01-01T00:00:00.1234567Z",
  "url": "https://conditional-access-agent.example.com/a2a/v1",
  "preferredTransport": "JSONRPC",
  "additionalInterfaces": [
    {
      "url": "https://conditional-access-agent.example.com/a2a/v1",
      "transport": "JSONRPC"
    },
    {
      "url": "https://conditional-access-agent.example.com/a2a/grpc",
      "transport": "GRPC"
    },
    {
      "url": "https://conditional-access-agent.example.com/a2a/json",
      "transport": "HTTP+JSON"
    }
  ],
  "signatures": [
    {
      "protected": "eyJhbGciOiJFUzI1NiIsImtpZCI6ImRpZDp3ZWI6Y29udG9zby5leGFtcGxlI2tleS0xIiwidHlwIjoiYWdlbnRjYXJkK2p3cyJ9",
      "signature": "xOSim9oMw_CdZM-qDhmwpB5fJcBx5I30yh-FZULd1j9ruPEUBnJzmfCynNfH1KgmJ2B7ulAYc7D2iIb-4Ul-8w",
      "header": {
        "kidHint": "contoso-key-1",
        "nonce": "f1e9b6c3-2f3a-4a3a-b604-1f9af3f2a9c0"
      }
    }
  ],
  "agentCardManifest@odata.bind": "https://graph.microsoft.com/beta/agentRegistry/agentCardManifests('employee-assistant')"
}

Respuesta

En el ejemplo siguiente se muestra la respuesta.

Nota: Se puede acortar el objeto de respuesta que se muestra aquí para mejorar la legibilidad.

HTTP/1.1 201 Created
Content-Type: application/json

{
  "id": "Security Copilot Platform Agent: 00222",
  "ownerIds": [
    "daf58b0e-44e1-433c-b6b0-ca70cae320b8",
    "b9108c41-d2d2-4e78-b073-92f57b752bd0"
  ],
  "managedBy": "719cc904-9700-4e08-9941-fd826cc84c60",
  "originatingStore": "Microsoft Security Copilot",
  "createdBy": "d47bffae-411a-4de9-8548-05e79bc01f0d",
  "displayName": "Conditional Access Agent",
  "sourceAgentId": "00222",
  "agentIdentityBlueprintId": "d0108c41-d2d2-4e78-b073-92f57b752bd0",
  "agentIdentityId": "dd108c41-d2d2-4e78-b073-92f57b752bd0",
  "agentUserId": "ee108c41-d2d2-4e78-b073-92f57b752bd0",
  "createdDateTime": "2025-01-01T00:00:00.1234567Z",
  "lastModifiedDateTime": "2025-01-01T00:00:00.1234567Z",
  "url": "https://conditional-access-agent.example.com/a2a/v1",
  "preferredTransport": "JSONRPC",
  "additionalInterfaces": [
    {
      "url": "https://conditional-access-agent.example.com/a2a/v1",
      "transport": "JSONRPC"
    },
    {
      "url": "https://conditional-access-agent.example.com/a2a/grpc",
      "transport": "GRPC"
    },
    {
      "url": "https://conditional-access-agent.example.com/a2a/json",
      "transport": "HTTP+JSON"
    }
  ],
  "signatures": [
    {
      "protected": "eyJhbGciOiJFUzI1NiIsImtpZCI6ImRpZDp3ZWI6Y29udG9zby5leGFtcGxlI2tleS0xIiwidHlwIjoiYWdlbnRjYXJkK2p3cyJ9",
      "signature": "xOSim9oMw_CdZM-qDhmwpB5fJcBx5I30yh-FZULd1j9ruPEUBnJzmfCynNfH1KgmJ2B7ulAYc7D2iIb-4Ul-8w",
      "header": {
        "kidHint": "contoso-key-1",
        "nonce": "f1e9b6c3-2f3a-4a3a-b604-1f9af3f2a9c0"
      }
    }
  ]
}

Ejemplo 3: Creación de una agentInstance sin agentCardManifest

Solicitud

En el ejemplo siguiente se muestra la solicitud. Para agregar un agentCardManifest más adelante, use la API Update agentInstance.

POST https://graph.microsoft.com/beta/agentRegistry/agentInstances
Content-Type: application/json

{
  "id": "Security Copilot Platform Agent: 00222",
  "ownerIds": [
    "daf58b0e-44e1-433c-b6b0-ca70cae320b8",
    "b9108c41-d2d2-4e78-b073-92f57b752bd0"
  ],
  "managedBy": "719cc904-9700-4e08-9941-fd826cc84c60",
  "originatingStore": "Microsoft Security Copilot",
  "createdBy": "d47bffae-411a-4de9-8548-05e79bc01f0d",
  "displayName": "Conditional Access Agent",
  "sourceAgentId": "00222",
  "agentIdentityBlueprintId": "d0108c41-d2d2-4e78-b073-92f57b752bd0",
  "agentIdentityId": "dd108c41-d2d2-4e78-b073-92f57b752bd0",
  "agentUserId": "ee108c41-d2d2-4e78-b073-92f57b752bd0",
  "createdDateTime": "2025-01-01T00:00:00.1234567Z",
  "lastModifiedDateTime": "2025-01-01T00:00:00.1234567Z",
  "url": "https://conditional-access-agent.example.com/a2a/v1",
  "preferredTransport": "JSONRPC",
  "additionalInterfaces": [
    {
      "url": "https://conditional-access-agent.example.com/a2a/v1",
      "transport": "JSONRPC"
    },
    {
      "url": "https://conditional-access-agent.example.com/a2a/grpc",
      "transport": "GRPC"
    },
    {
      "url": "https://conditional-access-agent.example.com/a2a/json",
      "transport": "HTTP+JSON"
    }
  ],
  "signatures": [
    {
      "protected": "eyJhbGciOiJFUzI1NiIsImtpZCI6ImRpZDp3ZWI6Y29udG9zby5leGFtcGxlI2tleS0xIiwidHlwIjoiYWdlbnRjYXJkK2p3cyJ9",
      "signature": "xOSim9oMw_CdZM-qDhmwpB5fJcBx5I30yh-FZULd1j9ruPEUBnJzmfCynNfH1KgmJ2B7ulAYc7D2iIb-4Ul-8w",
      "header": {
        "kidHint": "contoso-key-1",
        "nonce": "f1e9b6c3-2f3a-4a3a-b604-1f9af3f2a9c0"
      }
    }
  ]
}

Respuesta

En el ejemplo siguiente se muestra la respuesta.

Nota: Se puede acortar el objeto de respuesta que se muestra aquí para mejorar la legibilidad.

HTTP/1.1 201 Created
Content-Type: application/json

{
  "id": "Security Copilot Platform Agent: 00222",
  "ownerIds": [
    "daf58b0e-44e1-433c-b6b0-ca70cae320b8",
    "b9108c41-d2d2-4e78-b073-92f57b752bd0"
  ],
  "managedBy": "719cc904-9700-4e08-9941-fd826cc84c60",
  "originatingStore": "Microsoft Security Copilot",
  "createdBy": "d47bffae-411a-4de9-8548-05e79bc01f0d",
  "displayName": "Conditional Access Agent",
  "sourceAgentId": "00222",
  "agentIdentityBlueprintId": "d0108c41-d2d2-4e78-b073-92f57b752bd0",
  "agentIdentityId": "dd108c41-d2d2-4e78-b073-92f57b752bd0",
  "agentUserId": "ee108c41-d2d2-4e78-b073-92f57b752bd0",
  "createdDateTime": "2025-01-01T00:00:00.1234567Z",
  "lastModifiedDateTime": "2025-01-01T00:00:00.1234567Z",
  "url": "https://conditional-access-agent.example.com/a2a/v1",
  "preferredTransport": "JSONRPC",
  "additionalInterfaces": [
    {
      "url": "https://conditional-access-agent.example.com/a2a/v1",
      "transport": "JSONRPC"
    },
    {
      "url": "https://conditional-access-agent.example.com/a2a/grpc",
      "transport": "GRPC"
    },
    {
      "url": "https://conditional-access-agent.example.com/a2a/json",
      "transport": "HTTP+JSON"
    }
  ],
  "signatures": [
    {
      "protected": "eyJhbGciOiJFUzI1NiIsImtpZCI6ImRpZDp3ZWI6Y29udG9zby5leGFtcGxlI2tleS0xIiwidHlwIjoiYWdlbnRjYXJkK2p3cyJ9",
      "signature": "xOSim9oMw_CdZM-qDhmwpB5fJcBx5I30yh-FZULd1j9ruPEUBnJzmfCynNfH1KgmJ2B7ulAYc7D2iIb-4Ul-8w",
      "header": {
        "kidHint": "contoso-key-1",
        "nonce": "f1e9b6c3-2f3a-4a3a-b604-1f9af3f2a9c0"
      }
    }
  ]
}