API access with two-factor authentication

Hi,
when I try to use the API with my admin account that has 2FA enabled, I’m getting the following error:

Seafile Password: {“non_field_errors”:[“Two factor auth token is missing.”]}

How can I specify the 2FA token? I don’t find it in the API documentation.

Thanks,
Dirk

Hi, if you have 2FA token, you can try to access your account through

curl -d "username=username@example.com&password=123456" -H 'X-SEAFILE-OTP: <token>' https://cloud.seafile.com/api2/auth-token/

by add a header of ‘X-SEAFILE-OTP’

The API docs will be updated later

Great, that works. Thanks :slightly_smiling_face: