Login
curl --request POST \
--url https://auth.contra.id/v1/programmatic/loginimport requests
url = "https://auth.contra.id/v1/programmatic/login"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://auth.contra.id/v1/programmatic/login', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://auth.contra.id/v1/programmatic/login",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://auth.contra.id/v1/programmatic/login"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://auth.contra.id/v1/programmatic/login")
.asString();require 'uri'
require 'net/http'
url = URI("https://auth.contra.id/v1/programmatic/login")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_bodyAuth API (Programmatic)
Login
Re-authenticate an existing account when your access_token expires.
POST
/
v1
/
programmatic
/
login
Login
curl --request POST \
--url https://auth.contra.id/v1/programmatic/loginimport requests
url = "https://auth.contra.id/v1/programmatic/login"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://auth.contra.id/v1/programmatic/login', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://auth.contra.id/v1/programmatic/login",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://auth.contra.id/v1/programmatic/login"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://auth.contra.id/v1/programmatic/login")
.asString();require 'uri'
require 'net/http'
url = URI("https://auth.contra.id/v1/programmatic/login")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_bodyYou don’t need this for verification calls — those use the long-lived
api_key. You need it to manage your account later (rotate keys, create new applications).
Request
curl -X POST https://auth.contra.id/v1/programmatic/login \
-H "Content-Type: application/json" \
-d '{
"email": "you@yourco.com",
"password": "MyStr0ng!Pass"
}'
Response · 200
{
"access_token": "eyJ…",
"refresh_token": "eyJ…",
"expires_in": 86400
}
Lockout
Progressive lockout protects against brute force:| Consecutive failures | Lockout |
|---|---|
| 5 | 15 minutes |
| 10 | 1 hour |
| 20 | 24 hours |
⌘I