API: Refresh Token

Request

This is a POST request to refresh the token for the authenticated user. You must be authenticated to call this endpoint.

POST /api/refresh-token

Sample Response:


{
  "status": "success",
  "code": 200,
  "message": "Token refreshed successfully",
  "data": {
    "token" : "your_new_jwt_token_here"
  }
}
                

Response Explanation:

  • status: The status of the request. "error" indicates the user is not authenticated.
  • code: The HTTP status code. Here it's `401`, indicating that the request is unauthorized.
  • message: A message explaining why the request failed (in this case, due to unauthenticated access).
  • data: A description providing additional details on why the request was unsuccessful (in this case, the user needs to be logged in).

Notes:

  • You must be logged in to access this endpoint. If you're not authenticated, you will receive a `401 Unauthorized` response.
  • The refresh token action refreshes the user's new token.