Authentication
Use your email and password to receive a bearer token for authenticating API requests.
curl -X POST "https://api.datafiniti.co/v4/auth" \
-H "Content-Type: application/json" \
-d '{
"email": "user@example.com",
"password": "your-password"
}'
import requests
import json
url = "https://api.datafiniti.co/v4/auth"
headers = {
"Content-Type": "application/json"
}
data = {
"email": "user@example.com",
"password": "your-password"
}
response = requests.post(url, headers=headers, json=data)
print(response.json())
const response = await fetch("https://api.datafiniti.co/v4/auth", {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify({
"email": "user@example.com",
"password": "your-password"
})
});
const data = await response.json();
console.log(data);
package main
import (
"fmt"
"net/http"
"bytes"
"encoding/json"
)
func main() {
data := []byte(`{
"email": "user@example.com",
"password": "your-password"
}`)
req, err := http.NewRequest("POST", "https://api.datafiniti.co/v4/auth", bytes.NewBuffer(data))
if err != nil {
panic(err)
}
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println("Response Status:", resp.Status)
}
require 'net/http'
require 'json'
uri = URI('https://api.datafiniti.co/v4/auth')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request['Content-Type'] = 'application/json'
request.body = '{
"email": "user@example.com",
"password": "your-password"
}'
response = http.request(request)
puts response.body
{
"token": "example_string"
}
{
"error": "Bad Request",
"message": "The request contains invalid parameters or malformed data",
"code": 400,
"details": [
{
"field": "email",
"message": "Invalid email format"
}
]
}
POST
/auth
POST
Content-Typestring
RequiredThe media type of the request body
Options: application/json
emailstring
RequiredYour Datafiniti account email
Format: email
passwordstring
RequiredYour Datafiniti account password
Request Preview
Response
Response will appear here after sending the request
Body
application/json
emailstring
RequiredYour Datafiniti account email
passwordstring
RequiredYour Datafiniti account password
Responses
tokenstring
Bearer token to use in subsequent API requests
errorstring
Error message describing what went wrong
All requests to our API are authenticated by including an Authorization header in the request, in the form of: Authorization: Bearer <token>.
This endpoint allows you to use your email and password to receive a token. You will then use that token in all future requests.
Was this page helpful?
Last updated Mar 26, 2026
Built with Documentation.AI