Skip to content
MUI’s hosted AI Assistant backend shuts down at the end of 2026.Switch in two lines →
  • Products
    • AG Grid AI Toolkit Early accessThe model and the server behind the toolkit.
    • MUI X Data Grid StableThe backend for the Premium AI Assistant.
    • TanStack Table Public alphaA plugin that applies each answer to your table.
    • AG Studio Early accessA hosted backend for its assistant, not built yet.
  • How it works
  • Accuracy
  • Pricing
  • Security
  • Docs
    • Quickstart: server route
    • Quickstart: TanStack Table
    • Browser keys
    • Moving from MUI’s hosted service
    • Guide: when MUI’s service retires
Sign inStart a 7-day trial
Menu
  • Products
    • AG Grid AI Toolkit Early access
    • MUI X Data Grid Stable
    • TanStack Table Public alpha
    • AG Studio Early access
  • How it works
  • Accuracy
  • Pricing
  • Security
  • Docs
    • Quickstart: server route
    • Quickstart: TanStack Table
    • Browser keys
    • Moving from MUI’s hosted service
    • Guide: when MUI’s service retires
  • Sign in

Product

  • How it works
  • Accuracy
  • Pricing
  • Data and security

Grids

  • AG Grid AI ToolkitEarly access
  • MUI X Data Grid PremiumStable
  • TanStack TablePublic alpha
  • AG StudioEarly access

Docs

  • Quickstart: server route
  • Browser keys
  • Guide: when MUI’s service retires

Company

  • Contact
  • Terms
  • Privacy

Not affiliated with or endorsed by MUI or AG Grid. MUI and AG Grid are trademarks of their respective owners.

© 2026 Gridsay

Docs pages
Start
  • Documentation
  • How it works
  • Examples
MUI X Data Grid
  • Quickstart: server route
  • From the browser
  • Using the helper
  • Filtering
  • Sorting
  • Grouping
  • Aggregation
  • Pivoting
  • Charts
  • Row selection
  • Follow-up questions
  • Refusals and errors
  • Moving from MUI’s service
  • Reference
TanStack Table
  • Quickstart
  • Describing columns
  • Filtering
  • Sorting
  • Grouping
  • Row selection
  • Server-side data
  • Controlled state
  • Undo and reset
  • Refusals and errors
  • API reference
Keys and sign-in
  • Secret and publishable keys
  • Browser keys
  • JWT and OIDC
  • Session tokens
  • Identity webhook
  • Per-user limits
  • The console
  • Data and privacy
HTTP API
  • HTTP API
  • Authentication
  • Data Grid endpoint
  • Follow-up questions
  • Private mode
Reference
  • Errors
  • Limits
  • Tiers and credits
  • @gridsay/core
On this page

On this page

  1. Set it up
  2. The request you receive
  3. Verify it
  4. What to answer
  5. Timeouts and failures
  6. Caching
  7. Rotate the signing secret
  8. What the page sends
  9. Next
Skip to the article
Start
  • Documentation
  • How it works
  • Examples
MUI X Data Grid
  • Quickstart: server route
  • From the browser
  • Using the helper
  • Filtering
  • Sorting
  • Grouping
  • Aggregation
  • Pivoting
  • Charts
  • Row selection
  • Follow-up questions
  • Refusals and errors
  • Moving from MUI’s service
  • Reference
TanStack Table
  • Quickstart
  • Describing columns
  • Filtering
  • Sorting
  • Grouping
  • Row selection
  • Server-side data
  • Controlled state
  • Undo and reset
  • Refusals and errors
  • API reference
Keys and sign-in
  • Secret and publishable keys
  • Browser keys
  • JWT and OIDC
  • Session tokens
  • Identity webhook
  • Per-user limits
  • The console
  • Data and privacy
HTTP API
  • HTTP API
  • Authentication
  • Data Grid endpoint
  • Follow-up questions
  • Private mode
Reference
  • Errors
  • Limits
  • Tiers and credits
  • @gridsay/core

Identity webhook

On this page

  1. Set it up
  2. The request you receive
  3. Verify it
  4. What to answer
  5. Timeouts and failures
  6. Caching
  7. Rotate the signing secret
  8. What the page sends
  9. Next

If your server can say who a user is from a value your page already has, Gridsay can ask it. Your page sends that value in a header with each question; Gridsay forwards it, signed, to an endpoint on your server, which answers with the user. This is the Identity webhook method on a publishable key.

Set it up#

Open Auth and limits, choose the publishable key, set Method to Identity webhook, and fill in:

FieldWhat to enter
Endpoint URLWhat to enterA public https address on your server
Header to forwardWhat to enterThe header your page sets, such as authorization or x-user-token, up to 100 characters. Not cookie: the browser sends no cookies to Gridsay
Cache answers for (seconds)What to enterHow long Gridsay reuses your answer for the same header value: 0 to 3,600, 60 by default. 0 asks your server every time

Choose Save authentication, then Create secret. Copy the Signing secret: it is shown once. Keep it on your server, never in your page.

The request you receive#

When a question arrives with a header value Gridsay has no cached answer for, your endpoint receives:

HTTP
POST /api/ai-identityContent-Type: application/jsonx-gridsay-signature: t=1796241600,v1=<hex HMAC-SHA256 of "1796241600.<raw body>"> {"credential":"<the value of the header your page sent>"}

credential is the header's whole value, exactly as the page sent it. With authorization that includes the word Bearer.

