> For the complete documentation index, see [llms.txt](https://the-nlapi.gitbook.io/the-nlapi-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://the-nlapi.gitbook.io/the-nlapi-docs/portal.md).

# Portal

Currently, our 'portal' is just an API, but a UI to show your customers' queries, time to response, most popular routes, and more is coming. Checkout nlapi.io to see the latest.

> **Note:** In order to interact with the portal (aside from logging in and signing up) you will need to be properly authenticated. For more information on authentication, please refer to our [Authentication Documentation](/the-nlapi-docs/authentication.md).

For now the portal is used strictly to create new applications (tenants) and api-keys. Once you have your api-key, you can start using the NLAPI!

## Getting Started

### 1. Login / Signup

To create a new developer account, use the `/portal/signup` post route.\
To login with an account that already exists use the `/portal/login` post route (Payload and response is the same as the signup route)\
Example Payload:

```json
{
  "name": "Dwigt Shrute", // Optional if absent, your email will be used as your name
  "email": "dwight@dundermifflin.com",
  "password": "you'vebeenmeatballed"
}
```

Example Response:

```json
{
  "message": "string",
  "access_token": "string",
  "refresh_token": "string"
}
```

Make sure to save the access token as you'll use it for authentication throughout the use of the portal.

> **Please note:** The access token is for use with the portal and is NOT the same as your nlapi-key, which you'll use to authenticate yourself with the [NLAPI routes](https://api.nlapi.io/docs#/NLAPI).

### 2. Create New Application

Now that you have a developer account, you need to create an application so you can save your schema (Or in the case you are using a Devii account you need to tell us what tenants you are using)

To create an application, make a post request to: `/portal/applications`

Example Headers:

```json
{
  "Authorization" : "Bearer [your-access-token]"
}
```

Example Payload for OpenAPI Users:

```json
{
    "name" : "My Awesome App!",
    "api_url" : "https://api.your-api-url.com",
    "api_type" : "openapi",
    "developer_id" : 1234 // Your developer Id {returned from login/signup}
}
```

Example Payload for Devii Users:

```json
{
    "name" : "My Awesome Devii App!",
    "api_url" : "https://api.your-api-url.com",  // Optional: Defaults to https://api.devii.io
    "tenant_id" : 1234, // Needs to be the same as your Devii tenantid
    "api_type" : "devii",
    "developer_id" : 1234 // Your developer Id {returned from login/signup}
}
```

Example Success (200) Response:

```json
{
  "id": 59, // Save this
  "api_url": "https://example.com/",
  "name": "string",
  "project_description": null,
  "approved": null,
  "created_at": null,
  "updated_at": null,
  "tier": 1,
  "api_type": "openapi",
  "api_keys_collection": null,
  "tenant_id": "d2c4cc25-c560-4709-ab85-89a7ce1cf57c", // generated uuid or devii tenant id
  "schemas_collection": null
}
```

### 3. Create New API-Key

Creating an api key will allow you to send requests to the `/nlapi` endpoint. You will add this key to the `nlapi-key` header in all your requests. Eventually we will add usage tracking so you can track what api key is sending the most requests.

To create a new api key, send a post request to `/portal/api-keys` where `application_id` is the id of the application for which you would like to create an api key. You will need to pass your access token via the Authorization Header. `{ 'Authorization': 'Bearer [your-access-token]'}` Payload:

```json
{
  "application_id" : id
}
```

Example 200 Response:

```json
{
  "api_key": "String"
}
```

### Next Steps

For more information on authentication, please refer to our [Authentication Documentation](/the-nlapi-docs/authentication.md).

It's time to implement! Visit our [Documentation](/the-nlapi-docs/documentation.md) to get started.

If you've implemented, Check out our Training Documentation to get the best performance. [Training NLAPI](/the-nlapi-docs/training_nlapi.md)

## Additional Documentation

Addtional documentation for the portal is available at <https://api.nlapi.io/docs>.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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://the-nlapi.gitbook.io/the-nlapi-docs/portal.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.
