Skip to content

create new user programmatically #70

Answered by frankie567
JustinGuese asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @JustinGuese, welcome to Fief 👋

The best way is to use the Admin API for this. Documentation is a bit missing for this but basically you need two things:

  • An Admin API key.
  • Make HTTP requests to the API. There is an interactive documentation available at your workspace subdomain. For example, if your subdomain is justinguese, you'll find it at https://justinguese.fief.dev/admin/api/docs.
    • To create a user, you'll be interested in POST /users/.
    • To assign a role, you'll be interested in POST /users/{id}/roles.
    • The Admin API Key should be passed in the Authorization header with the Bearer scheme: Authorization: Bearer YOUR_KEY.

Of course, users can also create an account themselves on …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by frankie567
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants