Iniciar sessão
Funcionalidades Vídeo IA Preços Comparar Blog Começar agora
DEVELOPER DOCS

API Reference

Referência completa da API REST do InMedia. Todos os endpoints exigem autenticação via chave de API.

URL base: https://useinmedia.com

Authentication

Toda requisição deve incluir sua chave de API como Bearer token e o ID do workspace. Crie chaves de API em Dashboard → Configurações → Chaves de API (plano Growth necessário).

Required headers

Authorization: Bearer sk_aBcDeFgHiJkLmNoPqRsTuVwXyZ1234567890abcd
Content-Type: application/json

O workspace é determinado automaticamente pela chave de API. Sem necessidade do header X-Workspace-Id. A chave é exibida apenas uma vez na criação; guarde-a com segurança.

Exemplo rápido. Criar uma publicação

curl https://useinmedia.com/api/v1/posts \
  -X POST \
  -H "Authorization: Bearer sk_..." \
  -H "Content-Type: application/json" \
  -d '{"title":"My post","prompt":"Bold product post for Instagram"}'
import requests

response = requests.post(
    "https://useinmedia.com/api/v1/posts",
    headers={"Authorization": "Bearer sk_..."},
    json={
        "title": "My post",
        "prompt": "Bold product post for Instagram",
    }
)
post = response.json()
const response = await fetch("https://useinmedia.com/api/v1/posts", {
  method: "POST",
  headers: {
    "Authorization": "Bearer sk_...",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    title: "My post",
    prompt: "Bold product post for Instagram",
  }),
});
const post = await response.json();
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization", "Bearer sk_...");

var payload = new {
    title = "My post",
    prompt = "Bold product post for Instagram"
};
var response = await client.PostAsJsonAsync(
    "https://useinmedia.com/api/v1/posts", payload);
var post = await response.Content.ReadFromJsonAsync<JsonDocument>();
<?php
$ch = curl_init("https://useinmedia.com/api/v1/posts");
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_POST           => true,
    CURLOPT_HTTPHEADER     => [
        "Authorization: Bearer sk_...",
        "Content-Type: application/json",
    ],
    CURLOPT_POSTFIELDS     => json_encode([
        "title"  => "My post",
        "prompt" => "Bold product post for Instagram",
    ]),
]);
$post = json_decode(curl_exec($ch), true);

Códigos de erro

CodeSignificado
400Bad request. Invalid parameters
401Não autorizado. Chave API em falta ou inválida
403Forbidden. Feature not available on your plan
404Not found. Resource does not exist
429Rate limited. Slow down

Webhook Events

Passe uma lista de nomes de eventos separados por vírgula no campo events ao criar um webhook.

post.generated
Fired when AI finishes generating a post
post.published
Fired when a post is successfully published
post.scheduled
Fired when a post is queued for future publishing
post.failed
Fired when post generation or publishing fails
video.completed
Fired when a video render job finishes
video.failed
Fired when a video render job fails

Payload format

Cada entrega de webhook é uma requisição POST com o seguinte corpo JSON:

{
  "event": "post.published",
  "workspaceId": "a1b2c3d4-...",
  "timestamp": "2026-04-14T15:30:00Z",
  "data": {
    "id": "3f7a1b2c-...",
    "title": "Air Jordan launch",
    "status": "published",
    "imageUrl": "https://...",
    "publishedAt": "2026-04-14T15:30:00Z"
  }
}

Webhook Security

Se você fornecer um segredo ao criar o webhook, o InMedia assinará cada entrega com HMAC-SHA256. Verifique a assinatura para garantir que a requisição veio do InMedia.

Cabeçalho de assinatura

X-InMedia-Signature: sha256=abc123...

O valor é o digest hex HMAC-SHA256 do corpo bruto da requisição usando seu segredo de webhook como chave.

Verificação de assinatura

const crypto = require('crypto');

function verifySignature(payload, signature, secret) {
  const expected = 'sha256=' +
    crypto.createHmac('sha256', secret)
          .update(payload, 'utf8')
          .digest('hex');
  return crypto.timingSafeEqual(
    Buffer.from(signature),
    Buffer.from(expected)
  );
}
import hmac, hashlib

def verify_signature(payload: bytes, signature: str, secret: str) -> bool:
    expected = 'sha256=' + hmac.new(
        secret.encode(), payload, hashlib.sha256
    ).hexdigest()
    return hmac.compare_digest(signature, expected)
using System.Security.Cryptography;
using System.Text;

bool VerifySignature(byte[] payload, string signature, string secret)
{
    using var hmac = new HMACSHA256(Encoding.UTF8.GetBytes(secret));
    var hash     = hmac.ComputeHash(payload);
    var expected = "sha256=" + Convert.ToHexString(hash).ToLower();
    return CryptographicOperations.FixedTimeEquals(
        Encoding.UTF8.GetBytes(signature),
        Encoding.UTF8.GetBytes(expected)
    );
}
<?php
function verify_signature(
    string $payload,
    string $signature,
    string $secret
): bool {
    $expected = 'sha256=' . hash_hmac('sha256', $payload, $secret);
    return hash_equals($expected, $signature);
}

Posts

Crie e gerencie posts. Chame POST /{id}/generate após criar um post para gerar conteúdo com IA.

GET /api/v1/posts Listar todos os posts
Query Parameters
NameTypeRequiredDescription
status string optional Filtrar por estado: rascunho | agendado | publicado | falhado
page integer optional Número da página (predefinido: 1)
pageSize integer optional Itens por página, máximo 100 (predefinido: 20)
cURL
curl https://useinmedia.com/api/v1/posts \
  -H "Authorization: Bearer sk_..."
Resposta
[
  {
    "id": "3f7a1b2c-...",
    "workspaceId": "a1b2c3d4-...",
    "projectId": "e5f6g7h8-...",
    "title": "Air Jordan launch",
    "prompt": "Bold Instagram post for sneaker drop",
    "status": "published",
    "imageUrl": "https://...",
    "hasVideo": false,
    "format": "instagram_square",
    "createdAt": "2026-04-14T12:00:00Z"
  }
]
POST /api/v1/posts Criar uma publicação
Body Parameters
NameTypeRequiredDescription
title string required Post title (max 200 chars)
prompt string required Generation prompt (max 5000 chars)
projectId guid required Projeto para associar à publicação
brandKitId guid optional Brand kit to apply during generation
Request body
{
  "title": "Air Jordan launch",
  "prompt": "Bold Instagram post for a sneaker drop. Black and gold palette.",
  "projectId": "e5f6g7h8-...",
  "brandKitId": "k1l2m3n4-..."
}
cURL
curl https://useinmedia.com/api/v1/posts \
  -X POST \
  -H "Authorization: Bearer sk_..." \
  -H "Content-Type: application/json" \
  -d '{ "title": "Air Jordan launch", "prompt": "Bold Instagram post for a sneaker drop. Black and gold palette.", "projectId": "e5f6g7h8-...", "brandKitId": "k1l2m3n4-..." }'
Resposta
{
  "id": "3f7a1b2c-...",
  "title": "Air Jordan launch",
  "status": "draft",
  "imageUrl": "https://...",
  "hasVideo": false,
  "createdAt": "2026-04-14T12:00:00Z"
}
GET /api/v1/posts/ {id} Get a post by ID
cURL
curl https://useinmedia.com/api/v1/posts/<id> \
  -H "Authorization: Bearer sk_..."
Resposta
{
  "id": "3f7a1b2c-...",
  "workspaceId": "a1b2c3d4-...",
  "projectId": "e5f6g7h8-...",
  "title": "Air Jordan launch",
  "prompt": "Bold Instagram post for sneaker drop",
  "status": "published",
  "imageUrl": "https://...",
  "hasVideo": false,
  "format": "instagram_square",
  "brandKitId": null,
  "scheduledAt": null,
  "publishedAt": "2026-04-14T15:30:00Z",
  "createdAt": "2026-04-14T12:00:00Z",
  "updatedAt": "2026-04-14T15:30:00Z"
}
GET /api/v1/posts/project/ {projectId} List posts by project
cURL
curl https://useinmedia.com/api/v1/posts/project/<projectId> \
  -H "Authorization: Bearer sk_..."
Resposta
[ { "id": "...", "title": "..." } ]
PUT /api/v1/posts/ {id} Atualizar um post
Body Parameters
NameTypeRequiredDescription
title string optional New title (max 200 chars)
prompt string optional New prompt (max 5000 chars)
status string optional draft | scheduled | published | failed
scheduledAt datetime optional ISO 8601 scheduled publish time
brandKitId guid optional Brand Kit para aplicar
Request body
{ "title": "Updated title", "status": "draft" }
cURL
curl https://useinmedia.com/api/v1/posts/<id> \
  -X PUT \
  -H "Authorization: Bearer sk_..." \
  -H "Content-Type: application/json" \
  -d '{ "title": "Updated title", "status": "draft" }'
Resposta
{
  "id": "3f7a1b2c-...",
  "title": "Updated title",
  "status": "draft",
  "updatedAt": "2026-04-14T13:00:00Z"
}
DELETE /api/v1/posts/ {id} Delete a post
cURL
curl https://useinmedia.com/api/v1/posts/<id> \
  -X DELETE \
  -H "Authorization: Bearer sk_..."
Resposta
204 No Content
POST /api/v1/posts/ {id} /generate Gerar (ou regerar) conteúdo AI para uma publicação
Body Parameters
NameTypeRequiredDescription
prompt string optional New prompt; omit to regenerate with existing prompt
format string optional Aspect ratio: 1:1 | 9:16 | 16:9 (default: 1:1)
Request body
{ "prompt": "Make it more energetic", "format": "1:1" }
cURL
curl https://useinmedia.com/api/v1/posts/<id>/generate \
  -X POST \
  -H "Authorization: Bearer sk_..." \
  -H "Content-Type: application/json" \
  -d '{ "prompt": "Make it more energetic", "format": "1:1" }'
Resposta
{
  "post": {
    "id": "3f7a1b2c-...",
    "status": "draft",
    "imageUrl": "https://...",
    "hasVideo": false,
    "updatedAt": "2026-04-14T13:00:00Z"
  },
  "respond": "Updated the design with more vibrant colors."
}
POST /api/v1/posts/ {id} /render Render the current post version to an image (PNG/JPEG)
cURL
curl https://useinmedia.com/api/v1/posts/<id>/render \
  -X POST \
  -H "Authorization: Bearer sk_..."
Resposta
{ "id": "...", "imageUrl": "https://...", "status": "draft" }
POST /api/v1/posts/ {id} /publish Marcar um post como publicado
cURL
curl https://useinmedia.com/api/v1/posts/<id>/publish \
  -X POST \
  -H "Authorization: Bearer sk_..."
Resposta
{ "id": "...", "status": "published", "publishedAt": "2026-04-14T15:30:00Z" }
POST /api/v1/posts/ {id} /schedule Schedule a post for future publishing
Body Parameters
NameTypeRequiredDescription
scheduledAt datetime required ISO 8601 publish date/time (UTC)
Request body
{ "scheduledAt": "2026-04-15T09:00:00Z" }
cURL
curl https://useinmedia.com/api/v1/posts/<id>/schedule \
  -X POST \
  -H "Authorization: Bearer sk_..." \
  -H "Content-Type: application/json" \
  -d '{ "scheduledAt": "2026-04-15T09:00:00Z" }'
Resposta
{ "id": "...", "status": "scheduled", "scheduledAt": "2026-04-15T09:00:00Z" }
POST /api/v1/posts/ {id} /publish-social Publish (or schedule) a post to connected social accounts
Body Parameters
NameTypeRequiredDescription
connectionIds guid[] required List of social connection IDs to publish to
scheduledAt datetime optional Se fornecido, agenda em vez de publicar imediatamente
Request body
{
  "connectionIds": ["conn-uuid-1", "conn-uuid-2"],
  "scheduledAt": null
}
cURL
curl https://useinmedia.com/api/v1/posts/<id>/publish-social \
  -X POST \
  -H "Authorization: Bearer sk_..." \
  -H "Content-Type: application/json" \
  -d '{ "connectionIds": ["conn-uuid-1", "conn-uuid-2"], "scheduledAt": null }'
Resposta
[
  {
    "connectionId": "conn-uuid-1",
    "platform": "Instagram",
    "status": "Published",
    "externalPostId": "ext-123",
    "errorMessage": null
  }
]
GET /api/v1/posts/ {id} /publish-targets Get social publishing targets and status for a post
cURL
curl https://useinmedia.com/api/v1/posts/<id>/publish-targets \
  -H "Authorization: Bearer sk_..."
