# AUTH: Generate a new 2FA Code

To start the 2FA Initiation process, a 2FA Initiation Key must be generated. This endpoint provides the text and image (QR Code) version as a response, which the user must import/scan in Google Authenticator (or similar).

{% hint style="info" %}
Then the user must submit the first PIN code to fully enable and "link" the Mechanism.
{% endhint %}

## AUTH: Generate new 2FA Registration Code

> To start the 2FA Initiation process, a 2FA Initiation Key must be generated. This endpoint provides the text and image (QR Code) version as a response, which the user must import/scan in Google Authenticator (or similar).  \
> Then the user must submit the first PIN code to fully enable and "link" the Mechanism.

```json
{"openapi":"3.0.0","info":{"title":"Hybrid-Chain API Documentation and Specification","version":"1.0.0"},"servers":[{"url":"https://api.hybrid-chain.com/api/v1"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}}},"paths":{"/auth/new2facode":{"get":{"tags":["Authentication"],"summary":"AUTH: Generate new 2FA Registration Code","description":"To start the 2FA Initiation process, a 2FA Initiation Key must be generated. This endpoint provides the text and image (QR Code) version as a response, which the user must import/scan in Google Authenticator (or similar).  \nThen the user must submit the first PIN code to fully enable and \"link\" the Mechanism.","responses":{"200":{"description":"OK","headers":{"Content-Type":{"schema":{"type":"string"}},"Content-Length":{"schema":{"type":"integer"}},"Cache-Control":{"schema":{"type":"string"}},"Connection":{"schema":{"type":"string"}},"keep-alive":{"schema":{"type":"string"}},"Access-Control-Allow-Origin":{"schema":{"type":"string"}},"Content-Encoding":{"schema":{"type":"string"}},"Vary":{"schema":{"type":"string"}},"Server":{"schema":{"type":"string"}},"Date":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object"}}}}}}}}}
```
