API7 Docs
API7 GatewayAPI7 Enterprise Admin APIsList all tokens

List all tokens

GET /api/tokens

GET /api/tokens

Interactive request editor loads with JavaScript.

Authorization

X-API-KEY<token>

In: header

Query Parameters

order_by?string

Index to order the tokens by.

Default"created_at"

Value in

  • "created_at"
  • "updated_at"
  • "expires_at"
direction?string

Order to list the resources by. The sorting index follows the configuration of order_by.

Default"desc"

Value in

  • "asc"
  • "desc"
page_size?integer

Number of resources listed per page. Used together with page. For example, when there are 13 resources in total, if the query parameters are page=1&page_size=10, the GET response will show the route total as 13 and display 10 resources in the first page. If the query parameters are page=2&page_size=10, the GET response will show the route total as 13 and display 3 resources in the second page.

Formatint32
Range1 <= value
page?integer

Page number of the listed resources. Used together with page_size. For example, when there are 13 resources in total, if the query parameters are page=1&page_size=10, the GET response will show the route total as 13 and display 10 resources in the first page. If the query parameters are page=2&page_size=10, the GET response will show the route total as 13 and display 3 resources in the second page.

Formatint32
Range1 <= value
search?string

Condition to search resources by.

Response Body

application/json

application/json

curl -X GET "$API_BASE_URL/api/tokens?search=version%253Dv2"

Successfully retrieved the paginated list of access tokens.

{
  "total": 1,
  "list": [
    {
      "id": "bd58fce2-b6cc-4d2d-a53c-6ce11b19c101",
      "name": "test-token",
      "created_at": 1742288232,
      "updated_at": 1742288235,
      "expires_at": 1752288235,
      "user_id": "b32e678e-7f6b-4a50-b113-550621ed4c01",
      "org_id": "bc1b95c9-b348-4832-acc3-e257d2342df1",
      "user_name": "test-user",
      "last_used_at": 1742288235
    }
  ]
}
Complete operation details and schema variants

GET /api/tokens

List all tokens

List API access tokens created for programmatic dashboard API access, with pagination, ordering, and search filters.

Parameters

  • order_by (query, string, optional): Index to order the tokens by.
  • direction (query, string, optional): Order to list the resources by. The sorting index follows the configuration of order_by.
  • page_size (query, integer, optional): Number of resources listed per page. Used together with page. For example, when there are 13 resources in total, if the query parameters are page=1&page_size=10, the GET response will show the route total as 13 and display 10 resources in the first page. If the query parameters are page=2&page_size=10, the GET response will show the route total as 13 and display 3 resources in the second page.
  • page (query, integer, optional): Page number of the listed resources. Used together with page_size. For example, when there are 13 resources in total, if the query parameters are page=1&page_size=10, the GET response will show the route total as 13 and display 10 resources in the first page. If the query parameters are page=2&page_size=10, the GET response will show the route total as 13 and display 3 resources in the second page.
  • search (query, string, optional): Condition to search resources by.

Responses

  • 200: Successfully retrieved the paginated list of access tokens.
  • allOf variant 1
  • list (array, optional): An array of resources.
  • total (integer, optional): Total number of objects.
  • allOf variant 2
  • list (array, optional): An array of tokens.
  • allOf variant 1
  • list[].id (string, optional): The token ID.
  • list[].name (string, optional): The token name.
  • list[].created_at (integer, optional): The time when a token is created.
  • list[].updated_at (integer, optional): The time when a token is updated.
  • list[].expires_at (integer, optional): The expiration timestamp of the token. 0 means the token will not expire.
  • list[].user_id (string, optional): The user ID.
  • list[].org_id (string, optional): The organization ID.
  • allOf variant 2
  • list[].user_name (string, optional): The user name.
  • list[].last_used_at (integer, optional): The last time when the token is used.
  • 400: Bad Request — The request was malformed or contained invalid parameters. Check the error_msg field for details.
  • value (object, optional): The specific resource.
  • error_msg (string, optional): The error message.

cURL

curl -X GET '$API_BASE_URL/api/tokens'