Organization

Fetch organization metadata, update business description and offers.

Returns your organization's metadata: name, slug, and the public integration keys (Google Analytics ID, Meta Pixel ID, GTM Container ID) that your website needs to render analytics and tracking tags.

Get organization

GET /api/organizations/{orgId}/organization

Response

{
  "id": "org_xxx",
  "name": "Acme Inc.",
  "slug": "acme",
  "integrations": {
    "googleAnalyticsId": "G-XXXXXXX",
    "metaPixelId": "1234567890",
    "gtmContainerId": "GTM-XXXXXX"
  }
}

Example (TypeScript)

const org = await inventra.organizations.get();
console.log(org.name);
console.log(org.integrations.googleAnalyticsId);

Update business description

PATCH /api/organizations/{orgId}/business-description

Update the text the AI writer uses as context when generating blog posts.

Request body

{
  "businessDescription": "We sell artisanal coffee beans online, targeting specialty cafés and home brewers in Brazil. Tone: friendly, knowledgeable, never pushy."
}

Response

{
  "businessDescription": "We sell artisanal coffee beans online, targeting specialty cafés and home brewers in Brazil. Tone: friendly, knowledgeable, never pushy."
}

Example (TypeScript)

await fetch(`/api/organizations/${orgId}/business-description`, {
  method: 'PATCH',
  headers: { 'Content-Type': 'application/json', 'x-api-key': apiKey },
  body: JSON.stringify({
    businessDescription: 'We sell artisanal coffee beans online...'
  })
});

Update business offers

PATCH /api/organizations/{orgId}/business-offers

Update the business offers used to generate CTA bridges in AI-written content. Each offer has a name, description, and optional link.

Request body

{
  "businessOffers": [
    {
      "name": "Free Coffee Tasting",
      "description": "Book a free 30-min tasting session with our barista.",
      "link": "https://acme.com/tasting"
    },
    {
      "name": "Subscription Box",
      "description": "Fresh beans delivered monthly. Cancel anytime."
    }
  ]
}

Response

{
  "businessOffers": [
    {
      "name": "Free Coffee Tasting",
      "description": "Book a free 30-min tasting session with our barista.",
      "link": "https://acme.com/tasting"
    },
    {
      "name": "Subscription Box",
      "description": "Fresh beans delivered monthly. Cancel anytime."
    }
  ]
}

Pass an empty array to clear all offers:

{ "businessOffers": [] }

Example (TypeScript)

await fetch(`/api/organizations/${orgId}/business-offers`, {
  method: 'PATCH',
  headers: { 'Content-Type': 'application/json', 'x-api-key': apiKey },
  body: JSON.stringify({
    businessOffers: [
      { name: 'Free Tasting', description: 'Book a session.' }
    ]
  })
});

Integrations vs credentials

Inventra stores third-party configuration in two categories:

  • Integrations — public-safe values, returned by this endpoint. Examples: GA Measurement ID, Meta Pixel ID, GTM Container ID. Safe to ship to the browser.
  • Credentials — secret values (API secrets, OAuth tokens, SMTP passwords). Never exposed via any API. Used only by Inventra's backend.

The dashboard stores both, encrypted, but only the integrations dictionary is cherry-picked into API responses.

Use case: rendering analytics tags

import Script from 'next/script';

export default async function Layout({ children }) {
  const org = await inventra.organizations.get();
  const gaId = org.integrations.googleAnalyticsId;

  return (
    <html>
      <head>
        {gaId && (
          <Script
            src={`https://www.googletagmanager.com/gtag/js?id=${gaId}`}
          />
        )}
      </head>
      <body>{children}</body>
    </html>
  );
}