Validate API Key
curl --request GET \
--url https://server.promptwatch.com/api/v2/auth/validate \
--header 'X-API-Key: <api-key>'import requests
url = "https://server.promptwatch.com/api/v2/auth/validate"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://server.promptwatch.com/api/v2/auth/validate', 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://server.promptwatch.com/api/v2/auth/validate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$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://server.promptwatch.com/api/v2/auth/validate"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://server.promptwatch.com/api/v2/auth/validate")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://server.promptwatch.com/api/v2/auth/validate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"valid": true,
"keyType": "organization",
"project": {
"id": "6ba7b810-9dad-11d1-80b4-00c04fd430c8",
"name": "Example Project",
"slug": "example-project"
},
"organization": {
"id": "6ba7b811-9dad-11d1-80b4-00c04fd430c8",
"name": "Example Org",
"slug": "example-org"
},
"apiKey": {
"id": "550e8400-e29b-41d4-a716-446655440001",
"name": "CI integration",
"permission": "FULL",
"createdAt": "2026-03-01T12:00:00.000Z",
"lastUsedAt": "2026-03-30T08:15:22.000Z"
},
"availableProjects": null
}{
"valid": false,
"message": "Invalid API key."
}{
"error": "Unauthorized",
"message": "Missing or invalid X-API-Key header."
}{
"error": "Unauthorized",
"message": "Missing or invalid X-API-Key header."
}Authentication
Validate API Key
Validate an API key and get associated project/organization details. For organization-level keys, optionally provide X-Project-Id header to validate access to a specific project.
GET
/
auth
/
validate
Validate API Key
curl --request GET \
--url https://server.promptwatch.com/api/v2/auth/validate \
--header 'X-API-Key: <api-key>'import requests
url = "https://server.promptwatch.com/api/v2/auth/validate"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://server.promptwatch.com/api/v2/auth/validate', 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://server.promptwatch.com/api/v2/auth/validate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$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://server.promptwatch.com/api/v2/auth/validate"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://server.promptwatch.com/api/v2/auth/validate")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://server.promptwatch.com/api/v2/auth/validate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"valid": true,
"keyType": "organization",
"project": {
"id": "6ba7b810-9dad-11d1-80b4-00c04fd430c8",
"name": "Example Project",
"slug": "example-project"
},
"organization": {
"id": "6ba7b811-9dad-11d1-80b4-00c04fd430c8",
"name": "Example Org",
"slug": "example-org"
},
"apiKey": {
"id": "550e8400-e29b-41d4-a716-446655440001",
"name": "CI integration",
"permission": "FULL",
"createdAt": "2026-03-01T12:00:00.000Z",
"lastUsedAt": "2026-03-30T08:15:22.000Z"
},
"availableProjects": null
}{
"valid": false,
"message": "Invalid API key."
}{
"error": "Unauthorized",
"message": "Missing or invalid X-API-Key header."
}{
"error": "Unauthorized",
"message": "Missing or invalid X-API-Key header."
}Authorizations
API key for authentication. Get yours from the Promptwatch dashboard under Settings > API Keys.
Headers
Project ID to validate (required for organization-level keys when accessing project resources)
Response
Default Response
Whether the API key is valid
Type of API key - project-level or organization-level
Available options:
project, organization Show child attributes
Show child attributes
Show child attributes
Show child attributes
Project details. For org keys, only present when X-Project-Id header is provided.
Show child attributes
Show child attributes
List of available projects. Only present for organization-level keys when no X-Project-Id header is provided.
Show child attributes
Show child attributes