Public API (v1)
A v1 REST API to read your project, generate content, schedule posts, and receive signed webhooks : reserved for Pro, Agency and Enterprise plans.
/api/public/v1/…) and will also be reachable from api.gliiz.com once that subdomain is wired up — same routes, same keys.In the target project, open Settings → API, create a key, then copy it immediately. The full secret is only shown once.
Call /me to confirm the project, remaining AI credits and connected social accounts. This is your smoke test.
Create an HTTPS webhook before long generations: finished jobs arrive without aggressive polling.
Generate copy/flyer, retrieve the asset from /assets or a webhook, then schedule it with /posts.
export GLIIZ_API_BASE="https://gliiz.com/api/public/v1"
export GLIIZ_API_KEY="gliiz_your_secret_key"
curl "$GLIIZ_API_BASE/me" \
-H "Authorization: Bearer $GLIIZ_API_KEY"Generate a key from Account Settings → API (Owner or Admin, Pro/Agency/Enterprise plan on the chosen project). A key is scoped to exactly one project and shown in full only once at creation. Send it as a Bearer token on every request:
curl https://gliiz.com/api/public/v1/me \
-H "Authorization: Bearer gliiz_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"All v1 routes use JSON, and webhooks deliver signed JSON to you. Keep the key server-side only: never expose it in a browser, public mobile app, or embedded script.
const GLIIZ_API_BASE = "https://gliiz.com/api/public/v1";
async function gliiz(path: string, init: RequestInit = {}) {
const res = await fetch(`${GLIIZ_API_BASE}${path}`, {
...init,
headers: {
"Authorization": `Bearer ${process.env.GLIIZ_API_KEY}`,
"Content-Type": "application/json",
...init.headers,
},
});
const json = await res.json().catch(() => ({}));
if (!res.ok) throw new Error(json.error ?? `Gliiz API error ${res.status}`);
return json;
}The easiest path is deliberately linear: verify the project, generate copy, generate or reuse a visual, then schedule. Webhooks let you receive long-running generations without keeping a connection open.
// 1) Vérifier le projet et les crédits
const me = await gliiz("/me");
console.log(me.project.name, me.credits?.remaining);
// 2) Générer des légendes adaptées à la marque du projet
const copy = await gliiz("/generate/copy", {
method: "POST",
body: JSON.stringify({
prompt: "Annonce le lancement de notre nouvelle offre premium",
platforms: ["instagram", "linkedin"],
contentKind: "image"
}),
});
// 3) Générer un visuel IA. La réponse est souvent async: gardez le jobId.
const flyer = await gliiz("/generate/flyer", {
method: "POST",
body: JSON.stringify({
prompt: "Flyer premium pour le lancement d'une offre marketing IA",
format: "portrait",
outputQuality: "2k",
modelTier: "standard",
variantCount: 1
}),
});
// 4) Quand l'asset est disponible (via webhook ou /assets), planifier le post
await gliiz("/posts", {
method: "POST",
body: JSON.stringify({
content_item_id: "content-item-uuid",
caption: copy.copy.instagram.caption,
platforms: ["instagram"],
scheduled_at: "2026-09-01T09:00:00.000Z"
}),
});VIBE & Turbo
The API is not a second conversational brain: it triggers the same engines as Studio/VIBE, but without a chat thread. Use VIBE or Turbo for conversation; use the API for system integrations.
Team
A key is created by an Owner/Admin and remains bound to one project. It uses the project owner's credit pool, not the human user calling your server.
Video
Video generation exists in Studio/VIBE/Turbo. It is not yet exposed in public v1 API keys; fetch already-created videos through /assets.
| Method & path | What it does |
|---|---|
| GET /api/public/v1/me | Project name, AI credit balance, connected social accounts. |
| GET /api/public/v1/assets | List generated assets (flyers, copy, video), newest first. ?limit, ?before for pagination. |
| GET /api/public/v1/analytics | Latest per-platform stats (followers, reach, engagement). ?period=<days>. |
| POST /api/public/v1/generate/copy | Generate AI captions/hashtags for one or more platforms. |
| POST /api/public/v1/generate/flyer | Generate an AI flyer/visual. Runs the same engine as Studio. |
| POST /api/public/v1/posts | Schedule a post from an existing asset or a media URL. |
| GET/POST /api/public/v1/webhooks | List or create HMAC-signed webhook subscriptions. |
| DELETE /api/public/v1/webhooks/:id | Disable a webhook without deleting its delivery history. |
| POST /api/public/v1/webhooks/test | Send a webhook.test event to your active subscriptions. |
/api/public/v1/meVerify the key, project and creditsCall this route when your integration starts. It confirms that the key is valid, points to the right project, and still has usable credits.
| Authorization | header | Bearer gliiz_... |
| project | response | id, name and creation date for the key-scoped project. |
| credits | response | monthly_limit, used, purchased_balance, remaining. |
| connected_accounts | response | platform, name, type and active state for connected social accounts. |
{
"project": { "id": "uuid", "name": "Acme", "created_at": "2026-08-12T10:00:00Z" },
"credits": { "monthly_limit": 200, "used": 42, "purchased_balance": 25, "remaining": 183 },
"connected_accounts": [
{ "platform": "instagram", "account_name": "acme", "account_type": "business", "active": true }
]
}/api/public/v1/assets?limit=20&before=2026-08-12T10:00:00ZList generated assetsUse /assets to fetch visuals, videos and content already created in the project. Pagination uses next_cursor: send it back as before to request the next page.
| limit | query, 1-100 | Number of assets returned. Default: 20. |
| before | query ISO date | Time cursor returned by next_cursor. |
| asset_kind | response | image | video | flyer | copy |
| asset_url / flyer_png_url | response | Media URL to display, download or schedule. |
curl "$GLIIZ_API_BASE/assets?limit=10" \
-H "Authorization: Bearer $GLIIZ_API_KEY"/api/public/v1/analytics?period=30Read social analyticsReturns the latest available analytics snapshot per platform over the requested period. Values depend on permissions granted by each social network.
| period | query, 1-365 | Number of days analyzed. Default: 30. |
| followers_count | response | Known follower count at snapshot date. |
| reach | response | Available reach for the platform. |
| engagement_rate | response | Engagement rate stored by Gliiz. |
/api/public/v1/generate/copyGenerate captions and hashtagsThis route is synchronous: it responds directly with generated text. It automatically loads brand identity, tone, contact details and strategic hashtags from the key-scoped project.
| prompt | string, requis | Exact subject of the content to publish. |
| platforms | array | instagram | facebook | linkedin | tiktok | youtube |
| contentKind | image | video | Helps the AI avoid video wording for an image, or the reverse. |
| brandName/toneOfVoice/sector/pillars | optional | Light overrides if you call without full context; the project remains authoritative. |
{
"prompt": "Présente notre nouvelle offre premium pour PME",
"platforms": ["instagram", "linkedin"],
"contentKind": "image"
}/api/public/v1/generate/flyerGenerate an AI visualThis route creates a generation job. The normal response is 202 with jobId; receive completion through generation.completed, or list /assets later. Credits are checked before enqueueing.
| prompt | string, requis | Visual brief. Be concrete: subject, offer, mood, audience. |
| format | optional | square | portrait | story | landscape |
| outputQuality | optional | 2k | 4k |
| modelTier | optional | standard | premium |
| visualType | optional | typography | hybrid |
| variantCount | optional | 1 | 2 | 3 |
| subjectUrls | optional | Public HTTPS reference images. |
| generationRequestId | optional | Client idempotency key to avoid duplicates. |
{
"prompt": "Flyer premium pour annoncer une offre marketing IA pour restaurants",
"format": "portrait",
"outputQuality": "2k",
"modelTier": "standard",
"visualType": "hybrid",
"variantCount": 1,
"generationRequestId": "launch-offer-2026-09-01"
}/api/public/v1/postsSchedule a postSchedules an existing asset or media URL to one or more networks. If multiple accounts for a platform are connected, send account_by_platform to select the right account.
| content_item_id | uuid | Existing Gliiz asset. Recommended after generation. |
| media_url | url | Alternative: public URL when the asset does not exist in Gliiz yet. |
| caption | string, requis | Published text. Use copy.<platform>.caption for ready-to-publish output. |
| platforms | array, requis | instagram | facebook | linkedin | tiktok | youtube |
| scheduled_at | ISO datetime | UTC date. Default: now + 30 seconds. |
| account_by_platform | object | Map platform → social_account_id when needed. |
{
"content_item_id": "2f67a5b0-6b0b-47fb-84f0-a077e0d2dd9e",
"caption": "Votre légende prête à publier...",
"platforms": ["instagram", "facebook"],
"scheduled_at": "2026-09-01T09:00:00.000Z",
"account_by_platform": {
"instagram": "social-account-uuid"
}
}/api/public/v1/webhooksManage outgoing webhooksWebhooks are the simplest way to integrate Gliiz with a CRM, CMS, ERP, e-commerce backend or internal tool. Create a subscription, store the secret, verify signatures, then process events.
| GET /webhooks | list | Lists active and disabled subscriptions for the project. |
| POST /webhooks | create | Creates an HTTPS subscription and returns secret once. |
| DELETE /webhooks/:id | disable | Disables without deleting delivery history. |
| POST /webhooks/test | test | Sends webhook.test to active subscriptions. |
project_idsent in a request body is ignored in favor of the key's own project. Generation requests count against that project owner's normal plan limits and rate limits, same as using the app itself.When you create a webhook, Gliiz returns a whsec_… secret shown once. Every POST delivery includes X-Gliiz-Timestamp and X-Gliiz-Signature. Verify the HMAC-SHA256 signature over `${timestamp}.${body}` before processing the event.
curl "$GLIIZ_API_BASE/webhooks" \
-X POST \
-H "Authorization: Bearer $GLIIZ_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Production backend",
"url": "https://example.com/webhooks/gliiz",
"events": ["generation.completed", "generation.failed", "post.scheduled"]
}'{
"webhook": {
"id": "webhook-subscription-uuid",
"name": "Production backend",
"url": "https://example.com/webhooks/gliiz",
"events": ["generation.completed", "generation.failed", "post.scheduled"],
"created_at": "2026-08-12T10:00:00.000Z",
"secret": "whsec_copy_this_once"
}
}import crypto from "crypto";
const timestamp = request.headers["x-gliiz-timestamp"];
const signature = request.headers["x-gliiz-signature"];
const expected = "sha256=" + crypto
.createHmac("sha256", process.env.GLIIZ_WEBHOOK_SECRET!)
.update(`${timestamp}.${rawBody}`)
.digest("hex");
if (!crypto.timingSafeEqual(Buffer.from(signature), Buffer.from(expected))) {
throw new Error("Invalid Gliiz webhook signature");
}{
"id": "evt_01J...",
"event": "generation.completed",
"created_at": "2026-08-12T10:02:14.000Z",
"project_id": "project-uuid",
"data": {
"api_key_id": "api-key-uuid",
"job_id": "generation-job-uuid",
"workflow": "flyer.v1",
"status": "completed",
"result": {
"contentItemId": "content-item-uuid",
"imageUrl": "https://..."
}
}
}Available events: generation.copy.completed, generation.flyer.queued, generation.completed, generation.failed, post.scheduled, webhook.test.
| generation.copy.completed | sync | A caption generation completed. |
| generation.flyer.queued | async | A visual generation job was accepted into the queue. |
| generation.completed | async | A generation job finished successfully. |
| generation.failed | async | A job failed or was canceled. |
| post.scheduled | sync | One or more posts were scheduled. |
| webhook.test | manual | Event sent by /webhooks/test. |
2xx quickly after signature verification. If processing is slow, put the event in your own queue and respond immediately. Gliiz logs the HTTP status, response snippet and delivery errors.API errors are deliberately simple: an HTTP status, a readable error field, and sometimes details/code for validation. Handle at least the statuses below.
| 400 | Bad Request | Invalid JSON payload or missing field. |
| 401 | Unauthorized | Missing, malformed, revoked or unknown key. |
| 402 | Payment Required | Not enough credits to start the generation. |
| 403 | Forbidden | Plan without API access, plan quota, or unauthorized action. |
| 404 | Not Found | Project, asset or webhook not found in the key scope. |
| 422 | Unprocessable Entity | Valid JSON but invalid business parameters. |
| 429 | Rate Limited | Too many requests or too many active jobs. |
| 500/503 | Server Error | Server incident or AI provider temporarily unavailable. |
{
"error": "Invalid post payload",
"details": {
"fieldErrors": {
"platforms": ["Array must contain at least 1 element(s)"]
}
}
}/assets.Platforms & Networks
What you can do on each connected social network (publishing, comment replies, and DM replies), so you know what to expect before connecting an account.
| Platform | Publishing | Comment auto-reply | DM auto-reply |
|---|---|---|---|
| ✅ | ✅ | ✅ Messenger | |
| ✅ | ✅ | ✅ DM | |
| TikTok | ✅ Publishing | ❌ | ❌ |
| ✅ | ⚠️ Limited | ❌ | |
| YouTube | ✅ Video only | ❌ | ❌ |
| N/A | N/A | ✅ |
Capabilities above depend on the permissions each platform grants Gliiz at connection time and can change if a platform updates its policies. If a feature you expect is missing on a connected account, try reconnecting it from Settings → Accounts.
Was this documentation helpful?
