Cowdidocs
API ReferenceAuthentication

Refresh an ID token

POST
/v1/auth/refresh

Exchanges a refresh token for a new ID token and a new refresh token. Any client can call it without a Cowdi access token. The refresh token must come from the sign in operation or an earlier refresh call. Returns 400 with INVALID_TOKEN when the refresh token is invalid or expired. Returns 503 with SERVICE_TEMPORARILY_UNAVAILABLE when Firebase is not available. Keep the refresh token and send the request again later. Use the new ID token as the Bearer token for further API calls.

Request Body

application/json

Request to refresh an ID token

Response Body

application/json

application/json

application/json

curl -X POST "https://example.com/v1/auth/refresh" \  -H "Content-Type: application/json" \  -d '{    "refresh_token": "<opaque refresh token>"  }'

Successful Refresh

{  "id_token": "<signed JWT>",  "refresh_token": "AOEOulb...",  "expires_in": 3600}
{  "code": "BAD_REQUEST",  "description": "Invalid input"}
{  "code": "BAD_REQUEST",  "description": "Invalid input"}