W2A
Documentation engine

Authentication

How to authenticate

All requests have to be authenticated, to do that, you need to send a header with your token, let's see how to do it:

First, to generate a TOKEN.

There's a lib for nodejs here: Click here

Important Information

All our endpoints expect and returns JSONs, you can test it using a tool like Postman or Insominia.

Endpoint: [POST] https://api.whats2api.com/authentication

Headers:

  • Content-Type: application/json
  • Accept: application/json

Body:

  • email: Your user is email
  • password: Your user is password
  • strategy: local

Response

Which you will want to use 'accessToken as your token'

Important Information

Each token has a life of 1 day.

{
  "accessToken": "xxxxxxx",
  "user": {
    "_id": "xxxxxxx",
    "email": "xxxxxxx",
    "createdAt": "xxxxxxx",
    "updatedAt": "xxxxxxx"
  }
}
        

API tokens (for AI assistants / MCP)

For long-running integrations — most importantly MCP clients like Claude, Cursor and VS Code — use a long-lived API token instead of the daily JWT. Generate one in your dashboard at /p/mcp-tokens and pass it as Authorization: Bearer <token>. The token is shown only once at creation time; revoke at any time from the same page.

Full MCP guide: /docs/mcp.