API Error 1431: "Invalid authentication token" on UpdateToLatestPackageVersion

Hi everyone,

I am encountering an issue while trying to update a process to the latest package version via the Orchestrator API. I am using the following endpoint:

POST /odata/Releases(ID)/UiPath.Server.Configuration.OData.UpdateToLatestPackageVersion

Issue:

Error Message: {"message":"Invalid authentication token","errorCode":1431}

Details & Troubleshooting already performed:

  • I am using Bearer Authentication with a token generated via Personal Access Token
  • The token generation is successful, but the call to the Releases endpoint fails.
  • I have verified that all requisite scopes are provided.
  • The X-UIPATH-OrganizationUnitId is included in the headers.

This was working previously with the old token. Has anyone faced Error 1431 specifically after a token update? Is there a known delay or a specific permission at the folder level that might need to be refreshed?

The Bearer token (Personal Access Token) should have these OAuth required scopes: OR.Execution or OR.Execution.Write.

If that is executed by a robot that is connected to Orchestrator, in the folder role needs to have this permission: Processes.Edit.

The token should have this format: “Bearer PAT_VALUE"

I tried internally, and it worked as expected for a PAT for Orchesrator API with OR.Execution.Write permission.

URL:
https://cloud.uipath.com/ORG_NAME/TENANT_NAME/orchestrator_/odata/Releases(RELEASE_ID)/UiPath.Server.Configuration.OData.UpdateToLatestPackageVersion?mergePackageTags=false
Method: POST
Headers:
Authorization: Bearer PAT_TOKEN_VALUE
Accept: application/json
X-UiPath-OrganizationUnitId: FOLDER_ID

Hi @himanshu.chopra,

It seems that you may not have added the required scope to the token. Could you please verify that?

Thanks

I am having all necessary access and permission to Edit processes, still not working,

Create a new PAT for UiPath.Orchestrator with only OR.Execution permission and use the new PAT.
Does it help?

I tried in the suggested way, still it is showing the same issue.

Raise a support case to UiPath Support to analyze.
Use https://customerportal.uipath.com/