Skip to main content

Authenticate management operations

Creating and managing Landing Pages and Assets requires an account. Signing in returns an access token and a refresh token. Send the access token in the Authorization header as Bearer <token>. Every endpoint starts from https://api.lpdata.io. Do not store tokens in public source code or share them.

Where to call authenticated routes

Call the authentication, Landing Page, and Asset routes from a server: your backend, scripts, other APIs, or tools such as curl. From the browser, these routes only accept calls from the LPData dashboard; the browser blocks the same call made by JavaScript on other sites. Public content reads are the exception: they accept browser calls from any origin.

Create an account

POST /auth/sign_up accepts account details inside user:
A successful signup returns 201 Created and the tokens:

Sign in

POST /auth/sign_in uses user.email and user.password:
Invalid credentials return 401 Unauthorized:

Get the authenticated account

GET /auth/me returns the identity associated with the access token:
Without a valid token, the endpoint returns 401 Unauthorized.

Refresh tokens

Send the refresh token in the body of POST /auth/refresh. The response contains the user and a new pair of tokens; the previous refresh token is invalidated and must not be reused.
An invalid or expired token returns 401 Unauthorized with Invalid or expired refresh token.

Sign out

DELETE /auth/sign_out revokes the refresh token in the body and ends the session. The access token in the header is optional but recommended: when sent, it is revoked immediately; without it, it stays valid until it expires, for at most 2 hours. An already expired access token does not block signing out. On success, it returns 204 No Content. An invalid or expired refresh token returns 401 Unauthorized.
Use the new token pair after a refresh and discard revoked tokens after signing out.