Resposta
[
  {
    "connectionId": "conn-uuid-1",
    "platform": "Instagram",
    "status": "Published",
    "externalPostId": "ext-123",
    "errorMessage": null
  }
]
GET /api/v1/posts/ {id} /download Transferir imagem de post como ficheiro
Query Parameters
NameTypeRequiredDescription
format string optional png (default) or jpg
cURL
curl https://useinmedia.com/api/v1/posts/<id>/download \
  -H "Authorization: Bearer sk_..."
Resposta
Ficheiro binário (image/png ou image/jpeg)
GET /api/v1/posts/ {id} /versions List saved versions of a post
cURL
curl https://useinmedia.com/api/v1/posts/<id>/versions \
  -H "Authorization: Bearer sk_..."
Resposta
[
  {
    "id": "ver-uuid-...",
    "versionNumber": 3,
    "label": "Dark theme variant",
    "createdAt": "2026-04-14T12:00:00Z"
  }
]
POST /api/v1/posts/ {id} /versions/ {versionId} /restore Restaurar uma publicação para uma versão anterior
cURL
curl https://useinmedia.com/api/v1/posts/<id>/versions/<versionId>/restore \
  -X POST \
  -H "Authorization: Bearer sk_..."
Resposta
{ "id": "...", "status": "draft", "imageUrl": "https://...", "updatedAt": "2026-04-14T13:00:00Z" }

Projects

Organizar posts sob projetos. O plano Starter está limitado a 3 projetos ativos.

GET /api/v1/projects Listar projetos
Query Parameters
NameTypeRequiredDescription
status string optional Filtro: ativo | arquivado
cURL
curl https://useinmedia.com/api/v1/projects \
  -H "Authorization: Bearer sk_..."
Resposta
[
  {
    "id": "e5f6g7h8-...",
    "name": "Nike Campaign",
    "description": "Q2 2026 drop",
    "icon": "👟",
    "color": "#00f2ff",
    "status": "active",
    "createdAt": "2026-01-10T09:00:00Z"
  }
]
POST /api/v1/projects Criar um projeto
Body Parameters
NameTypeRequiredDescription
name string required Nome do projeto
description string optional Optional description
icon string optional Emoji icon
color string optional Hex color e.g. #00f2ff
Request body
{
  "name": "Nike Campaign",
  "description": "Q2 2026 drop",
  "icon": "👟",
  "color": "#00f2ff"
}
cURL
curl https://useinmedia.com/api/v1/projects \
  -X POST \
  -H "Authorization: Bearer sk_..." \
  -H "Content-Type: application/json" \
  -d '{ "name": "Nike Campaign", "description": "Q2 2026 drop", "icon": "👟", "color": "#00f2ff" }'
Resposta
{
  "id": "e5f6g7h8-...",
  "name": "Nike Campaign",
  "status": "active",
  "createdAt": "2026-04-14T12:00:00Z"
}
PUT /api/v1/projects/ {id} Atualizar um projeto
Body Parameters
NameTypeRequiredDescription
name string optional Novo nome
description string optional Nova descrição
status string optional ativo | arquivado
Request body
{ "name": "Nike Campaign v2", "status": "archived" }
cURL
curl https://useinmedia.com/api/v1/projects/<id> \
  -X PUT \
  -H "Authorization: Bearer sk_..." \
  -H "Content-Type: application/json" \
  -d '{ "name": "Nike Campaign v2", "status": "archived" }'
Resposta
{ "id": "...", "name": "Nike Campaign v2", "status": "archived" }
GET /api/v1/projects/ {id} Get a project by ID
cURL
curl https://useinmedia.com/api/v1/projects/<id> \
  -H "Authorization: Bearer sk_..."
Resposta
{
  "id": "e5f6g7h8-...",
  "name": "Nike Campaign",
  "description": "Q2 2026 drop",
  "icon": "👟",
  "color": "#00f2ff",
  "status": "active",
  "coverUrl": "https://...",
  "createdAt": "2026-01-10T09:00:00Z"
}
POST /api/v1/projects/ {id} /cover Upload a cover image for a project (multipart/form-data)
Body Parameters
NameTypeRequiredDescription
file file required JPEG, PNG or WebP. Max 10 MB
cURL
curl https://useinmedia.com/api/v1/projects/<id>/cover \
  -X POST \
  -H "Authorization: Bearer sk_..."
