Criar app
curl --request POST \
--url https://api.upag.io/v1/apps \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"type": "<string>",
"provider": "<string>",
"name": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({type: '<string>', provider: '<string>', name: '<string>'})
};
fetch('https://api.upag.io/v1/apps', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const url = 'https://api.upag.io/v1/apps';
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({type: '<string>', provider: '<string>', name: '<string>'})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));Apps
Criar app
Conecta uma integração (Meta, Spedy, Utmify, Trackup ou Shopify) à conta
POST
https://api.upag.io
/
v1
/
apps
Criar app
curl --request POST \
--url https://api.upag.io/v1/apps \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"type": "<string>",
"provider": "<string>",
"name": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({type: '<string>', provider: '<string>', name: '<string>'})
};
fetch('https://api.upag.io/v1/apps', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const url = 'https://api.upag.io/v1/apps';
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({type: '<string>', provider: '<string>', name: '<string>'})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));Permissão:
Para
app.write (chave secreta; chave publicável não é aceita).
Endpoint
curl -X POST https://api.upag.dev/v1/apps \
-H "Authorization: Bearer sk_test_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"type": "integration",
"provider": "meta",
"name": "Meta Pixel",
"config": { "pixelId": "123456789", "accessToken": "EAAB..." }
}'
import { Upag } from 'upag';
const upag = new Upag('sk_test_your_api_key');
const app = await upag.apps.create({
type: 'integration',
provider: 'meta',
name: 'Meta Pixel',
config: { pixelId: '123456789', accessToken: 'EAAB...' },
});
// Shopify: a API valida as credenciais na Shopify ao criar
await upag.apps.create({
type: 'integration',
provider: 'shopify',
name: 'Loja Shopify',
config: {
shop: 'minha-loja.myshopify.com',
clientId: 'a1b2c3d4e5f6',
clientSecret: 'shpss_...',
},
});
Em produção use
https://api.upag.io/v1 com sk_live_....Parâmetros
string
required
Sempre
integration.string
required
meta, spedy, utmify, trackup ou shopify. Um app por provedor por conta.string
required
Nome do app (mínimo 3 caracteres).
object
default:"{}"
Configuração do provedor. Chaves usadas pela Upag:
meta:pixelId,accessToken.spedy:apiKey,creation(afterWarrantyouimmediate),warrantyDays,notifyCustomer,nfType(serviceouproduct).utmify:apiKey.trackup:url(endpoint que recebe os eventos),projectId,hostname.shopify:shop(domínio.myshopify.com),clientIdeclientSecret(obrigatórios);skipCart(opcional).
boolean
default:"true"
Se o app já nasce ligado.
string
default:"all"
all ou specific.string[] | null
default:"null"
UUIDs de produtos. Obrigatório (não vazio) quando
appliesTo é specific.Resposta
201 Created
Response
{
"id": "b7c8d9e0-f1a2-4b3c-8d4e-5f6a7b8c9d01",
"type": "integration",
"provider": "meta",
"scope": "public",
"name": "Meta Pixel",
"config": { "pixelId": "123456789", "accessToken": "********oken" },
"active": true,
"appliesTo": "all",
"appliesToProducts": null,
"createdAt": "2026-03-18T11:30:00.000Z",
"updatedAt": "2026-03-18T11:30:00.000Z"
}
shopify, a Upag valida as credenciais, confere os escopos e registra o webhook de desinstalação; config volta com shop, clientId, clientSecret (mascarado) e connectedAt. Depois, instale o script na loja.
400(APP_ALREADY_EXISTS) — a conta já tem um app desse provedor.400— erros do Shopify, comoSHOPIFY_INVALID_SHOP,SHOPIFY_CREDENTIALS_REQUIREDeSHOPIFY_MISSING_SCOPES(precisa dewrite_script_tags,read_productsewrite_draft_orders).401(SHOPIFY_INVALID_CLIENT) /422(SHOPIFY_APP_NOT_INSTALLEDe outrosSHOPIFY_*) — a Shopify recusou as credenciais.422— validação do corpo (por exemplo,config.shopausente emshopify).