An unknown error has occurred

MAGNO HOLZ 0 Reputation points
2025-12-03T18:58:51.8966667+00:00

estou tentando colocar um convidado na equipe e ocorre este erro

{
    "error": {
        "code": "Forbidden",
        "message": "An unknown error has occurred.",
        "innerError": {
            "code": "AccessDenied",
            "message": "An unknown error has occurred.",
            "details": [],
            "date": "2025-12-03T18:50:26",
            "request-id": "5428395a-<PII removed>-1899a8ec2f14",
            "client-request-id": "5428395a-3<PII removed>-1899a8ec2f14"
        }
    }
}
Microsoft Teams | Development
Microsoft Teams | Development
Building, integrating, or customizing apps and workflows within Microsoft Teams using developer tools and APIs
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Q&A Assist
    2025-12-03T18:59:05.4033333+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    The error message you are encountering when trying to add a guest to the team indicates an "Access Denied" issue, which could be related to several factors. Here are some potential causes and resolutions:

    1. Guest Access Settings: Ensure that guest access is properly configured in Microsoft Teams. This includes settings in Microsoft Entra ID, Microsoft 365 Groups, and SharePoint. You may need to check your organization's external collaboration settings.
    2. B2B Collaboration Restrictions: The error might occur due to restrictions in the B2B collaboration settings of your organization. Make sure that your organization's settings allow for guest invitations and that there are no policies blocking the invitation.
    3. Cross-Tenant Access Settings: If your organization has cross-tenant access settings configured, ensure that they allow for the guest you are trying to invite. If the settings are too restrictive, it may lead to access denial.
    4. Licensing Issues: Verify that your organization has the appropriate licenses for guest access. Guest access can be used with Microsoft 365 Business Standard, Microsoft 365 Enterprise, and Microsoft 365 Education subscriptions without needing extra licenses.

    If you continue to face issues, consider running a diagnostic tool in the Microsoft 365 admin center to validate that guest access is correctly configured for use in Teams. This tool can provide insights into any misconfigurations that may be causing the error.


    References:

    0 comments No comments

  2. MAGNO HOLZ 0 Reputation points
    2025-12-03T19:00:06.5733333+00:00

    se anexar diretamente na equipe funciona, via api não

    0 comments No comments

  3. Teddie-D 8,640 Reputation points Microsoft External Staff Moderator
    2025-12-04T04:19:10.0366667+00:00

    Por favor, note que este é o fórum en-us. Recomendamos gentilmente que publique sua pergunta em inglês para que mais membros da comunidade possam ajudá-lo. Alternativamente, você pode considerar postar no fórum em português se preferir usar seu idioma nativo. Agradecemos sinceramente sua compreensão.  

    Olá @MAGNO HOLZ 

    Obrigado por postar sua pergunta no fórum Microsoft Q&A.  

    Por favor, note que nosso fórum é uma plataforma pública, e modificaremos sua pergunta para ocultar suas informações pessoais na descrição. Solicitamos que, da próxima vez que postar um erro ou outros detalhes, oculte quaisquer informações pessoais ou organizacionais para proteger seus dados pessoais. 

    Parece que você encontrou o problema ao adicionar o convidado pela interface do Teams, mas a operação falha pela API com Forbidden / AccessDenied. 

    Existem dois passos se fizer isso via API: 

    1.Convidar o convidado: 

    POST https://graph.microsoft.com/v1.0/invitations 
    Content-Type: application/json 
    Authorization: Bearer <token> 
    
     { 
      "invitedUserEmailAddress": "guest@example.com", 
      "inviteRedirectUrl": "https://teams.microsoft.com", 
      "sendInvitationMessage": true 
    } 
    

    User's image

    2.Adicionar o convidado ao time após o convite ser aceito: 

    POST https://graph.microsoft.com/v1.0/teams/{team-id}/members 
    Content-Type: application/json 
    Authorization: Bearer <token> 
    
     { 
      "@odata.type": "#microsoft.graph.aadUserConversationMember", 
      "roles": ["guest"], 
      "******@odata.bind": "https://graph.microsoft.com/v1.0/users('{guest-user-id}')" 
    } 
    

    User's image

    Se você pular a etapa de convite e tentar adicionar diretamente um convidado inexistente, a API retorna AccessDenied.  

    Este é o resultado: 
    User's image

    Espero que isso ajude.


    Se a resposta for útil, por favor clique em "Accept Answer" e gentilmente dê um voto positivo. Se tiver perguntas adicionais sobre esta resposta, clique em "Comment". 

    Nota: Por favor, siga os passos em nossa documentação para habilitar notificações por e-mail caso queira receber o e-mail relacionado a este tópico. 


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.