# Refresh an access token Exchange a valid refresh token for a new access/refresh token pair. Endpoint: POST /auth/refresh Version: 0.1.0 ## Request fields (application/json): - `refreshToken` (string, required) JWT refresh token issued by /auth/login or /auth/register Example: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." ## Response 200 fields (application/json): - `accessToken` (string, required) New JWT access token Example: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." - `refreshToken` (string, required) Rotated JWT refresh token Example: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." ## Response 400 fields (application/json): - `error` (string, required) Error code that identifies the type of error. This is a stable identifier that can be used for programmatic error handling. Common codes include: - NOT_FOUND - Resource not found - VALIDATION_ERROR - Input validation failed - PERMISSION_DENIED - User lacks permission for the action - CONFLICT - Request conflicts with current resource state - UNAUTHORIZED - Authentication required - INTERNAL_SERVER_ERROR - Unexpected server error Example: "VALIDATION_ERROR" - `message` (string, required) User-friendly error message that should always be displayed to end users. This message is designed to be clear, actionable, and free of technical details. This field is always present and contains the primary message for end users. Example: "The email address you entered is not valid. Please check the format and try again." - `technicalMessage` (string) Optional technical message for developers. Contains detailed information including IDs, error codes, and technical context. Only included when it differs from the user-friendly message field. When present, developers can use this for debugging while end users should see the message field. Example: "Campaign with ID campaign_123 not found" - `details` (object) Additional error details (optional). May contain structured information about the error, such as validation field errors or additional context. - `requestId` (string) Unique request identifier for tracing. Included in X-Request-ID header and can be used to correlate errors with server logs. Example: "550e8400-e29b-41d4-a716-446655440000" - `timestamp` (string, required) ISO 8601 timestamp when the error occurred Example: "2024-01-01T00:00:00Z"