Verify it#

x-gridsay-signature holds a Unix time t and a signature v1: the hex HMAC-SHA256, keyed with your signing secret, of t, a full stop, and the raw request body. Before you trust the request:

  1. Check that GRIDSAY_WEBHOOK_SECRET is set on your server. If it is missing or empty, the endpoint answers 500 before reading the body or computing a signature.
  2. Check the header before reading the body. It must have exactly one t in decimal digits and one v1 of 64 lower-case hex characters. Every comma-separated field must be name=value, with no spaces. The endpoint ignores other well-formed fields. A malformed field, a repeated t or v1, or a timestamp more than five minutes from your clock gets a 401.
  3. Read the raw body and compute the HMAC over it as received. Compare it with v1 in constant time. A mismatch gets a 401.

The console gives you this endpoint. It looks up the user only after the signature matches:

app/api/ai-identity/route.ts
import { createHmac, timingSafeEqual } from 'node:crypto'; export async function POST(request: Request) {  const secret = process.env.GRIDSAY_WEBHOOK_SECRET;  if (!secret) {    console.error('[Gridsay] Set GRIDSAY_WEBHOOK_SECRET to your key’s webhook signing secret. Until then every identity request is refused.');    return new Response(null, { status: 500 });  }   // x-gridsay-signature: t=<unix seconds>,v1=<hex HMAC-SHA256 of "t.body">. Fields added later are ignored.  const fields = new Map<string, string>();  for (const field of (request.headers.get('x-gridsay-signature') ?? '').split(',')) {    const [, name, value] = /^([\w-]+)=(\S+)$/.exec(field) ?? [];    const repeated = (name === 't' || name === 'v1') && fields.has(name);    if (!name || !value || repeated) return new Response(null, { status: 401 });    fields.set(name, value);  }  const t = fields.get('t') ?? '';  const v1 = fields.get('v1') ?? '';  if (!/^\d+$/.test(t) || !/^[0-9a-f]{64}$/.test(v1) || Math.abs(Date.now() / 1000 - Number(t)) > 300) {    return new Response(null, { status: 401 });  }  const body = await request.text();  const expected = createHmac('sha256', secret).update(`${t}.${body}`).digest();  // v1 is exactly 64 hex characters, so both sides are 32 bytes and the comparison cannot throw.  if (!timingSafeEqual(Uint8Array.from(Buffer.from(v1, 'hex')), Uint8Array.from(expected))) {    return new Response(null, { status: 401 });  }   // The value of the header the page sent, exactly as received.  const { credential } = JSON.parse(body);  const user = await findUserByCredential(credential); // your own lookup  if (!user) return new Response(null, { status: 401 });  return Response.json({ userId: user.id, attributes: { plan: user.plan } });}

What to answer#

For a valid credential, answer 200 with the user:

JSON
{  "userId": "user_123",  "attributes": { "plan": "pro", "ai_quota": 300 }}
  • userId is 1 to 255 characters: the user every limit counts.
  • attributes is required; send {} if you have none. It may be at most 8 KB as JSON. Limit rules match these, such as plan or ai_quota.
  • For a credential that is not valid, answer 401 or 403. Your user then sees "Sign in to use the assistant."

Timeouts and failures#

Your endpoint has three seconds to answer. Anything other than the answers above makes the question fail with 503 upstream_unavailable, and your user sees "The assistant is temporarily unavailable. Try again.":

  • no answer within three seconds, or a redirect;
  • a status other than 200, 401 or 403;
  • a body that is not JSON, larger than 256 KiB, or without a valid userId and attributes, attributes over 8 KB included;
  • an address that does not resolve to a public internet address;
  • no signing secret created yet.

A question that arrives without the header gets 401 unauthenticated_user. Over 20 rejected credentials in a minute for the key from one client address get 429 rate_limited, "Too many attempts. Try again in N seconds." None of these is charged; they are listed under Refusals on Usage.

Caching#

A successful answer is reused for the same header value for as long as Cache answers for (seconds) says. A change to a user's access or attributes can take that long to reach Gridsay. A refusal is not cached: the next question asks again. Changing the method's settings or the signing secret starts afresh.

Rotate the signing secret#

Choose Rotate secret beside Signing secret and confirm. Gridsay signs with the new secret at once, with no overlap, so update your endpoint's secret in the same step.

What the page sends#

Your page sets the header with each question. This is the console's page code for MUI X Data Grid, with x-user-token as the header; getSessionToken is yours:

TSX
'use client'; import { createPromptResolver } from '@gridsay/mui-x-data-grid';import {  DataGridPremium,  GridAiAssistantPanel,  useGridApiRef,} from '@mui/x-data-grid-premium';import { useMemo } from 'react'; // Inside your client component, using your own rows and columns:const apiRef = useGridApiRef();const onPrompt = useMemo(  () =>    createPromptResolver({      url: 'https://api.gridsay.com/api/v1/datagrid/prompt',      publishableKey: 'pk_gs_FAKE_EXAMPLE_DO_NOT_USE',      headers: async () => ({ 'x-user-token': await getSessionToken() }),      apiRef,    }),  [apiRef],); <DataGridPremium  apiRef={apiRef}  rows={rows}  columns={columns}  aiAssistant  onPrompt={onPrompt}  slots={{ aiAssistantPanel: GridAiAssistantPanel }}  showToolbar/>

Next#

  • JWT and OIDC
  • Per-user limits
  • Data and privacy