Problem
There is defined API to lock workspace. But when calling it either via any programming language or through terminal, it may give 404 error even after having owner rights and workspace exists.
Cause
The possible reasons could be:
- Workspace not found
- User unauthorised to perform action.
Possible solutions:
- Changing settings and force-unlocking require admin access to the workspace.
- Make sure the workspace exists in the TFC organisation.
- User token, organisation token and team token has different privilege to perform tasks. For instance, workspace lock cannot be performed through organisation token but could only be done via team and user's token.
When tried with user token, it works fine: