---
title: Authentication
slug: api/authentication
description: Find out how to get authenticated for Marco API.
docTags: 
createdAt: 2023-11-16T10:29:33.275Z
---

The Marco API uses an authentication token `auth_token` for authentication. The `auth_token` must be included in the Authorization header for all API requests.

You can retrieve your `auth_token` from the `POST /api/auth/login` endpoint.

# Retrieve auth\_token

:::hint{type="success"}
<font color="#3b9f0f">**POST**</font>**&#x20;/api/auth/login**
:::

Retrieve your API `auth_token` using your Marco account email and password.

The `auth_token` is valid for only 30 days. Once the token expires, you will need to call this API endpoint again. The token can be stored in an environment variable, which can be used in all API requests.

&#x20;

**Request**

***

<font color="#00a2e9">**Body parameters**</font>

***

::::VerticalSplit{layout="left"}
:::VerticalSplitItem
**email** <font color="#a7b4c3">string Required</font>
:::

:::VerticalSplitItem
Your Marco account email.
:::
::::

***

::::VerticalSplit{layout="left"}
:::VerticalSplitItem
**password** <font color="#a7b4c3">string Required</font>
:::

:::VerticalSplitItem
Your Marco account password.
:::
::::

***



**Example Requests**

***

::::CodeDrawer{title="Example" isResponseExpanded="true"}
:::CodeblockTabsExamples
```curl
curl -X POST 'https://api.marcopayroll.com/api:benKoCK8/api/auth/login' \
-H 'Content-Type: application/json' \
-d '{
  "email": "YOUR_EMAIL",
  "password": "YOUR_PASSWORD"
}'
```
:::

:::CodeblockTabsResponses
```javascript
{
  "auth_token": "$AUTH_TOKEN"
}
```
:::
::::



**Response (200)**

***

::::VerticalSplit{layout="left"}
:::VerticalSplitItem
**auth\_token** <font color="#a7b4c3">string</font>
:::

:::VerticalSplitItem
Your Marco API authentication token.
:::
::::

***

