The ghost documentation here for admin api states that :
All writable fields of a post can be updated via the edit endpoint.
Which exactly are the writable fields in the post object? I dont see it documentated anywhere.
Can someone tell me which are the writeable fields or how can I figure this out?
Writable fields include pretty much everything except the id and uuid and updated_at. (You set updated_at to the value currently on the post in order to update the post, and then Ghost sets it to the right value.)
Thank you for the response.
I am not sure if that is exactly correct. For example, I try to update the “created_at” field, but it does not get updated.
You’re right. You have access to published_at (and can set it to anything you like), but I don’t think created_at is editable.
Thanks for confirming.
So, back to my original question. Is there a documented place where I can see all the fields that are “editable” via the Admin API for the different objects? I am specifically interested in “posts” object now.
@RyanF thanks that looks good and actually it is helpful but for something else I was looking.
But that link still does not explicitly specify which fields are editable and which are not.
So the current question is still unanswered for me.
Here’s one way to generate a partial list. The admin panel at /ghost/ actually uses the admin-api. So anything you can edit in the admin panel is going to be editable with the api.
It’s possible that some additional fields are also editable, but if you can do it with /ghost/, you can do it with the api (although possibly only with a cookie).
It’s a schema file for the writable fields. Any fields that aren’t in that schema get filtered out from the request body so it’s essentially an “allowlist”.