# Get started with the Dashboard

Source: https://developer.nylas.com/docs/v3/getting-started/dashboard/

The [Nylas Dashboard](https://dashboard-v3.nylas.com) is a web UI for managing your applications, API keys, and connected accounts. This guide walks you through creating your first application and making an API call.

> **Info:** 
> Prefer the command line? See [Get started with the Nylas CLI](/docs/v3/getting-started/cli/) instead.


## Before you begin

Before you start, you need to have a Nylas account. If you don't have one already, you can [create one here](https://dashboard-v3.nylas.com/register?utm_source=docs&utm_content=qs-email).

## Create a Nylas application

1. Log in to the [Nylas Dashboard](https://dashboard-v3.nylas.com/login).
2. On the **All apps** page, click **Create new app**.
3. Select the **Data residency**.
> **Info:** 
> **This determines where Nylas stores your application and user data**. Be sure to select the region where your project will be active. You can't change this setting later.
4. Select the **Environment**.
5. Click **Create application**.

## Generate an API key

You'll need an API key for the last step.

1. On your application's page, click **API Keys** in the left navigation.
2. Click **Generate new key**.
3. Enter an **API key name** and select the **Expiration time**.
4. Click **Generate key**.

## Create a grant

1. On your application's page, click **Grants** in the left navigation.
2. Click **Add Account**.

You'll be prompted to enter your email address. If the authentication is successful you'll see your email address and grant ID with a valid status on the **Grants** page.


## Make your first API call

Now that you have an API key and a connected account, you can call the Nylas API. This example uses the [List messages endpoint](/docs/reference/api/messages/get-messages/) to return the five most recent messages. Replace `<NYLAS_GRANT_ID>` and `<NYLAS_API_KEY>` with your values from the previous steps.

```bash
curl --compressed --request GET \
  --url "https://api.us.nylas.com/v3/grants/<NYLAS_GRANT_ID>/messages?limit=5" \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer <NYLAS_API_KEY>' \
  --header 'Content-Type: application/json'

```

```json [dashFirstCall-Response (JSON)]

{
  "request_id": "d0c951b9-61db-4daa-ab19-cd44afeeabac",
  "data": [
    {
      "starred": false,
      "unread": true,
      "folders": ["UNREAD", "CATEGORY_PERSONAL", "INBOX"],
      "grant_id": "1",
      "date": 1706811644,
      "attachments": [
        {
          "id": "1",
          "grant_id": "1",
          "filename": "invite.ics",
          "size": 2504,
          "content_type": "text/calendar; charset=\"UTF-8\"; method=REQUEST"
        },
        {
          "id": "2",
          "grant_id": "1",
          "filename": "invite.ics",
          "size": 2504,
          "content_type": "application/ics; name=\"invite.ics\"",
          "is_inline": false,
          "content_disposition": "attachment; filename=\"invite.ics\""
        }
      ],
      "from": [
        {
          "name": "Nylas DevRel",
          "email": "nylasdev@nylas.com"
        }
      ],
      "id": "1",
      "object": "message",
      "snippet": "Send Email with Nylas APIs",
      "subject": "Learn how to Send Email with Nylas APIs",
      "thread_id": "1",
      "to": [
        {
          "name": "Nyla",
          "email": "nyla@nylas.com"
        }
      ],
      "created_at": 1706811644,
      "body": "Learn how to send emails using the Nylas APIs!"
    }
  ],
  "next_cursor": "123"
}


```

```js [dashFirstCall-Node.js SDK]

import Nylas from "nylas";

const nylas = new Nylas({
  apiKey: "<NYLAS_API_KEY>",
  apiUri: "<NYLAS_API_URI>",
});

async function fetchRecentEmails() {
  try {
    const messages = await nylas.messages.list({
      identifier: "<NYLAS_GRANT_ID>",
      queryParams: {
        limit: 5,
      },
    });

    console.log("Messages:", messages);
  } catch (error) {
    console.error("Error fetching emails:", error);
  }
}

fetchRecentEmails();


```

```python [dashFirstCall-Python SDK]

from nylas import Client

nylas = Client(
    "<NYLAS_API_KEY>",
    "<NYLAS_API_URI>"
)

grant_id = "<NYLAS_GRANT_ID>"

messages = nylas.messages.list(
  grant_id,
  query_params={
    "limit": 5
  }
)

print(messages)

```

```ruby [dashFirstCall-Ruby SDK]
require 'nylas'

nylas = Nylas::Client.new(api_key: '<NYLAS_API_KEY>')
query_params = { limit: 5 }
messages, _ = nylas.messages.list(identifier: '<NYLAS_GRANT_ID>', query_params: query_params)

messages.each {|message|
  puts "[#{Time.at(message[:date]).strftime("%d/%m/%Y at %H:%M:%S")}] \
      #{message[:subject]}"
}
```

```java [dashFirstCall-Java SDK]


public class ReadInbox {
  public static void main(String[] args) throws NylasSdkTimeoutError, NylasApiError {
    NylasClient nylas = new NylasClient.Builder("<NYLAS_API_KEY>").build();
    ListMessagesQueryParams queryParams = new ListMessagesQueryParams.Builder().limit(5).build();
    ListResponse<Message> message = nylas.messages().list("<NYLAS_GRANT_ID>", queryParams);

    for(Message email : message.getData()) {
      String date = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").
          format(new java.util.Date((email.getDate() * 1000L)));

      System.out.println("[" + date + "] | " + email.getSubject());
    }
  }
}
```

```kt [dashFirstCall-Kotlin SDK]


fun dateFormatter(milliseconds: String): String {
  return SimpleDateFormat("dd/MM/yyyy HH:mm:ss").format(Date(milliseconds.toLong() * 1000)).toString()
}

fun main(args: Array<String>) {
  val nylas: NylasClient = NylasClient(apiKey = "<NYLAS_API_KEY>")
  val queryParams = ListMessagesQueryParams(limit = 5, inFolder = listOf("Inbox"))
  val messages : List<Message> = nylas.messages().list("<NYLAS_GRANT_ID>", queryParams).data

  for(message in messages) {
    println("[" + dateFormatter(message.date.toString()) + "] |" + message.subject + " | " + message.folders)
  }
}
```

## What's next

- **[Email quickstart](/docs/v3/getting-started/email/)** -- send your first email
- **[Calendar quickstart](/docs/v3/getting-started/calendar/)** -- create your first event
- **[Authentication](/docs/v3/auth/)** -- set up OAuth for your users
- **[API reference](/docs/reference/api/)** -- full endpoint documentation