# Bearer token API?

**URL:** <https://forums.suse.com/t/bearer-token-api/11915>\
**Category:** SUSE Rancher Prime\
**Created:** [October 3, 2018, 7:27am UTC](https://forums.suse.com/t/bearer-token-api/11915 "2018-10-03T07:27:13Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![hashimotor](https://avatars.discourse-cdn.com/v4/letter/h/50afbb/32.png) [@hashimotor](https://forums.suse.com/u/hashimotor)\
**Post date:** [October 3, 2018, 7:27am UTC](https://forums.suse.com/t/bearer-token-api/11915/1 "2018-10-03T07:27:13Z")

</div>

Is there a way to retrieve bearer token of project owner for Rancher API using API or CLI?  
I found them on WebUI but couldn’t find them on API or CLI documentation.

---

<div class="post-metadata">

**Author:** ![vincent](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/vincent/32/7156_2.png) [@vincent](https://forums.suse.com/u/vincent)\
**Post date:** [October 3, 2018, 5:46pm UTC](https://forums.suse.com/t/bearer-token-api/11915/2 "2018-10-03T17:46:44Z")

</div>

The UI is a 100% client-side API client. Anything it can do you can do through the API by definition. This is just sort of an odd case because API/CLI access is gated by already having a token in the first place.

`curl -u <existing token for a user> -X POST -H 'Content-Type: application/json' -d '{}' https://your-rancher/v3/tokens`

---

<div class="post-metadata">

**Author:** ![hashimotor](https://avatars.discourse-cdn.com/v4/letter/h/50afbb/32.png) [@hashimotor](https://forums.suse.com/u/hashimotor)\
**Post date:** [October 4, 2018, 6:05am UTC](https://forums.suse.com/t/bearer-token-api/11915/3 "2018-10-04T06:05:42Z")

</div>

Thank you for your suggestion.

In that example you mentioned, admin can retrieve a new token using an old token. How about getting token of the other user? (eg admin can get token of project A owner foo. )

And, if I should find the answer, where the /v3/tokens endpoint usage/format/spec? I couldn’t find it either github rancher/api-spec or Rancher 1.6 API v2 doc.

---

<div class="post-metadata">

**Author:** ![vincent](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/vincent/32/7156_2.png) [@vincent](https://forums.suse.com/u/vincent)\
**Post date:** [October 4, 2018, 6:25am UTC](https://forums.suse.com/t/bearer-token-api/11915/4 "2018-10-04T06:25:42Z")

</div>

Users cannot create (or get) tokens for other users.

The api-spec is a generic description of the “style” of all APIs that we implement; it has nothing to do with any particular product and is not really meant to be user-facing documentation, it’s for someone implementing a client or compliant server.

The `v2[-beta]` API is for 1.x, Rancher 2 is `v3`. There are no docs pages, but the were just generated from all the same schemas and such you can see clicking around the API in a browser.

---

<div class="post-metadata">

**Author:** ![hashimotor](https://avatars.discourse-cdn.com/v4/letter/h/50afbb/32.png) [@hashimotor](https://forums.suse.com/u/hashimotor)\
**Post date:** [October 4, 2018, 6:38am UTC](https://forums.suse.com/t/bearer-token-api/11915/5 "2018-10-04T06:38:54Z")

</div>

Thank you so much. I will find that (the same) schemas.
