-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Create Account | ||
|
||
Ensure you set `HATSU_ACCESS_TOKEN` correctly in the [previous section](./install-with-docker.md) first, otherwise you will not be able to use the Hatsu Admin API. | ||
|
||
## just | ||
|
||
The easiest way to create an account is the [`just`](https://github.com/casey/just) command line tool: | ||
|
||
```bash | ||
just account create example.com | ||
``` | ||
|
||
If you are using docker, you need to exec to the container first. | ||
|
||
```bash | ||
docker exec -it hatsu /bin/bash | ||
``` | ||
|
||
## curl | ||
|
||
You can also access the API via curl, as `Justfile` does. | ||
|
||
```bash | ||
curl -X POST "http://localhost:$(echo $HATSU_LISTEN_PORT)/api/v0/admin/create-account?token=$(echo $HATSU_ACCESS_TOKEN)" \ | ||
-H "Content-Type: application/json" \ | ||
-d "{\"name\": \"example.com\"}" | ||
``` |