Authenticate
Exchange an API key for a JWT access token.
POST
https://api.up2data.ai/api/api-auth/authenticateExchange an API key for a JWT access token. Create the key from Settings -> Integrations in the dashboard, then send it here to get a token valid for 24 hours. Every other endpoint on this page requires that token in the Authorization header.
See the Authentication guide for the full key-to-token flow.
Info
API keys are long-lived credentials and should be stored securely. The access token this endpoint returns expires after 24 hours and must be refreshed by calling this endpoint again.
#Request
| Field | Type | Notes |
|---|---|---|
apiKeyrequired | string | Your API key from Settings -> Integrations. |
#Call it
curl -X POST "https://api.up2data.ai/api/api-auth/authenticate" \
-H "Content-Type: application/json" \
-d '{
"apiKey": "your-api-key-here"
}'import requests
url = "https://api.up2data.ai/api/api-auth/authenticate"
headers = {
"Content-Type": "application/json",
}
payload = {
"apiKey": "your-api-key-here"
}
response = requests.post(url, headers=headers, json=payload)
print(response.json())const url = "https://api.up2data.ai/api/api-auth/authenticate";
const headers = {
"Content-Type": "application/json",
};
const body = {
"apiKey": "your-api-key-here"
};
const response = await fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
});
const data = await response.json();
console.log(data);package main
import (
"bytes"
"fmt"
"io"
"net/http"
)
func main() {
url := "https://api.up2data.ai/api/api-auth/authenticate"
body := bytes.NewBufferString(`{
"apiKey": "your-api-key-here"
}`)
req, err := http.NewRequest("POST", url, body)
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()
respBody, _ := io.ReadAll(resp.Body)
fmt.Println(string(respBody))
}#Response
{
"accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}{
"error": "Not authorized"
}#Errors
| Status | Type | When |
|---|---|---|
| 401 | Not authorized | The API key is invalid or missing. |
See the Errors guide for every error type this version can return.