# One-Time Code

To invite Your Customer to the [Onboarding Flow](/onboarding-flow/onboarding-flow.md) securely, you must generate a One-Time Code (OTC). You generate this secure, single-use code when inviting them; once it is used, it becomes invalid. Include the OTC in the Onboarding Flow URL—see [URL and parameters](/onboarding-flow/url-and-parameters.md) for the full URL format.

### Generating an OTC

Call the Consent API to generate an OTC; the response contains the One-Time Code. Use it in the [Onboarding Flow URL](/onboarding-flow/url-and-parameters.md) when embedding the flow, redirecting Your Customer, or building a direct link.

### URL encoding

The One-Time Code is not URL-encoded in the API response. **You must URL-encode it before including it in the Onboarding Flow URL.**

### Validity

A One-Time Code is **valid for one hour** from its creation. Use it by embedding the Onboarding Flow in Your Platform or by redirecting Your Customer to the flow from Your Platform. Avoid sharing the link via channels that generate link previews (e.g. email, Slack)—**the OTC is invalidated once it is consumed**, and previews can consume it so the link no longer works.

{% hint style="warning" %}
**OTC validity**

A One-Time Code is **valid for one hour** from its creation and is **single-use** (invalidated once consumed).
{% endhint %}


---

# 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.zwapgrid.com/onboarding-flow/one-time-code.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.
