Cowdidocs
API ReferenceAuthentication

Sign in with a custom token

POST
/v1/auth/sign-in

Exchanges a custom token for an ID token and a refresh token. Any client can call it without a Cowdi access token. The custom token comes from a token exchange operation. Returns 400 with INVALID_TOKEN when the custom token is invalid or Firebase rejects it. Returns 503 with SERVICE_TEMPORARILY_UNAVAILABLE when Firebase is not available. Send the same request again later. Use the ID token as the Bearer token for API calls, and refresh it through /v1/auth/refresh before it expires.

Request Body

application/json

Request to sign in with a custom token

Response Body

application/json

application/json

application/json

curl -X POST "https://example.com/v1/auth/sign-in" \  -H "Content-Type: application/json" \  -d '{    "custom_token": "custom_token_abc123def456ghi789"  }'

Successful Sign In

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