# Creating an API Token

> Create API tokens for the private NuGet feed by assigning a serial number in Manage Products or manually, and manage their validity of 365 or up to 730 days.

- **Product:** TX Text Control .NET Server
- **Section:** Documentation
- **Kind:** Topic
- **Path:** TX Text Control .NET Server > Installation Guide > NuGet Packages > Text Control Private NuGet Feed > Creating an API Token
- **1273 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/installation/nuget/private-feed/api-token/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/installation/nuget/private-feed/api-token/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/installation/nuget/private-feed/api-token/llms-full.txt

---

NuGet authenticates against the Text Control Private NuGet Feed with a developer's email address and an API token. Account holders create these tokens when they give developers access, and developers can look up where their credentials come from. A token is created in one of two ways: automatically, by assigning a serial number, or manually.

### Before You Begin

- You need access to the Text Control account that holds the licenses, with at least one NuGet-eligible serial number.
- Every API token belongs to one developer's email address. Only email addresses that you have used to assign serial numbers appear when you create a token manually.

### Create a Token by Assigning a Serial Number

The easiest way to get developers started is to assign a serial number to them. When you assign a NuGet-eligible serial number to a developer, an API token is generated automatically and sent to the developer's email address.

1. In your account, navigate to **Manage Products**.
2. Click **Manage** > **Assign** next to the serial number you want to assign.
3. Enter the developer's email address.
4. Click **Assign** to complete the assignment.
5. The developer receives an email that contains both the serial number assignment and a download link for their personalized NuGet configuration file.

No further steps are required. The developer receives everything they need in this email.

#### Reassigning and Unassigning Serial Numbers

- **Reassigning** a serial number to the same or a different developer follows the same process. If the developer already has a valid token, its expiry is extended. If the token has expired or does not exist, a new one is created.
- **Unassigning** a serial number checks whether the developer has any other NuGet-eligible serial numbers assigned. If not, the developer's API token is deleted.

### Create a Token Manually

Create a token manually if you need more control over the token name or the expiry date, or if you want to create a token for a developer who already has assigned serial numbers.

1. In your account, navigate to **Manage API tokens**.
2. Click **Create token**.
3. Enter a name for the API token. To use a random name, click **Generate**.
4. Enter the number of days for which the API token is valid. The minimum is 1 day and the maximum is 730 days (2 years).
5. Select the email address of the developer for whom you want to issue the token.
6. Click **Create token** again.
7. An API token and a corresponding NuGet configuration file are generated. The file contains sensitive credentials and is not displayed. A download link is sent to the developer by email. The confirmation screen shows the token name and the token prefix for your reference.
8. Click **Proceed** to return to the API token management screen.

### What the Developer Receives

The developer receives an email with a download link for a personalized `nuget.config` file. With automatic token creation, this is the email about the serial number assignment; its subject line starts with "Your Serial Number, Installation File, and NuGet File for".

Together, the email and the downloaded `nuget.config` file give the developer the three values that NuGet needs:

| Value | Description |
|---|---|
| Feed URL | `https://www.textcontrol.com/nuget/v3/index.json` |
| Email address | The email address the serial number is assigned to, used as the user name |
| API token | The token, used as the password. Tokens start with `ngt_`. |

The developer copies the file to the project, as described in [nuget.config](https://docs.textcontrol.com/tx-text-control-dotnet-server/installation/nuget/private-feed/nuget-config/llms-full.txt). If a developer cannot find the email, they contact the account holder or Text Control support.

### Token Validity

| How the token was created | Validity |
|---|---|
| Automatically, by assigning a serial number | 365 days. The expiry is extended each time you assign or reassign a serial number to the developer. |
| Manually, in **Manage API tokens** | The number of days you enter, from 1 to 730 days |

When a developer's token has expired, reassigning a serial number to the developer creates a new token. You can also create a new token manually. **Manage API tokens** shows the expiration date of every token.

A token that is used on a build server authenticates the same way. See [CI/CD Authentication](https://docs.textcontrol.com/tx-text-control-dotnet-server/installation/nuget/private-feed/ci-cd/llms-full.txt) for storing it as a secret.

### Manage Tokens

- **Manage Products** marks every email address that has a NuGet API token with the NuGet logo. Clicking the logo opens the **Manage API tokens** page.
- **Manage API tokens** lists all tokens you have created. There you can view token details, check expiration dates and delete tokens that are no longer needed.
- Unassigning a serial number deletes the developer's token automatically when the developer has no other NuGet-eligible serial number, as described above.

![The Manage Products page of a Text Control account: each serial number of a subscription is listed with the email address it is assigned to, a Manage button, and the NuGet logo next to the addresses that have an API token.](https://docs.textcontrol.com/assets/img/tx-text-control-dotnet-server/manage-products-nuget-logo.2bb43b32.webp)

![The API Tokens page of a Text Control account: a table of NuGet tokens with token name, token prefix starting with ngt_, email address, creation time, expiry and a Delete button, and a Create token button below it.](https://docs.textcontrol.com/assets/img/tx-text-control-dotnet-server/manage-api-tokens.0dd8450c.webp)

Treat an API token like a password. If a token or a `nuget.config` file that contains it was shared by mistake, delete the token in **Manage API tokens** and create a new one.

### Next Steps

- [nuget.config](https://docs.textcontrol.com/tx-text-control-dotnet-server/installation/nuget/private-feed/nuget-config/llms-full.txt) — what the downloaded file contains and where to put it.
- [Visual Studio](https://docs.textcontrol.com/tx-text-control-dotnet-server/installation/nuget/private-feed/visual-studio/llms-full.txt) — install packages with the NuGet Package Manager.
- [.NET CLI](https://docs.textcontrol.com/tx-text-control-dotnet-server/installation/nuget/private-feed/dotnet-cli/llms-full.txt) — install packages from the command line.
- [Development Licenses](https://docs.textcontrol.com/tx-text-control-dotnet-server/installation/licensing/development/llms-full.txt) — how developer licenses are assigned.

---

## Nearby

- **Previous:** [Text Control Private NuGet Feed](https://docs.textcontrol.com/tx-text-control-dotnet-server/installation/nuget/private-feed/llms-full.txt)
- **Next:** [nuget.config](https://docs.textcontrol.com/tx-text-control-dotnet-server/installation/nuget/private-feed/nuget-config/llms-full.txt)
