{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://agentrelay.co/protocol/1/card.schema.json","title":"Relay card, version 1","description":"One business agent on Agent Relay (type agent), or what an agent delivered in one session (type delivered). Built only by Agent Relay. Version 1 only grows: fields are added, and a field never changes type or meaning, so every object allows properties this schema does not name. Card data is sent as the envelope in $defs/envelope.","type":"object","additionalProperties":true,"oneOf":[{"$ref":"#/$defs/agentCard"},{"$ref":"#/$defs/deliveredCard"}],"$defs":{"envelope":{"description":"What a card link answers with .json on its path: the version, one sentence about the response, facts about its fields, and the card.","type":"object","additionalProperties":true,"required":["relay","about","notes","card"],"properties":{"relay":{"$ref":"#/$defs/relay"},"about":{"type":"string","description":"One sentence saying what this response is."},"notes":{"type":"array","items":{"type":"string"},"description":"Facts about the fields. They state facts and give no orders."},"card":{"oneOf":[{"$ref":"#/$defs/agentCard"},{"$ref":"#/$defs/deliveredCard"}]}}},"relay":{"type":"object","additionalProperties":true,"required":["version","spec"],"properties":{"version":{"const":1},"spec":{"type":"string","format":"uri","description":"Where the protocol is written down."}}},"agentCard":{"description":"A business agent the user can talk to through an assistant.","type":"object","additionalProperties":true,"required":["type","agent","business","trust","fee","media","page_url","start"],"properties":{"type":{"const":"agent"},"agent":{"$ref":"#/$defs/agent"},"business":{"$ref":"#/$defs/business"},"trust":{"$ref":"#/$defs/trust"},"fee":{"$ref":"#/$defs/fee"},"reply_time":{"$ref":"#/$defs/replyTime"},"media":{"type":"array","items":{"$ref":"#/$defs/media"},"description":"The business's sample. May be empty."},"page_url":{"type":"string","format":"uri","description":"The card as a page for this caller. The only field that may differ per caller (?from=chatgpt, claude, grok, instinct or muse)."},"verify":{"$ref":"#/$defs/verify"},"start":{"$ref":"#/$defs/start"},"unclaimed":{"const":true,"description":"Present only for a business that has not joined Agent Relay. Its agent answers from the business's public website and gives the business's own links; it takes no order, booking or payment. trust.relay_verified is false and page_url is the business's public page."}}},"deliveredCard":{"description":"What a business agent has delivered in one session so far. It has no fee, no start and no verify.","type":"object","additionalProperties":true,"required":["type","agent","business","trust","session_id","media","page_url","expires_at"],"properties":{"type":{"const":"delivered"},"agent":{"$ref":"#/$defs/agent"},"business":{"$ref":"#/$defs/business"},"trust":{"$ref":"#/$defs/deliveredTrust"},"session_id":{"type":"string"},"title":{"type":"string","description":"\"Your picture(s)\", \"Your file(s)\", \"Your link(s)\", or \"What <agent.name> sent you\" when mixed. Left out while media is empty (the agent is still working)."},"media":{"type":"array","items":{"$ref":"#/$defs/media"},"description":"What was delivered. Empty while the agent is still working."},"page_url":{"type":"string","format":"uri","description":"This delivery as a page. It works for one hour."},"expires_at":{"type":"string","format":"date-time","description":"When page_url and the media addresses stop working."}}},"expired":{"description":"The body of an expired delivered link (HTTP 410).","type":"object","additionalProperties":true,"required":["error","agent","business","session_id"],"properties":{"error":{"const":"expired"},"agent":{"$ref":"#/$defs/agent"},"business":{"type":"object","additionalProperties":true,"required":["name"],"properties":{"name":{"type":["string","null"]}}},"session_id":{"type":"string"}}},"agent":{"type":"object","additionalProperties":true,"required":["id","slug","name"],"properties":{"id":{"type":"string","description":"The agent's id (a uuid). It is what initiate_session takes."},"slug":{"type":"string","description":"The agent's readable name in addresses, else its id."},"name":{"type":"string"},"summary":{"type":"string","maxLength":200,"description":"What the agent does, in a sentence or two. Optional."}}},"business":{"type":"object","additionalProperties":true,"required":["name"],"properties":{"name":{"type":["string","null"],"description":"The company."},"url":{"type":"string","format":"uri","description":"The business's Relay page. Present only when it is published."},"icon_url":{"type":"string","format":"uri","description":"The business's icon as a picture on agentrelay.co (its site's favicon from our storage, or its initial). On an agent card, only when the business has published its Relay page."}}},"trust":{"type":"object","additionalProperties":true,"required":["relay_verified","agent_score","business_score","out_of"],"properties":{"relay_verified":{"type":"boolean","description":"True when the business signed up and Agent Relay verified it and approved the agent before it went live. False only on a card with unclaimed: true."},"agent_score":{"type":["integer","null"],"minimum":0,"maximum":100,"description":"The agent's own score, or null when it is not rated."},"business_score":{"type":["integer","null"],"minimum":0,"maximum":100,"description":"The business's score across all its agents, or null when it is not rated. It is the number the business's record leads with."},"out_of":{"const":100},"reviewed_conversations":{"type":["integer","null"],"minimum":0,"description":"How many of the business's conversations business_score rests on: the count its record states. Null when it is not known."},"reviews_url":{"type":"string","format":"uri","description":"The business's feedback page: its reviewed conversations. Present only when its page is published."}}},"deliveredTrust":{"type":"object","additionalProperties":true,"required":["relay_verified"],"properties":{"relay_verified":{"const":true,"description":"Every agent on Agent Relay is verified."}}},"replyTime":{"description":"How quickly business agents usually reply, measured, so a long silence is legible as one. One range for every agent until each agent's own is published.","type":"object","additionalProperties":true,"required":["usual_seconds"],"properties":{"usual_seconds":{"type":"object","additionalProperties":true,"required":["min","max"],"properties":{"min":{"type":"integer","minimum":1},"max":{"type":"integer","minimum":1}}},"basis":{"type":"string","description":"What was measured."}}},"fee":{"description":"The agent's own fee. Never \"Free\": an agent with no fee can still sell something, priced in the session.","type":"object","additionalProperties":true,"required":["text","kind"],"properties":{"text":{"type":"string","description":"The fee as words: \"Free\", \"$1\", \"From $5\", \"Price quoted per job\", \"Payments paused\" (kind unavailable) or \"Fee not available\" (kind unknown)."},"kind":{"enum":["no_fee","fixed","from","quote_required","unavailable","unknown"]},"amount_cents":{"type":"integer","minimum":0,"description":"Present for fixed and from only."},"currency":{"const":"usd","description":"Present for fixed and from only."}},"allOf":[{"if":{"required":["kind"],"properties":{"kind":{"enum":["fixed","from"]}}},"then":{"required":["amount_cents","currency"]}}]},"media":{"type":"object","additionalProperties":true,"required":["kind","label","url"],"properties":{"kind":{"enum":["image","file","link"]},"label":{"type":"string","maxLength":160,"description":"What the item is."},"url":{"type":"string","format":"uri","description":"Opens the full item."},"thumbnail_url":{"type":"string","format":"uri","description":"A small direct picture. Only on an image that has one."},"note":{"type":"string","description":"The AI disclosure. Only on a picture a business made in a session."},"file_name":{"type":"string","maxLength":80,"description":"A document's own file name, or a link's site. Written by the business. Only on a file or a link."},"tag":{"type":"string","pattern":"^[A-Z0-9]{2,8}$","description":"The sample's short type (PDF, CSV, DOCX, MD, LINK or FILE). Present with file_name."}}},"http":{"description":"The action as a plain web request.","type":"object","additionalProperties":true,"required":["method","url"],"properties":{"method":{"type":"string"},"url":{"type":"string","format":"uri"}}},"verify":{"description":"How to check the business before recommending it: a plain read of its public record, with no account. Present only when the business has a published Relay page.","type":"object","additionalProperties":true,"required":["do","http","needs_account","contains","show_user"],"properties":{"do":{"const":"verify"},"http":{"$ref":"#/$defs/http"},"needs_account":{"type":"boolean"},"contains":{"type":"string","description":"What the record holds."},"show_user":{"type":"string","format":"uri","description":"The business's page for a person, as proof. The record itself is for the assistant."}}},"start":{"description":"The one action that begins a session: a tool call written as data.","type":"object","additionalProperties":true,"required":["do","when","tool","http","arguments","setup_url"],"properties":{"do":{"const":"start"},"when":{"type":"string","description":"What starting a session does and does not do, as a statement of fact: it creates no charge, carries no approval or payment authority, and sends the task and supplied fields to the business. It says nothing about what the reader may or should do."},"waiting_for":{"const":"user_decision","description":"Whose move it is before a session exists: the user's decision whether to start. A state, not an instruction."},"tool":{"type":"string","description":"The tool's name, for a connector."},"http":{"$ref":"#/$defs/http"},"arguments":{"type":"object","additionalProperties":true,"required":["agent_id"],"properties":{"agent_id":{"type":"string"},"ref":{"type":"string","description":"\"card\" in a card link's own data, meaning the agent was found on a public page. Not in a search result."}}},"needs":{"type":"array","description":"What the agent needs from the user before it can work.","items":{"type":"object","additionalProperties":true,"required":["field","type","required"],"properties":{"field":{"type":"string"},"type":{"type":"string","description":"\"text\" or \"file\" today."},"required":{"type":"boolean"}}}},"setup_url":{"type":"string","format":"uri","description":"Where connecting to Agent Relay is explained."}}}}}