/auth

GET
http://127.0.0.1:8080/auth

Check that your API key works. Keys are typically only disabled for billing issues. Requests to /auth do not bill per call.

Example use cases

  1. Say 'hello world!' to the Houski API.
  2. Check that your Houski API key is valid.

Request parameters

NameRequiredTypeDescription
api_keyYesUUID v4Your API key for authorization

Response object

Type declarations are available at the bottom of this page.

NameTypeDescription
api_key_authorizedBooleanIndicates if the API key is authorized.
errorStringDetails about the error. Empty if no error.
time_msIntegerTime taken for the request to complete in milliseconds.

Example requests and responses

Programming language

Select the programming language you want to display the code examples in.

Validate an API key
Confirm that your API key exists and is enabled. It does not check your maximum monthly spend, so a billed endpoint can still refuse a key that passes here. Useful for troubleshooting authentication or confirming your key works before other calls. The auth endpoint does not bill per call.
Request
Shell session
curl -X GET "http://127.0.0.1:8080/auth?api_key=YOUR_API_KEY"
TypeScript code
const houski_validate_api_key = async (): Promise<AuthResponse> => {

    // You must copy the AuthResponse type declarations from the 
    // Houski API documentation to strongly type the response

    const url = new URL('http://127.0.0.1:8080/auth');
    url.searchParams.set('api_key', 'YOUR_API_KEY');

    const response = await fetch(url);
    const data = await response.json();

    return data;
}

(async () => {
let data: AuthResponse = await houski_validate_api_key();

// Log the response
console.log(data);
})();
Response
JSON
{
  "api_key_authorized": true,
  "error": "",
  "time_ms": 0
}

Response type declarations

TypeScript code
interface AuthResponse {
    api_key_authorized: boolean;
    error: string;
    time_ms: number;
}