Skip to main content
Connections authenticated with an API key (or a client token) are configured with HTTP headers. Every MCP request carries them, and the server enforces them on every tool call. They are set by whoever configures the connection (you, your backend) and cannot be changed by the agent through tool arguments.
OAuth connections ignore these headers. When an AI app connects by signing in with Sendforsign, the grant the user approved on the consent screen is the source of truth: account, user (tenant) if one was picked, mode (drafts only by default) and allowed domains. Headers such as X-Sendforsign-Client-Key, X-Sendforsign-User-Key, X-Sendforsign-Agent-Mode, X-Sendforsign-Allowed-Domains and X-Sendforsign-On-Behalf-Of have no effect there, so an app cannot change the approved account, user, mode or allowed domains. X-Sendforsign-Agent, if sent, is only appended to the app’s name in the audit log. Header authentication works as described below.

Examples

A production agent in a multi-tenant product, acting for one of your customers’ employees, allowed to prepare and send contracts only to that customer’s domain and its client’s domain:
A research or reporting agent that must never change anything:

Notes

  • Header names are case-insensitive. Values for the mode are case-insensitive too (DRAFT, read-only and read_only all work); an unknown value falls back to send, so spell it carefully when you mean to restrict.
  • For an allowlist, a leading @ is ignored (@customer.com = customer.com), and subdomains are not included: list eu.customer.com separately if needed.
  • Call the get_connection_info tool to see how the server read your headers.
  • The REST API ignores these MCP headers. Use userKey and clientKey in the request body there.