Jentic OSThe workplace. An in-house AI platform for every employeeJentic OneSafe access. Agents reach your systems without holding keysJentic AIRThe foundation. Gets your existing platforms ready for AI
Pricing

GET STARTED

API DirectoryBrowse 10,000+ APIs ready for AI agent integrationDocumentationGuides and API reference

TOOLS

API ScoringCheck your AI readiness using our scorecardArazzo UIVisualize Arazzo workflows as interactive documentationArazzo EditorBuild and edit multi-step API workflows visually

COMMUNITY

GitHubOpen source projects and examplesOpen StandardsBuilt on open specs. Never locked in.
All ResourcesEverything in one placeBlogLatest articles and insightsTech Talk NewsletterAPIs, AI agents, architecture and strategyWebinarsLive sessions and on-demand recordingsReports & WhitepapersOriginal research on enterprise AI
About UsOur mission and teamCareersJoin our teamContactGet in touch
Try it now
Jentic OSJentic OneJentic AIR
Pricing
API DirectoryDocumentationAPI ScoringArazzo UIArazzo EditorGitHubOpen Standards
All ResourcesBlogTech Talk NewsletterWebinarsReports & Whitepapers
About UsCareersContact
Try it now
JenticJentic
Products
  • Jentic OS
  • Jentic One
  • Jentic AIR
For Developers
  • API Directory
  • Documentation
  • GitHub
Company
  • About Jentic
  • Careers
  • Contact Us
  • Trust Centre
ISO/IEC 27001:2022 certification badge issued by Prescient SecurityISO/IEC 27001:2022 certification badge issued by Prescient Security

Information Security Management System

Certified to ISO/IEC 27001:2022 by Prescient Security

AICPA SOC for Service Organizations logoAICPA SOC for Service Organizations logo

SOC 2® Type 1 report

Audited by Prescient Assurance

Terms & Conditions•Privacy Policy•
© 2026 Jentic Technology Ltd. All rights reserved.
2 Grattan Court East, Dublin, D02 VX86, Ireland
Switch to light modeSwitch to dark mode
APIs / Cloud Infrastructure / Sanity / Functions API
Functions API logo

Sanity Functions API

Browse all Sanity APIs
49
AI ReadinessFoundational (D+)49/100
See full scorecard
Official vendor OpenAPI document · agent-readyCloud InfrastructureServerlessbearer9 EndpointsREST

For Agents

List and invoke Sanity Functions with a test event, read or stream their logs, and set or remove their environment variables.

Use for: Invoke my Sanity function with this test document and wait for the result, List all functions in project 24s6f8sr that failed to update, Show the logs for the last execution of this function, I need to set the OPENAI_KEY environment variable on a Sanity function

Not supported: Does not create, deploy, or delete functions, and does not edit content. Use for invoking existing Sanity Functions and managing their logs and environment variables only.

The Sanity Functions API runs and inspects the serverless functions deployed to a Sanity project or organization. It lists functions with filters for region (us-east-1 or eu-central-1) and status, reads one function's definition, which can be a document, media library asset, cron, queue, pub/sub, durable, or sync-tag-invalidate function, and invokes it with an event payload, synchronously or not. It also reads and streams a function's logs, deletes them, and sets or removes environment variables by key. Every call names its project or organization in the x-sanity-scope-id and x-sanity-scope-type headers.

Jentic One on GithubView OpenAPI Document

Install Jentic One Beta

Connect the Functions API to your agent

Jentic One is a self-hosted execution layer for AI agents. It lets your agent call the Functions API, or any other public or private API you need. You set the rules, the agent never sees your credentials, and every call is logged.

Two steps, two machines. Install the instance in a safe environment, then register your agent from wherever it runs.

1

Step 1: Jentic One Host machine

# On the machine that will host your Jentic One instance:
curl -fsSL "https://jentic.com/install.sh?src=apis&api=%2Fapis%2Fsanity.io%2Fsanity-functions-api" | sh
2

Step 2: Agent machine

# On the machine where your agent runs (keep this separate from the instance):
curl -fsSL "https://jentic.com/install.sh?src=apis&api=%2Fapis%2Fsanity.io%2Fsanity-functions-api" | sh
jentic register       # connects your agent to your Jentic One instance

Jentic One is in public beta. The setup above keeps your agent separate from the instance, which is what you want before using real credentials: an agent running as the same OS user as Jentic One can read its stored keys directly. Just evaluating? A single local install is fine to start. See the secure deployment guide for the tiers.

Capabilities

What an agent can do with Functions API.

List the functions in a Sanity project or organization, filtered by region such as us-east-1 or eu-central-1 and by status such as assigned or failed-update

Read one function's definition, including its type such as sanity.function.document or sanity.function.cron

