Hello Gurkirat Singh,
The error message you're encountering:
"code": "Directory_ObjectNotFound",
"message": "Unable to read the company information from the directory."
, indicates that the specified partner tenant ID does not have an existing cross-tenant identity synchronization policy. This situation can arise due to several reasons, even if the cross-tenant relationship exists and you have the necessary permissions.
Check API Permissions: Ensure that your application has the required Microsoft Graph API permissions, such as Policy.ReadWrite.CrossTenantAccess.
Grant Admin Consent: If your application requires admin consent for these permissions, ensure that consent has been granted. Ensure that the tenant ID used in your requests is correct.
Microsoft Document-:
Configure cross-tenant synchronization using PowerShell or Microsoft Graph API - Microsoft Entra ID | Microsoft Learn
Github Document : https://github.com/MicrosoftDocs/entra-docs/blob/main/docs/identity/multi-tenant-organizations/cross-tenant-synchronization-configure-graph.md?utm_source=chatgpt.com#symptom---directory_objectnotfound-error