Resposta
{ "id": "...", "coverUrl": "https://...", "name": "Nike Campaign" }
DELETE /api/v1/projects/ {id} /cover Remover a imagem de capa de um projeto
cURL
curl https://useinmedia.com/api/v1/projects/<id>/cover \
  -X DELETE \
  -H "Authorization: Bearer sk_..."
Resposta
204 No Content
DELETE /api/v1/projects/ {id} Eliminar um projeto
cURL
curl https://useinmedia.com/api/v1/projects/<id> \
  -X DELETE \
  -H "Authorization: Bearer sk_..."
Resposta
204 No Content

Brand Kits

Armazene cores, fontes e logotipo da sua marca. Plano Starter limitado a 1 Brand Kit.

GET /api/v1/brandkits Listar Brand Kits
cURL
curl https://useinmedia.com/api/v1/brandkits \
  -H "Authorization: Bearer sk_..."
Resposta
[
  {
    "id": "k1l2m3n4-...",
    "name": "Main Brand",
    "colorsJson": "{\"primary\":\"#00f2ff\",\"secondary\":\"#020408\"}",
    "fontsJson": "{\"heading\":\"Plus Jakarta Sans\",\"body\":\"Inter\"}",
    "logoUrl": "https://..."
  }
]
POST /api/v1/brandkits Criar um Kit de marca
Body Parameters
NameTypeRequiredDescription
name string required Nome do Brand Kit
colors.primary string optional Primary hex color
colors.secondary string optional Secondary hex color
colors.accent string optional Accent hex color
colors.neutral string optional Neutral hex color
fonts.heading string optional Heading font name
fonts.body string optional Body font name
logoUrl string optional Public URL to logo image
Request body
{
  "name": "Main Brand",
  "colors": {
    "primary": "#00f2ff",
    "secondary": "#020408",
    "accent": "#ffffff",
    "neutral": "#888888"
  },
  "fonts": {
    "heading": "Plus Jakarta Sans",
    "body": "Inter"
  },
  "logoUrl": "https://example.com/logo.png"
}
cURL
curl https://useinmedia.com/api/v1/brandkits \
  -X POST \
  -H "Authorization: Bearer sk_..." \
  -H "Content-Type: application/json" \
  -d '{ "name": "Main Brand", "colors": { "primary": "#00f2ff", "secondary": "#020408", "accent": "#ffffff", "neutral": "#888888" }, "fonts": { "heading": "Plus Jakarta Sans", "body": "Inter" }, "logoUrl": "https://example.com/logo.png" }'
Resposta
{ "id": "k1l2m3n4-...", "name": "Main Brand", ... }
PUT /api/v1/brandkits/ {id} Atualizar um Brand Kit
Body Parameters
NameTypeRequiredDescription
name string optional Novo nome
colors object optional Color overrides (same shape as create)
fonts object optional Font overrides
Request body
{ "colors": { "primary": "#ff5733" } }
cURL
curl https://useinmedia.com/api/v1/brandkits/<id> \
  -X PUT \
  -H "Authorization: Bearer sk_..." \
  -H "Content-Type: application/json" \
  -d '{ "colors": { "primary": "#ff5733" } }'
Resposta
{ "id": "...", "name": "Main Brand", ... }
GET /api/v1/brandkits/ {id} Get a Brand Kit by ID
cURL
curl https://useinmedia.com/api/v1/brandkits/<id> \
  -H "Authorization: Bearer sk_..."
Resposta
{
  "id": "k1l2m3n4-...",
  "name": "Main Brand",
  "colorsJson": "{\"primary\":\"#00f2ff\",\"secondary\":\"#020408\"}",
  "fontsJson": "{\"heading\":\"Plus Jakarta Sans\",\"body\":\"Inter\"}",
  "logoUrl": "https://..."
}
DELETE /api/v1/brandkits/ {id} Eliminar um Brand Kit
cURL
curl https://useinmedia.com/api/v1/brandkits/<id> \
  -X DELETE \
  -H "Authorization: Bearer sk_..."
Resposta
204 No Content

Schedules

Automatize a geração recorrente de conteúdo com agendamentos cron. Requer plano Growth.

Requer o plano Growth+
GET /api/v1/schedules List schedules
cURL
curl https://useinmedia.com/api/v1/schedules \
  -H "Authorization: Bearer sk_..."
