Hi,
Our client is running 10.25.6 and we've built a custom addIn in which we want to create a file via custom JS.
Attempting to use the endpoint /admin/api/FileCreateRename is not allowed and message says file already exists(when it doesnt).
When attempting to test it in Api explorer it throws error: Unknown layout type: 'CommandExecute'.
Any insight is much appreciated,
Thanks
Developer forum
E-mail notifications
/admin/api/FileCreateRename is not allowed
Joakim
Posted on 20/05/2026 13:58:06
Replies
Nicolai Pedersen
Posted on 21/05/2026 12:04:56
Can you share the payload you send when seeing this?
Joakim
Posted on 21/05/2026 12:13:45
This is the payload:
Nicolai Pedersen
Posted on 21/05/2026 14:05:17
This post has been marked as an answer
Thanks
I have looked at it. Andf that command is confusing - I agree...
The root problem is your payload — you are passing model.name: 'settings' which triggers rename mode. The correct payload for creating a new file is:
const payload = {
name: 'settings.json', // ← the Command.Name (desired filename)
model: {
name: '', // ← empty = new file (not rename)
directoryPath: '/Files/System',
}
}
I have changed the command - so first of all you would get a Invalid status and not "NotAllowed" which is technically incorrect.
I have also added 2 additional checks giving you a precise error when the payload is 'wrong':
- "Operation failed. The file '{model.Name}' does not exist."
- "Operation failed. The file '{Name}' already exists."
For compatbility reasons we cannot change the command to be more explicit on rename or new.
Votes for this answer: 1
Nicolai Pedersen
Posted on 21/05/2026 14:06:12
You must be logged in to post in the forum