To work with API first create application: https://eu.api.ovh.com/createApp/ You will receive 2 keys:
This is just start! Now you need to obtain Consumer key (CK)! To request consumer key you must use AK from previous step, write access rules and set redirection URL:
$ curl -XPOST -H"X-Ovh-Application: 7kbG7Bk7S9Nt7ZSV" -H "Content-type: application/json" \
https://eu.api.ovh.com/1.0/auth/credential -d '{
"accessRules": [
{
"method": "GET",
"path": "/domain/zone/*"
},
{
"method": "POST",
"path": "/domain/zone/*"
},
{
"method": "PUT",
"path": "/domain/zone/*"
},
{
"method": "DELETE",
"path": "/domain/zone/*"
}
],
"redirection":"https://www.mywebsite.com/"
}'
After that you'll receive CK and validation URL
{"validationUrl":"https://eu.api.ovh.com/auth/?credentialToken=iQ1joJE0OmSPlUAoSw1IvAPWDeaD87ZM64HEDvYq77IKIxr4bIu6fU8OtrPQEeRh","consumerKey":"MtSwSrPpNjqfVSmJhLbPyr2i45lSwPU1","state":"pendingValidation"}
Open validation URL and enter NIC handle and password to authorize CK.
Or you can go easy way: https://eu.api.ovh.com/createToken/ - fill NIC handle, password, script name (any), script description (any), Validity Unlimited, Rights:
GET /domain/zone/* PUT /domain/zone/* POST /domain/zone/* DELETE /domain/zone/*
Create keys. After that you'll get AK, AS and CK. Just put them to ACME client (Lego, for example).