WrytzeWrytze Docs
API Reference

Tags

Fetch blog tags from your Wrytze workspace.

The Tags endpoint returns all blog tags for your organization. Unlike categories, tags are flat (no hierarchy) and are used for cross-cutting labels like "Tutorial", "Case Study", or "Product Update".

List tags

GET /api/v1/tags

Returns all tags across your organization's websites, ordered alphabetically by name. You can optionally filter to a specific website.

Parameters

ParameterTypeRequiredDefaultDescription
website_idstringNo--Filter to a specific website

Response

Returns an array of tag objects wrapped in data. This endpoint returns all tags at once (no pagination) since tag lists are typically small.

Cache TTL: 5 minutes.

Examples

curl "https://app.wrytze.com/api/v1/tags?website_id=ws_abc123" \
  -H "X-API-Key: wrz_sk_abc123..."
import { WrytzeClient } from "@wrytze/sdk";

const client = new WrytzeClient({ apiKey: "wrz_sk_abc123..." });

const { data } = await client.tags.list({
  websiteId: "ws_abc123",
});

for (const tag of data) {
  console.log(tag.name, tag.color);
}
const response = await fetch(
  "https://app.wrytze.com/api/v1/tags?website_id=ws_abc123",
  {
    headers: {
      "X-API-Key": "wrz_sk_abc123...",
    },
  }
);

const { data } = await response.json();

for (const tag of data) {
  console.log(tag.name, tag.color);
}

Response example

{
  "data": [
    {
      "id": "tag_abc123",
      "name": "Case Study",
      "slug": "case-study",
      "color": "#10b981",
      "websiteId": "ws_abc123"
    },
    {
      "id": "tag_def456",
      "name": "Next.js",
      "slug": "nextjs",
      "color": "#3b82f6",
      "websiteId": "ws_abc123"
    },
    {
      "id": "tag_ghi789",
      "name": "Tutorial",
      "slug": "tutorial",
      "color": "#f59e0b",
      "websiteId": "ws_abc123"
    }
  ]
}

Using tag colors

Each tag includes a color field (hex color code) that you can use to render colored badges in your UI:

function TagBadge({ tag }: { tag: { name: string; color: string } }) {
  return (
    <span
      style={{
        backgroundColor: `${tag.color}20`,
        color: tag.color,
        padding: "2px 8px",
        borderRadius: "4px",
        fontSize: "12px",
        fontWeight: 500,
      }}
    >
      {tag.name}
    </span>
  );
}

TypeScript Interface

interface Tag {
  id: string;
  name: string;
  slug: string;
  color: string;
  websiteId: string;
}

interface TagListResponse {
  data: Tag[];
}

On this page