Skip to content

Commit 3958031

Browse files
committed
Update session-tokens docs for token creation
Add instructions for generating tokens via REST API and CLI.
1 parent 5c4ec96 commit 3958031

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

docs/admin/users/sessions-tokens.md

+15-2
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,28 @@ See the help docs for
5151

5252
### Generate a long-lived API token on behalf of another user
5353

54+
<div class="tabs">
55+
56+
## CLI
57+
5458
As of Coder v2.17+, you can create long-lived tokens on behalf of other users if
5559
your account is `Owner`. Use the following command:
5660

5761
```sh
5862
coder tokens create my-token --user <username>
5963
```
6064

61-
> See the full API reference for
62-
> [`coder tokens create`](../../reference/cli/tokens_create.md)
65+
See the full API reference for
66+
[`coder tokens create`](../../reference/cli/tokens_create.md)
67+
68+
## API
69+
70+
You can also use the REST API to generate a token on behalf of another user. You
71+
must have the `Owner` role to do this. Use our API reference for more
72+
information:
73+
[Create token API key](https://coder.com/docs/reference/api/users#create-token-api-key)
74+
75+
</div>
6376

6477
### Set max token length
6578

0 commit comments

Comments
 (0)