- thorne-wolf.ghost.io
- Whatever the latest Ghost Pro version it
Stack trace:
Validation error, cannot save member.
ValidationError: Validation error, cannot save member.
at /home/thorn/programming/desktop/news-website/node_modules/@tryghost/admin-api/lib/admin-api.js:463:33
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async POST (/home/thorn/programming/desktop/news-website/src/routes/api/members/add/+server.ts:32:19)
at async render_endpoint (file:///home/thorn/programming/desktop/news-website/node_modules/@sveltejs/kit/src/runtime/server/endpoint.js:42:20)
at async resolve (file:///home/thorn/programming/desktop/news-website/node_modules/@sveltejs/kit/src/runtime/server/index.js:354:17)
at async respond (file:///home/thorn/programming/desktop/news-website/node_modules/@sveltejs/kit/src/runtime/server/index.js:229:20)
at async file:///home/thorn/programming/desktop/news-website/node_modules/@sveltejs/kit/src/exports/vite/dev/index.js:444:22
Code I am attempting to execute
const api = new GhostAdminAPI({
url: 'https://thorne-wolf.ghost.io',
key: ghostAdminApiKey,
version: "v5.0"
});
let finalPayload = {
"members": [
{
"email": "jamie@ghost.org",
}
]
}
let response = await api.members.add(finalPayload)
I have a separate working example with the content api (const api = new GhostContentAPI({ url: 'https://thorne-wolf.ghost.i - Pastebin.com) that works.
Regarding the payload, I have tried a few alternatives but none proved fruitful. I can provide them if requested but I suspect they would not be useful to someone who already knows the correct format. LMK what I might be doing wrong.
Thanks!