# App token lifecycle management

In this document, we are going to understand the whereabouts of the App token Generation and its lifecycle management.

App token is used to authenticate the API requests coming from the client side. It can be easily generated using the App Token generation [API](https://isac.happay.in/v2/docs#authentication). Once this has been generated it needs to be passed in the HTTP headers of all the API requests being made.

The App token stays valid for 25 Hours from its generation and post this time frame we need to regenerate it for security purposes.

In case the APP token has expired or is not right then you get the below message in the API response.

**401 unauthorized:**

<figure><img src="https://115903560-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fcj7RLAvlKFfNpzSRDFeK%2Fuploads%2FthhysGshQuN67Ixrc4Tf%2Fimage.png?alt=media&#x26;token=09a6bb8f-f7f2-40a6-98a5-71ad05abd03e" alt=""><figcaption><p><br></p></figcaption></figure>

Hence it is suggested to regenerate the APP token in case this error is encountered while making the API calls.

we request you to build a logic where in case the 401 error occurs during any operation the app token is generated directly during the same process, and then the further transaction can proceed further once the app token has been updated without interrupting the user operation sequence.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.isac.vatechventures.in/app-token-lifecycle-management.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
