# Fronted endpoint

**URL:** <https://openziti.discourse.group/t/fronted-endpoint/2969>\
**Category:** zrok\
**Created:** [August 13, 2024, 7:45pm UTC](https://openziti.discourse.group/t/fronted-endpoint/2969 "2024-08-13T19:45:26Z")\
**Posts on this page:** 12\
**Page:** 2

<div class="post-metadata">

**Author:** ![chiappone](https://yyz2.discourse-cdn.com/free1/user_avatar/openziti.discourse.group/chiappone/32/2740_2.png) [@chiappone](https://openziti.discourse.group/u/chiappone)\
**Post date:** [August 21, 2024, 7:44pm UTC](https://openziti.discourse.group/t/fronted-endpoint/2969/21 "2024-08-21T19:44:59Z")

</div>

This is great, was able to convert this into a postman collection. Couple of questions on the API, some calls work as expected using the token returned from the login as the auth token. Calling a /frontends to list all frontends gives me a 401, is there a different auth token that should be used for that?

---

<div class="post-metadata">

**Author:** ![michael.quigley](https://yyz2.discourse-cdn.com/free1/user_avatar/openziti.discourse.group/michael.quigley/32/1123_2.png) [@michael.quigley](https://openziti.discourse.group/u/michael.quigley)\
**Post date:** [August 21, 2024, 7:50pm UTC](https://openziti.discourse.group/t/fronted-endpoint/2969/22 "2024-08-21T19:50:17Z")

</div>

The `/frontends` endpoint is used by the `zrok admin` tooling to manage public frontends. It requires an admin token.

If you're just trying to list the contents of your environment, you want `/overview`.

---

<div class="post-metadata">

**Author:** ![chiappone](https://yyz2.discourse-cdn.com/free1/user_avatar/openziti.discourse.group/chiappone/32/2740_2.png) [@chiappone](https://openziti.discourse.group/u/chiappone)\
**Post date:** [August 21, 2024, 7:57pm UTC](https://openziti.discourse.group/t/fronted-endpoint/2969/23 "2024-08-21T19:57:46Z")

</div>

Sorry to be naive but where would I get the admin token on a self hosted environment?

---

<div class="post-metadata">

**Author:** ![qrkourier](https://yyz2.discourse-cdn.com/free1/user_avatar/openziti.discourse.group/qrkourier/32/52_2.png) [@qrkourier](https://openziti.discourse.group/u/qrkourier)\
**Post date:** [August 21, 2024, 7:58pm UTC](https://openziti.discourse.group/t/fronted-endpoint/2969/24 "2024-08-21T19:58:57Z")

</div>

It's `ZROK_ADMIN_TOKEN` in your compose project's `.env` file since you followed the Docker guide.

---

<div class="post-metadata">

**Author:** ![michael.quigley](https://yyz2.discourse-cdn.com/free1/user_avatar/openziti.discourse.group/michael.quigley/32/1123_2.png) [@michael.quigley](https://openziti.discourse.group/u/michael.quigley)\
**Post date:** [August 21, 2024, 8:16pm UTC](https://openziti.discourse.group/t/fronted-endpoint/2969/25 "2024-08-21T20:16:50Z")

</div>

> [@chiappone](#):
>
> Sorry to be naive but where would I get the admin token on a self hosted environment?

It's in the zrok controller configuration:

```auto
# _______  ___| |__
# |_ / '__/ _ \| |/ /
# / /| | | (_) | <
# / ___|_| \___ /|_|\_\
# controller configuration
#

# The `v` field determines the configuration version. When software is released that changes the structure of the
# configuration, the software will expect this field to be incremented. This protects you against invalid configuration
# versions and will refer to you to the documentation when the configuration structure changes.
#
v: 4

admin:
  # The `secrets` array contains a list of strings that represent valid `ZROK_ADMIN_TOKEN` values to be used for
  # administration of the `zrok` controller.
  #
  # Change this for your installation.
  #
  secrets:
    - 77623cad-1847-4d6d-8ffe-37defc33c909

```

---

<div class="post-metadata">

**Author:** ![chiappone](https://yyz2.discourse-cdn.com/free1/user_avatar/openziti.discourse.group/chiappone/32/2740_2.png) [@chiappone](https://openziti.discourse.group/u/chiappone)\
**Post date:** [August 21, 2024, 10:13pm UTC](https://openziti.discourse.group/t/fronted-endpoint/2969/26 "2024-08-21T22:13:03Z")

</div>

Okay so I see how to get the environments and shares and can unshare using the API. With the API how do I delete an environment?

---

<div class="post-metadata">

**Author:** ![michael.quigley](https://yyz2.discourse-cdn.com/free1/user_avatar/openziti.discourse.group/michael.quigley/32/1123_2.png) [@michael.quigley](https://openziti.discourse.group/u/michael.quigley)\
**Post date:** [August 22, 2024, 12:44am UTC](https://openziti.discourse.group/t/fronted-endpoint/2969/27 "2024-08-22T00:44:33Z")

</div>

See the `/disable` endpoint.

---

<div class="post-metadata">

**Author:** ![qrkourier](https://yyz2.discourse-cdn.com/free1/user_avatar/openziti.discourse.group/qrkourier/32/52_2.png) [@qrkourier](https://openziti.discourse.group/u/qrkourier)\
**Post date:** [August 22, 2024, 2:08pm UTC](https://openziti.discourse.group/t/fronted-endpoint/2969/28 "2024-08-22T14:08:14Z")

</div>

After importing the zrok spec to Insomnia as a "request collection" I still couldn't see any body/data/payload, but when I loaded the spec as a "document" I could see in the Swagger Playground the correct body to send.

cURL example to disable a Docker share's environment which is the same as deleting the environment:

```bash
ZROK_ZITI_IDENTITY="$(jq -r '.ziti_identity' ~/.zrok/environment.json)";
curl -sSf \
-XPOST \
-H "content-type: application/zrok.v1+json" \
-H "x-token: ${ZROK_ENABLE_TOKEN}" \
-d "{\"identity\": \"${ZROK_ZITI_IDENTITY}\"}" \
"${ZROK_API_ENDPOINT}/api/v1/disable"

```

---

<div class="post-metadata">

**Author:** ![chiappone](https://yyz2.discourse-cdn.com/free1/user_avatar/openziti.discourse.group/chiappone/32/2740_2.png) [@chiappone](https://openziti.discourse.group/u/chiappone)\
**Post date:** [August 22, 2024, 2:54pm UTC](https://openziti.discourse.group/t/fronted-endpoint/2969/29 "2024-08-22T14:54:35Z")

</div>

That did the trick, thanks!

---

<div class="post-metadata">

**Author:** ![chiappone](https://yyz2.discourse-cdn.com/free1/user_avatar/openziti.discourse.group/chiappone/32/2740_2.png) [@chiappone](https://openziti.discourse.group/u/chiappone)\
**Post date:** [August 22, 2024, 8:23pm UTC](https://openziti.discourse.group/t/fronted-endpoint/2969/30 "2024-08-22T20:23:39Z")

</div>

I am getting the following on account create:

"message": "path /api/v1/account was not found"

Is this the correct path?

---

<div class="post-metadata">

**Author:** ![qrkourier](https://yyz2.discourse-cdn.com/free1/user_avatar/openziti.discourse.group/qrkourier/32/52_2.png) [@qrkourier](https://openziti.discourse.group/u/qrkourier)\
**Post date:** [August 22, 2024, 8:27pm UTC](https://openziti.discourse.group/t/fronted-endpoint/2969/31 "2024-08-22T20:27:23Z")

</div>

I'm guessing you're running a version of zrok controller that doesn't have the `/account` endpoint that was just added in v0.4.39.

```bash
curl -sSf ${ZROK_API_ENDPOINT}/api/v1/version

```

---

<div class="post-metadata">

**Author:** ![chiappone](https://yyz2.discourse-cdn.com/free1/user_avatar/openziti.discourse.group/chiappone/32/2740_2.png) [@chiappone](https://openziti.discourse.group/u/chiappone)\
**Post date:** [August 22, 2024, 8:29pm UTC](https://openziti.discourse.group/t/fronted-endpoint/2969/32 "2024-08-22T20:29:44Z")

</div>

That is correct. Thanks

[Previous page](https://openziti.discourse.group/t/fronted-endpoint/2969.md?page=1)
