Skip to main content
POST
/
:projectId
/
auth
/
request-new-access-token
Request New Access Token
curl --request POST \
  --url https://api.replyke.com/api/v6/:projectId/auth/request-new-access-token \
  --header 'Content-Type: application/json' \
  --data '{
  "refreshToken": "<string>"
}'
{
  "success": true,
  "accessToken": "<string>",
  "user": {
    "id": "<string>",
    "email": "<string>",
    "username": "<string>",
    "name": "<string>",
    "avatar": "<string>",
    "bio": "<string>",
    "location": {
      "type": "<string>",
      "coordinates": [
        123
      ]
    },
    "birthdate": "<string>",
    "metadata": {},
    "suspensions": [
      {}
    ],
    "reputation": 123,
    "createdAt": "<string>",
    "updatedAt": "<string>"
  }
}
Request a new access token using a valid refresh token. The refresh token can be sent in the request body or as an HttpOnly cookie.

Headers

Can include replyke-refresh-jwt cookie with the refresh token

Body Parameters

refreshToken
string
JWT refresh token (optional if provided via cookie). Cookie takes precedence if both are provided.

Response

success
boolean
Indicates whether the token refresh was successful
accessToken
string
New JWT access token (null if no refresh token provided)
user
User Object
Current user object (null if no refresh token provided)

Error Responses

{
  "error": "Invalid refresh token.",
  "code": "auth/invalid-refresh-token"
}
{
  "error": "Refresh token not recognized.",
  "code": "auth/refresh-token-mismatch"
}
{
  "error": "User not found.",
  "code": "auth/no-user-found"
}
{
  "error": "Invalid or expired refresh token.",
  "code": "auth/refresh-token-invalid",
  "details": "<Error message>"
}

Notes

  • The replyke-refresh-jwt cookie takes precedence if both are provided.
  • Returns null tokens and user object if no token is supplied.
I