Skip to main content
POST
/
v1
/
auth
/
tokens
Create a new access token
curl --request POST \
  --url https://nextvisit.app/api/v1/auth/tokens \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "email": "[email protected]",
  "password": "securepassword123",
  "device_name": "iPhone 14 Pro"
}
'
{
  "status": "success",
  "token": "nv-sk-2|4qrD6iCn5FYhHyrdVX1IE4kk6RWg091WpboNklOC",
  "token_id": 123,
  "user": {
    "id": 1,
    "name": "John Doe",
    "current_team_id": 5,
    "email": "[email protected]"
  },
  "team": {
    "id": 5,
    "name": "Medical Practice"
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
email
string<email>
required

User's email address

password
string<password>
required

User's password

Example:

"secureP@ssw0rd!"

device_name
string
required

Name of the device requesting the token

Example:

"iPhone 14 Pro"

Response

Token successfully created

status
string
required

Status of the token request

Example:

"success"

token
string
required

Authentication token value

Example:

"nv-sk-2|4qrD6iCn5FYhHyrdVX1IE4kk6RWg091WpboNklOC"

token_id
integer
required

Unique identifier for the token

Example:

123

user
object
required

Basic information about the authenticated user

team
object
required

Basic information about the user's current team