Generating an authentication token

Let's start by generating an Authorization Bearer token to use with subsequent endpoints.

Before calling other endpoints, you need to generate an Authorization Bearer token. To retrieve your token, simply send your account credentials as body parameters.

This works just like logging into the Personr platform, but instead of being redirected to your dashboard, you will receive a token that allows you to authenticate and call other endpoints.

This token has a lifetime of 1 year, and is invalidated whenever a new token is generated.

The token is attached to the user credentials it was created with and as such it is recommended to create a service account for applications and use those credentials for token generation.


Generate a bearer token

POST /api-token-generate

Generate a token for use with other endpoints.

Header

Name
Value

Content-Type

multipart/form-data

Body

Name
Type
Description

email

string

The email you use to login to the Personr account

password

string

The password you use to login to the Personr account

Request

curl --location 'https://enterprise.personr.co/api/1.1/wf/api-token-generate' \
--form 'email="[email protected]"' \
--form 'password="example123"'

Response

{
  "status": "success",
  "response": {
    "token": "bus|4242424242424x424242424242424242|4343434343434x434343434343434343",
    "user_id": "4242424242424x424242424242424242",
    "expires": 31536000
  }
}

In the response, you'll receive:

  • The bearer token

  • The unique user id

  • The expiration time of your token, expressed in seconds.

Remember to include your token in the header of every subsequent API call, in the format Authorization: Bearer YOUR_TOKEN

Don't forget to set up a workflow to renew your token before it expires.

Last updated

Was this helpful?