JWT Session

A session contains a token, which is a JSON Web Token. The token is created with a user's signin credentials.

This token can be used to authenticate to the API. In addition, the session can be set to expire at a particular time. Use the token to then authenticate for further requests to the Rebilly API.

The token should be kept private, but could be stored on the user's browser client to simulate a "session".

Destroys the user's current session

Destroys the user's current session. Endpoint must be accessed with valid. JWT Authorization header.

Request
Security:
Responses
204

Session was deleted.

401

Unauthorized access, invalid credentials were used.

403

Access forbidden.

post/logout
Request samples
const logout = await api.account.logout();

// the request does not return any fields but
// you can confirm the success using the status code
console.log(logout.response.status); // 204
Response samples
application/json
{
  • "status": 400,
  • "title": "string",
  • "detail": "string",
  • "error": "string"
}

Create a session with email and password

Create a session with email and password.

Request
Request Body schema: application/json

Signin resource.

email
required
string

Email.

password
required
string <password>

Password.

oneTimePassword
string^[0-9]{6}$

One time password for 2 factor authentication. Should contain digits only.

expiredTime
string <date-time>

Session expired time. Defaults to one hour.

Responses
201

Session was created.

401

Unauthorized access, invalid credentials were used.

403

Access forbidden.

422

Invalid data was sent.

post/signin
Request samples
application/json
{
  • "email": "email@example.com",
  • "password": "pa$$word",
  • "oneTimePassword": "123456",
  • "expiredTime": "2019-08-24T14:15:22Z"
}
Response samples
application/json
{
  • "id": "4f6cf35x-2c4y-483z-a0a9-158621f77a21",
  • "token": "string",
  • "permissions": [
    ],
  • "memberships": [
    ],
  • "userId": "4f6cf35x-2c4y-483z-a0a9-158621f77a21",
  • "createdTime": "2019-08-24T14:15:22Z",
  • "updatedTime": "2019-08-24T14:15:22Z",
  • "expiredTime": "2019-08-24T14:15:22Z",
  • "_links": [
    ]
}