"Add user" function for Admin API

I’ve seen several people wanting to create users manually or add them programmatically, rather than having to send an invite for each one. Perhaps the Ghost API could have a “create user” functionality?

Editing and deleting users are probably best left to the admin interface for now, because they can potentially destroy a lot of data, but a system for simply adding users that don’t yet exist would be nice.

In admin panel, all actions ara performed via API.
What the difference to this admin api that admin ui consume and api used by SDK ?

@luizamboni staff users are not creatable via the API. It’s possible to create invites via the API, the recipient then has to accept it and fill in their details at which point a staff user record is created - that’s the only staff user creation flow that exists at present.

1 Like

@badrihippo I feel the same. I’m looking into Ghost as an option, but the lack of features (and flexibility) from the CLI is a disappointment – it’s exactly where I expected Ghost’s strong point to be when first reading the introduction.

The fact that I cannot even set up a test user for a local dev installation is disappointing. That should be trivial to implement.

Incidentally, I posted a workaround on this thread. You basically need to copy the following JSON code and replace the user details with your own, then “import” the generated file into Ghost:

{
  "data": {
    "posts": [],
    "tags": [],
    "posts_tags": [],
    "users": [
      {
        "id": 1,
        "slug": "person",
        "bio": "I am a person on the website",
        "website": "https://www.example.com",
        "created_at": "Thu, 3 Aug 2019 13:45:57 +0530",
        "created_by": 1,
        "email": "person@example.com",
        "name": "Some Person",
        "profile_image": ""
      }
    ]
  },
  "meta": {
    "exported_on": "Thu, 3 Aug 2019 13:46:48 +0530",
    "version": "2.14.0"
  }
}

Not neat, but it works, and I’m planning to write a script for it that would make things even more convenient

1 Like