# Is there way to create/generate api token?

**URL:** <https://forum.inductiveautomation.com/t/is-there-way-to-create-generate-api-token/109761>\
**Category:** Ignition 8.3 Early Access\
**Tags:** ignition83\
**Created:** [August 14, 2025, 9:28am UTC](https://forum.inductiveautomation.com/t/is-there-way-to-create-generate-api-token/109761 "2025-08-14T09:28:00Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![raj.burnwal](https://avatars.discourse-cdn.com/v4/letter/r/51bf81/32.png) [@raj.burnwal](https://forum.inductiveautomation.com/u/raj.burnwal)\
**Post date:** [August 14, 2025, 9:28am UTC](https://forum.inductiveautomation.com/t/is-there-way-to-create-generate-api-token/109761/1 "2025-08-14T09:28:00Z")

</div>

Hi, Is there a way to generate api token from rest api? I need to automate db connection setup after generating api key. I have portal setup and got username and password but not able to find curl request to login using username and password. Though I see generateToken and CreateToken in openapi doc but seems its there for additional API Token.

You can see api’s in screenshot attached.

 ![Screenshot 2025-08-14 at 2.56.28 PM](https://us1.discourse-cdn.com/inductiveautomation/original/3X/9/3/936ab4af6bf79126d045e6e7a4b3116d2f483715.jpeg)

 ![Screenshot 2025-08-14 at 2.56.43 PM](https://us1.discourse-cdn.com/inductiveautomation/original/3X/e/d/ed561d92844ccd3f9a1a5376c1ec567b31744155.jpeg)

---

<div class="post-metadata">

**Author:** ![David\_Stone](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/david_stone/32/79749_2.png) [@David\_Stone](https://forum.inductiveautomation.com/u/David_Stone)\
**Post date:** [August 14, 2025, 9:45am UTC](https://forum.inductiveautomation.com/t/is-there-way-to-create-generate-api-token/109761/2 "2025-08-14T09:45:53Z")

</div>

You have tagged this Ignition 8.1, the API is part of 8.3, there will be no tokens generated for 8.1

---

<div class="post-metadata">

**Author:** ![raj.burnwal](https://avatars.discourse-cdn.com/v4/letter/r/51bf81/32.png) [@raj.burnwal](https://forum.inductiveautomation.com/u/raj.burnwal)\
**Post date:** [August 14, 2025, 10:00am UTC](https://forum.inductiveautomation.com/t/is-there-way-to-create-generate-api-token/109761/3 "2025-08-14T10:00:13Z")

</div>

Hey David, I have updated the tag for 8.3. I didn’t find the existing tag so created new. Are you aware of the API with user creds?

---

<div class="post-metadata">

**Author:** ![Sfenwick](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/sfenwick/32/82355_2.png) [@Sfenwick](https://forum.inductiveautomation.com/u/Sfenwick)\
**Post date:** [August 14, 2025, 3:00pm UTC](https://forum.inductiveautomation.com/t/is-there-way-to-create-generate-api-token/109761/4 "2025-08-14T15:00:29Z")

</div>

This may be of some help if you’ve not seen it yet

> [@Ignition 8.3 API Usage Guide (via Postman)](https://forum.inductiveautomation.com/t/ignition-8-3-api-usage-guide-via-postman/93935):
>
> Ignition 8.3 API Usage Guide (via Postman) Last revision - 7/30/2025 Ignition 8.3 OpenAPI Documentation Login via - [http://localhost:8088/data/app/login](http://localhost:8088/data/app/login) Access OpenAPI docs - [http://localhost:8088/openapi](http://localhost:8088/openapi)Postman Setup and Importing Configuration Clone the 83-api GitHub resources from this repository: [inductiveautomation/83-api](https://github.com/inductiveautomation/83-api) Import the Collection config file (8.3.postman\_collection\_v2.json) from the downloaded repository. This contains the config for all of the base …

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [August 14, 2025, 3:41pm UTC](https://forum.inductiveautomation.com/t/is-there-way-to-create-generate-api-token/109761/5 "2025-08-14T15:41:35Z")

</div>

> [@raj.burnwal](#):
>
> I need to automate db connection setup after generating api key.

If you want to 'preconfigure' a gateway with an API key, you can store one in the `external` resource collection, as mentioned in the post @Sfenwick linked:

> [@Ignition 8.3 API Usage Guide (via Postman)](https://forum.inductiveautomation.com/t/ignition-8-3-api-usage-guide-via-postman/93935/1):
>
> #### Some Important Notes
> 
> - \*\ ***Protip** : Copy the generated token resource files from `data/config/CORE/ignition/api-token` into `data/config/EXTERNAL/ignition/api-token` which sits at a higher inheritance level than core as resources in core may be deleted at will during testing and development 🙂 (ie. see the "Retriggering Migration" section down below).
> - **A gateway restart is required after this since resource files have been affected directly on the filesystem** (or alternatively run the _Config Sync Request_ route) so that the system will pick up the new resource changes on the filesystem.
> - Any gateway config resource that is edited directly on the filesystem does not automatically picked up unless the _Config Sync Request_ route is called which prompts the gateway to sync changes immediately.

Note that this same principle can be applied a layer higher. If you want to preconfigure a gateway connection - you can do the exact same thing (move a configured resource to the `external` collection) but with your configured DB connection.

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [August 14, 2025, 3:44pm UTC](https://forum.inductiveautomation.com/t/is-there-way-to-create-generate-api-token/109761/6 "2025-08-14T15:44:56Z")

</div>

You’ll want to POST against `/data/api/v1/api-token/generate`. This will return an object which contains a `key` and `hash`.

```python
{
    "key": "ABC",
    "hash": "DEF"
}

```

You’ll then need to POST against `/data/api/v1/resources/ignition/api-token`, and include the `hash` from the previous request within the `config.settings` object.

```python
{
    "name": "MyNewAPIKey",
    "collection": "core",
    "enabled": true,
    "description": "",
    "config": {
        "profile": {
            "type": "basic-token",
            "secureChannelRequired": false,
            "securityLevels": [
                {
                    "name": "Authenticated",
                    "description": "Represents a user who has been authenticated by the system.",
                    "children": []
                }
            ],
            "timestamp": 1755186044603
        },
        "settings": {
            "tokenHash": "DEF"
        }
    }
}

```

---

<div class="post-metadata">

**Author:** ![Rob\_Denny](https://avatars.discourse-cdn.com/v4/letter/r/f1d935/32.png) [@Rob\_Denny](https://forum.inductiveautomation.com/u/Rob_Denny)\
**Post date:** [December 21, 2025, 5:53pm UTC](https://forum.inductiveautomation.com/t/is-there-way-to-create-generate-api-token/109761/7 "2025-12-21T17:53:16Z")

</div>

> [@raj.burnwal](#):
>
> curl request to login using username and password

but the ask here was to “curl request to login using username and password”, you cant connect to the endpoint “/data/api/v1/api-token/generate” unless you have an auth token, it wont accept username and password?

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [December 29, 2025, 4:12pm UTC](https://forum.inductiveautomation.com/t/is-there-way-to-create-generate-api-token/109761/8 "2025-12-29T16:12:54Z")

</div>

No, the 8.3 API does not accept a username:password combination. The solution posted here assumes you have already created an API Key with Write permissions, and are using that API Key to automate creation of further API Keys.