Invoke a function with an event whose data object is the test payload, choosing synchronous execution with the sync query parameter

Page through a function's logs with limit and offset, narrowed to one executionId

Stream new log entries as server-sent events from the logs stream endpoint, resuming after a given point with the after parameter

List a function's environment variable keys, set one by envVarKey with a value, or delete it

Use Cases

Patterns agents use Functions API for, with concrete tasks.

★ AI agent debugging a Sanity Function

An agent asked why a document-triggered function misbehaves searches Jentic for 'invoke a Sanity function', loads the invoke operation, and posts a test event with sync set to true so it gets the result back. It then reads the function's logs filtered by executionId to see what happened in that run, and does it all without the Sanity token entering its context.

POST /{apiV}/functions/{functionId}/invoke with sync=true, headers x-sanity-scope-id 24s6f8sr and x-sanity-scope-type project, and body {event: {data: {_id: 'post-1', title: 'Test'}}}, then GET /{apiV}/functions/{functionId}/logs and report the entries for that run

Managing function configuration

Functions that call outside services need keys and settings. The environment variables endpoints list a function's variable keys without their values, set a value by envVarKey with a PUT whose body holds the value, and delete a key that is no longer needed, so configuration can change without redeploying the function code.

GET /{apiV}/functions/{functionId}/envvars to list keys, then PUT /{apiV}/functions/{functionId}/envvars/{envVarKey} with envVarKey WEBHOOK_URL and body {value: 'https://hooks.example.com/sanity'}

Monitoring function health across a project

Teams with many functions need to spot the broken ones. The list endpoint filters by status values such as failed-create, failed-update, or disabled and by region, and each function's logs can be paged with limit and offset or tailed live as server-sent events from the stream endpoint.

GET /{apiV}/functions with status failed-update for project 24s6f8sr, then GET /{apiV}/functions/{functionId}/logs with limit 20 for each one returned

Key Endpoints

9 endpoints — the sanity functions api runs and inspects the serverless functions deployed to a sanity project or organization.

METHOD

PATH

DESCRIPTION

GET

/{apiV}/functions

List functions

GET

/{apiV}/functions/{functionId}

Read a function

POST

/{apiV}/functions/{functionId}/invoke

Invoke a function with an event

GET

/{apiV}/functions/{functionId}/logs

Retrieve function logs

GET

/{apiV}/functions/{functionId}/logs/stream

Stream function logs

PUT

/{apiV}/functions/{functionId}/envvars/{envVarKey}

Set an environment variable

GET

/{apiV}/functions

List functions

GET

/{apiV}/functions/{functionId}

Read a function

POST

/{apiV}/functions/{functionId}/invoke

Invoke a function with an event

GET

/{apiV}/functions/{functionId}/logs

Retrieve function logs

GET

/{apiV}/functions/{functionId}/logs/stream

Stream function logs

PUT

/{apiV}/functions/{functionId}/envvars/{envVarKey}

Set an environment variable

Jentic AI Readiness Score

This API is usable in Jentic One now. Its AI-readiness score against Jentic's framework shows where it stands today and where improvements would make it even easier for agents to use.

F

Functions API

- Foundational (D+)
49/100
52
Foundational Compliance
76
Developer Experience & Jentic Compatibility
27
AI-Readiness & Agent Experience
94
Agent Usability
60
Security
56
AI Discoverability
Powered by JenticScoring Framework 1.0.0 | Scoring Engine 0.4.2
Show dimension breakdown
52

Foundational Compliance

Base layer of spec validity and structural soundness.

Grade: C-Signals: 4
94%

Lint Results

Aggregated quality score from linter diagnostics, weighted by severity.

100%

Resolution Completeness

Percentage of `$ref` references that resolve successfully.

0%

Specification Validity

Checks whether the API description parses successfully and conforms to its declared specification (e.g., OpenAPI).

14%

Structural Integrity

Structural correctness score based on schema issues using logarithmic dampening.

76

Developer Experience & Jentic Compatibility

Clarity, completeness, and ingestion readiness for developers and tooling.

Grade: A-Signals: 4
42%

Example Density

How richly the API is illustrated with examples.

100%

Example Validity

Percentage of examples that conform to their schemas.

64%

Response Coverage

Percentage of operations with complete response definitions (success, client error, server error).

100%

Tooling Readiness

Health of API ingestion, bundling, and resolution within Jentic pipelines.

27

AI-Readiness & Agent Experience

Semantic breadth, depth, and agent comprehension for AI systems.

Grade: FSignals: 4
51%

Description Coverage

Coverage of descriptions across API elements.

0%

Error Standardization

Coverage of RFC 9457 Problem Details for error responses.

0%

OperationId Quality

Coverage, uniqueness, and casing consistency of operationIds for AI inference.

56%

Summary Coverage