Resposta
[
  {
    "id": "s1s2s3s4-...",
    "name": "Daily Instagram Post",
    "cronExpression": "0 9 * * *",
    "isActive": true,
    "promptTemplate": "Generate a motivational post for today.",
    "nextRunAt": "2026-04-15T09:00:00Z"
  }
]
POST /api/v1/schedules Criar um calendário Growth+
Body Parameters
NameTypeRequiredDescription
name string required Nome do calendário
cronExpression string required Expressão cron de 5 campos, por exemplo, "0 9 * * 1"
promptTemplate string optional Prompt used for each run (max 5000 chars)
projectId guid optional Project for generated posts
brandKitId guid optional Brand Kit para aplicar
Request body
{
  "name": "Daily Instagram Post",
  "cronExpression": "0 9 * * *",
  "promptTemplate": "Generate a motivational post for today.",
  "projectId": "e5f6g7h8-...",
  "brandKitId": "k1l2m3n4-..."
}
cURL
curl https://useinmedia.com/api/v1/schedules \
  -X POST \
  -H "Authorization: Bearer sk_..." \
  -H "Content-Type: application/json" \
  -d '{ "name": "Daily Instagram Post", "cronExpression": "0 9 * * *", "promptTemplate": "Generate a motivational post for today.", "projectId": "e5f6g7h8-...", "brandKitId": "k1l2m3n4-..." }'
Resposta
{
  "id": "s1s2s3s4-...",
  "name": "Daily Instagram Post",
  "cronExpression": "0 9 * * *",
  "isActive": true,
  "nextRunAt": "2026-04-15T09:00:00Z"
}
PUT /api/v1/schedules/ {id} Atualizar um calendário
Body Parameters
NameTypeRequiredDescription
name string optional Novo nome
cronExpression string optional Nova expressão cron
isActive boolean optional Ativar ou desativar o calendário
promptTemplate string optional Novo modelo de prompt
Request body
{ "isActive": false }
cURL
curl https://useinmedia.com/api/v1/schedules/<id> \
  -X PUT \
  -H "Authorization: Bearer sk_..." \
  -H "Content-Type: application/json" \
  -d '{ "isActive": false }'
Resposta
{ "id": "...", "isActive": false, ... }
GET /api/v1/schedules/ {id} Get a schedule by ID
cURL
curl https://useinmedia.com/api/v1/schedules/<id> \
  -H "Authorization: Bearer sk_..."
Resposta
{
  "id": "s1s2s3s4-...",
  "name": "Daily Instagram Post",
  "cronExpression": "0 9 * * *",
  "isActive": true,
  "promptTemplate": "Generate a motivational post for today.",
  "lastRunAt": "2026-04-13T09:00:00Z",
  "nextRunAt": "2026-04-15T09:00:00Z"
}
DELETE /api/v1/schedules/ {id} Eliminar um calendário
cURL
curl https://useinmedia.com/api/v1/schedules/<id> \
  -X DELETE \
  -H "Authorization: Bearer sk_..."
Resposta
204 No Content

Webhooks

Receba notificações HTTP em tempo real quando eventos ocorrem no seu workspace. Requer plano Growth.

Requer o plano Growth+
GET /api/v1/webhooks List webhooks
cURL
curl https://useinmedia.com/api/v1/webhooks \
  -H "Authorization: Bearer sk_..."
Resposta
[
  {
    "id": "w1w2w3w4-...",
    "url": "https://yourapp.com/hooks/inmedia",
    "events": "post.published,post.failed",
    "isActive": true,
    "lastTriggeredAt": "2026-04-14T10:00:00Z"
  }
]
POST /api/v1/webhooks Registar um webhook Growth+
Body Parameters
NameTypeRequiredDescription
url string required Ponto final HTTPS para receber eventos
events string required Comma-separated event names (see Events section below)
secret string optional Segredo opcional para verificação de assinatura HMAC-SHA256
Request body
{
  "url": "https://yourapp.com/hooks/inmedia",
  "events": "post.published,post.failed",
  "secret": "my-webhook-secret"
}
cURL
curl https://useinmedia.com/api/v1/webhooks \
  -X POST \
  -H "Authorization: Bearer sk_..." \
  -H "Content-Type: application/json" \
  -d '{ "url": "https://yourapp.com/hooks/inmedia", "events": "post.published,post.failed", "secret": "my-webhook-secret" }'
