---
title: "Create WHM API token"
method: GET
path: "/api_token_create"
tags: ["Authentication", "API Token Management"]
---

# Create WHM API token

`GET /api_token_create`

This function creates an API token. You can use API tokens instead of a password
or access hash key to execute WHM API 1 functions over HTTPS. For more information
about API tokens, read our
[Manage API Tokens in WHM](https://docs.cpanel.net/whm/development/manage-api-tokens-in-whm/)
documentation.

**Important:**

You **must** call this function over an SSL connection.

## Query parameters

- `token_name` string, required
- `acl` string
- `expires_at` integer
- `whitelist_ip` union
  - string, ipv4
  - string, ipv6
  - string, cidr

## Response `200`

HTTP Request was successful.

- object
  - `data` object
    - `acls` string[] — An array of privileges that the token possesses.
    - `create_time` integer — The API token's creation time, in Unix time format.
    - `expires_at` integer, nullable — The API token's expiration time. * A valid timestamp, in Unix time format. * A `null` value.
    - `name` string — The new API token's name. **Note:** Use this value to revoke an API token with WHM API 1's `api_token_revoke` function.
    - `token` string — The new API token to use to authenticate to WHM. **Warning:** Make **certain** that you save your API token in a safe location. You **cannot** access the token again after you use this function.
    - `whitelist_ips` union[], nullable — List of remote IP or CIDR IP ranges this token may be used from.
      - union
        - string, ipv4
        - string, ipv6
        - string, cidr
  - `metadata` object
    - `command` string — The method name called.
    - `reason` string — The reason the API function failed when the `metadata.result` field is `0`. This field may display a success message when a function succeeds.
    - `result` 0 | 1 — * `1` — Success. * `0` — Failed. Check the `reason` field for more details.
    - `version` integer — The version of the API function.

---

[API](https://skmtc.net/cpanel/apis/whm-api.md) · [All operations](https://skmtc.net/cpanel/apis/whm-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/cpanel/whm-api/revisions/3da41671c02c/schema)