Coverage of summaries across operations/tags/info.

94

Agent Usability

Functional utility, complexity comfort, and AI orchestration readiness.

Grade: A+Signals: 1
94%

Complexity Comfort

Agent comfort level based on API operational and structural complexity.

60

Security

Trust, risk posture, and security compliance.

Grade: B-Signals: 1
60%

Authentication Strength

Average quality of security schemes based on authentication method strength (weakest link for OAuth2).

56

AI Discoverability

Findability, semantic richness, and reasoning readiness.

Grade: CSignals: 1
56%

Descriptive Richness

Clarity and depth of descriptions across API elements.

View full reportHow the score is calculatedMore about the dimensions

Score it yourself

Every API in the directory is allowlisted, so you can re-score it with no key required.

Score your own APIScoring CLI agent skill
npx @jentic/api-scorecard-cli score <openapi-url>

Why Jentic?

What agents get from Jentic-routed access to this vendor.

Setup

Wiring the Sanity Functions API by hand means sending a bearer token plus the x-sanity-scope-id and x-sanity-scope-type headers on every call, shaping the event body for invoke, and consuming server-sent events for the log stream. Through Jentic you install once, import it from the API Directory, store the token once, and your agent calls it.

Permission scoping

Sanity puts the function id in the URL path (/{apiV}/functions/{functionId}/...), so a rule can pin your agent to one function and the operations you pick. The project itself travels in the scope headers, so rules bound which functions and operations the agent may call, not which project, and destructive ones like log deletion or environment variable removal are not included unless you add them.

Credential isolation

Your Sanity token is stored once, encrypted, by your own Jentic One instance and injected at execution time. It never enters the agent's prompt, logs, or context.

Intent-based discovery

Agents search Jentic by intent such as 'invoke a Sanity function' or 'stream Sanity function logs', and Jentic returns the matching operation with its input schema, including the required scope headers, so the agent calls it correctly first time.

Related APIs

Alternatives and complements available in the Jentic catalogue.

Alternative

Sanity Webhooks API

→

Send content change events to your own HTTP endpoint instead of running code on Sanity

Choose Sanity webhooks when the handler runs on your own server; choose Sanity Functions when the code runs on Sanity's infrastructure

Complementary

Sanity HTTP API

→

Query and mutate the documents that trigger document functions

Use the Sanity HTTP API to change content; use the Functions API to test and inspect the functions that react to it

Alternative

AWS Lambda API

→

General-purpose serverless functions on AWS

Choose AWS Lambda for functions on your own AWS account; choose Sanity Functions for code triggered by Sanity content and media events

Alternative

Cloudflare API

→

Run Workers and manage Cloudflare services

Choose Cloudflare Workers for edge functions in front of a site; choose Sanity Functions for handlers tied to a Sanity project

FAQs

Specific to using Functions API through Jentic.

What authentication does the Sanity Functions API use?

Per its OpenAPI spec, every operation uses a bearer token, described as a Sanity API session token, in the Authorization header. Each call also needs the x-sanity-scope-id and x-sanity-scope-type headers to name the project or organization the function belongs to. Through Jentic the token is stored by your own instance and attached at call time.

How do I invoke a Sanity Function for testing?

POST to /{apiV}/functions/{functionId}/invoke with a body of the form {event: {data: {...}}}, where data is the payload the function should receive. Set the sync query parameter to true to run it synchronously; it defaults to false. The optional x-sanity-lineage header carries a lineage token for the request.

Can I deploy or create functions with the Sanity Functions API?

Not through this spec. It covers listing, reading, invoking, logs, and environment variables for functions that already exist; there is no create, deploy, or delete-function operation in it.

What are the rate limits for the Sanity Functions API?

The OpenAPI spec does not specify rate limits. Check the Sanity documentation at https://www.sanity.io/docs for current limits on functions for your plan.

Is there a Sanity Functions MCP server?

You don't need an MCP server to give your agent the Sanity Functions API. Jentic connects it directly from the API Directory: import it, store your Sanity token once, and your agent calls the invoke, logs, and environment variable operations it needs without loading a separate server's tool definitions.

How do I read a function's logs through Jentic?

Search Jentic for 'get Sanity function logs', load the matching operation, and execute GET /{apiV}/functions/{functionId}/logs with the scope headers, adding executionId to narrow it to one run. It returns the most recent entries by default, and limit and offset page further back. To run it on your own infrastructure, install Jentic One from its GitHub repo.

Can I limit what my agent is allowed to do with the Sanity Functions API?

Yes. Allow only the invoke and log-read operations under /{apiV}/functions/abcd123456, and the agent can test that one function and read its output while environment variable changes and log deletion stay off its list. Every call it makes is logged.

GET STARTED

Start building with Functions API

Explore with Jentic One
View OpenAPI Document