Resposta
{
  "id": "w1w2w3w4-...",
  "url": "https://yourapp.com/hooks/inmedia",
  "events": "post.published,post.failed",
  "isActive": true,
  "createdAt": "2026-04-14T12:00:00Z"
}
PUT /api/v1/webhooks/ {id} Update a webhook
Body Parameters
NameTypeRequiredDescription
url string optional Nova URL de endpoint
events string optional New event list
isActive boolean optional Ativar ou desativar
Request body
{ "isActive": false }
cURL
curl https://useinmedia.com/api/v1/webhooks/<id> \
  -X PUT \
  -H "Authorization: Bearer sk_..." \
  -H "Content-Type: application/json" \
  -d '{ "isActive": false }'
Resposta
{ "id": "...", "isActive": false, ... }
DELETE /api/v1/webhooks/ {id} Delete a webhook
cURL
curl https://useinmedia.com/api/v1/webhooks/<id> \
  -X DELETE \
  -H "Authorization: Bearer sk_..."
Resposta
204 No Content

Video

Consulte jobs de geração de vídeo e obtenha URLs assinadas. A geração é iniciada pelo editor do dashboard.

Requer o plano Growth+
GET /api/v1/video/jobs/ {jobId} Poll the status of a video generation job Growth+
cURL
curl https://useinmedia.com/api/v1/video/jobs/<jobId> \
  -H "Authorization: Bearer sk_..."
Resposta
{
  "status": "done",
  "postId": "e5f6g7h8-...",
  "videoUrl": "https://presigned-s3-url...",
  "message": "Video generated successfully!",
  "error": null
}
GET /api/v1/video/presign/ {postId} Get a fresh presigned URL for a post's video Growth+
cURL
curl https://useinmedia.com/api/v1/video/presign/<postId> \
  -H "Authorization: Bearer sk_..."
Resposta
{ "url": "https://presigned-s3-url..." }

Usage

Consulte a cota do seu plano e o histórico de atividades.

GET /api/v1/usage/activity Get generation activity
Query Parameters
NameTypeRequiredDescription
page integer optional Número da página (predefinido: 1)
pageSize integer optional Itens por página (predefinido: 50)
cURL
curl https://useinmedia.com/api/v1/usage/activity \
  -H "Authorization: Bearer sk_..."
Resposta
{
  "activity": [
    {
      "id": "t1t2t3t4-...",
      "type": "PostGeneration",
      "typeLabel": "Content generation",
      "description": "Air Jordan launch",
      "createdAt": "2026-04-14T12:00:00Z"
    }
  ]
}

API Keys

Criar e gerir chaves de API programáticas. Requer plano Growth.

Requer o plano Growth+
GET /api/v1/api-keys Listar chaves API
cURL
curl https://useinmedia.com/api/v1/api-keys \
  -H "Authorization: Bearer sk_..."
Resposta
[
  {
    "id": "key-uuid-...",
    "name": "Production key",
    "keyPrefix": "sk_abcd",
    "isActive": true,
    "lastUsedAt": "2026-04-13T08:00:00Z",
    "expiresAt": null,
    "createdAt": "2026-01-01T00:00:00Z"
  }
]
POST /api/v1/api-keys Criar uma chave API Growth+
Body Parameters
NameTypeRequiredDescription
name string required Nome descritivo para a chave
expiresAt datetime optional Optional expiry (ISO 8601)
Request body
{ "name": "Production key" }
cURL
curl https://useinmedia.com/api/v1/api-keys \
  -X POST \
  -H "Authorization: Bearer sk_..." \
  -H "Content-Type: application/json" \
  -d '{ "name": "Production key" }'
Resposta
{
  "id": "key-uuid-...",
  "key": "sk_aBcDeFgHiJkLmNoPqRsTuVwXyZ1234567890abcd",
  "prefix": "sk_aBcDe",
  "name": "Production key"
}
DELETE /api/v1/api-keys/ {id} Revogar uma chave API
cURL
curl https://useinmedia.com/api/v1/api-keys/<id> \
  -X DELETE \
  -H "Authorization: Bearer sk_..."
Resposta
204 No Content
POST /api/v1/api-keys/ {id} /regenerate Regenerar uma chave API
cURL
curl https://useinmedia.com/api/v1/api-keys/<id>/regenerate \
  -X POST \
  -H "Authorization: Bearer sk_..."
Resposta
{ "id": "...", "key": "sk_NEW...", "prefix": "sk_NEW" }