Authentication
To use the WriteIQ Headless API, you must authenticate all requests using an API Key.
Generating an API Key
Section titled “Generating an API Key”You can generate a wiq_ API Key directly from your WriteIQ dashboard under Developer Settings.
Keep your API key secure. Do not expose it in client-side code or public repositories.
Making Authenticated Requests
Section titled “Making Authenticated Requests”All API requests must include an Authorization header with the value Bearer <YOUR_API_KEY>.
Example (cURL)
Section titled “Example (cURL)”curl -X GET https://api.writeiq.com/v1/articles \ -H "Authorization: Bearer wiq_YOUR_API_KEY_HERE" \ -H "Content-Type: application/json"Example (JavaScript/fetch)
Section titled “Example (JavaScript/fetch)”fetch("https://api.writeiq.com/v1/articles", { method: "GET", headers: { "Authorization": "Bearer wiq_YOUR_API_KEY_HERE", "Content-Type": "application/json" }}).then(response => response.json()).then(data => console.log(data));Error Handling
Section titled “Error Handling”If your API key is missing, invalid, or expired, the API will return a 401 Unauthorized response:
{ "error": "Missing or invalid Authorization header"}