{"openapi":"3.1.0","info":{"title":"Trelice Public Website API","version":"1.0.0","description":"Public, unauthenticated endpoints for read-only search, requesting a Trelice demo, and suggesting a protocol-derived document. The marketing operations create an external follow-up or internal review side effect; agents should call them only with the user’s explicit approval.","contact":{"name":"Trelice","url":"https://www.trelice.com/developers","email":"hello@trelice.com"}},"externalDocs":{"description":"Trelice developer resources and agent usage guidance","url":"https://www.trelice.com/developers"},"servers":[{"url":"https://www.trelice.com","description":"Trelice production website"}],"security":[],"tags":[{"name":"Discovery","description":"Read-only, grounded discovery over authoritative public Trelice pages."},{"name":"Contact","description":"Side-effecting marketing contact operations. No authentication is required."}],"paths":{"/api/leads":{"post":{"tags":["Contact"],"operationId":"requestTreliceDemo","summary":"Request a Trelice demo","description":"Validates the contact details and sends a demo request to Trelice. This operation creates a real follow-up request and must not be called without the user’s explicit approval.","requestBody":{"required":true,"description":"Contact and optional audience context for the demo request.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["email"],"properties":{"name":{"type":"string","maxLength":200,"description":"Full contact name. Required unless firstName and lastName are both supplied."},"firstName":{"type":"string","maxLength":100,"description":"First name used by the website form. Supply with lastName when name is omitted."},"lastName":{"type":"string","maxLength":100,"description":"Last name used by the website form. Supply with firstName when name is omitted."},"email":{"type":"string","format":"email","maxLength":200,"description":"Work email for the reply."},"company":{"type":"string","maxLength":200,"description":"Company or organization name."},"role":{"type":"string","maxLength":100,"description":"Job role or title."},"message":{"type":"string","maxLength":4000,"description":"What the contact wants to evaluate or solve."},"teamSize":{"type":"string","maxLength":50,"description":"Approximate team size."},"timeline":{"type":"string","maxLength":100,"description":"Expected evaluation or buying timeline."},"companyType":{"type":"string","enum":["sponsor","cro","research-site"],"description":"Optional Trelice audience category used to tailor the demo."},"persona":{"type":"string","enum":["clinical-science","clinical-operations","medical-writing","regulatory-affairs","quality-assurance","executive-leadership","project-clinical-operations","study-start-up","medical-writing-document-services","regulatory-affairs","quality-assurance","executive-business-development","clinical-research-coordinator","principal-investigator","site-director-owner"],"description":"Optional role slug. It must belong to the supplied companyType."},"sourcePage":{"type":"string","maxLength":300,"pattern":"^/","description":"Optional same-site path where the request originated."}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","additionalProperties":false,"required":["email"],"properties":{"name":{"type":"string","maxLength":200,"description":"Full contact name. Required unless firstName and lastName are both supplied."},"firstName":{"type":"string","maxLength":100,"description":"First name used by the website form. Supply with lastName when name is omitted."},"lastName":{"type":"string","maxLength":100,"description":"Last name used by the website form. Supply with firstName when name is omitted."},"email":{"type":"string","format":"email","maxLength":200,"description":"Work email for the reply."},"company":{"type":"string","maxLength":200,"description":"Company or organization name."},"role":{"type":"string","maxLength":100,"description":"Job role or title."},"message":{"type":"string","maxLength":4000,"description":"What the contact wants to evaluate or solve."},"teamSize":{"type":"string","maxLength":50,"description":"Approximate team size."},"timeline":{"type":"string","maxLength":100,"description":"Expected evaluation or buying timeline."},"companyType":{"type":"string","enum":["sponsor","cro","research-site"],"description":"Optional Trelice audience category used to tailor the demo."},"persona":{"type":"string","enum":["clinical-science","clinical-operations","medical-writing","regulatory-affairs","quality-assurance","executive-leadership","project-clinical-operations","study-start-up","medical-writing-document-services","regulatory-affairs","quality-assurance","executive-business-development","clinical-research-coordinator","principal-investigator","site-director-owner"],"description":"Optional role slug. It must belong to the supplied companyType."},"sourcePage":{"type":"string","maxLength":300,"pattern":"^/","description":"Optional same-site path where the request originated."}}}}}},"responses":{"200":{"description":"The demo request was accepted for delivery.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LeadSuccess"}}}},"400":{"description":"The submitted contact data is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"The request body exceeds the allowed size.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Trelice could not deliver the request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/document-suggestions":{"post":{"tags":["Contact"],"operationId":"suggestTreliceDocument","summary":"Suggest a protocol-derived document","description":"Submits a requested document type for Trelice product review. This operation creates a real internal submission and must not be called without the user’s explicit approval.","requestBody":{"required":true,"description":"The audience role and document suggestion.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["companyType","persona","suggestion"],"properties":{"companyType":{"type":"string","enum":["cro","research-site"],"description":"Audience category eligible to suggest a protocol-derived document."},"persona":{"type":"string","enum":["project-clinical-operations","study-start-up","medical-writing-document-services","regulatory-affairs","quality-assurance","executive-business-development","clinical-research-coordinator","principal-investigator","site-director-owner"],"description":"Role slug belonging to the supplied companyType."},"suggestion":{"type":"string","minLength":2,"maxLength":1000,"description":"The protocol-derived document or workflow output being requested."},"email":{"type":"string","format":"email","maxLength":200,"description":"Optional work email for follow-up."},"sourcePage":{"type":"string","maxLength":300,"pattern":"^/solutions/","description":"Optional Trelice solution page where the suggestion originated."}}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","additionalProperties":false,"required":["companyType","persona","suggestion"],"properties":{"companyType":{"type":"string","enum":["cro","research-site"],"description":"Audience category eligible to suggest a protocol-derived document."},"persona":{"type":"string","enum":["project-clinical-operations","study-start-up","medical-writing-document-services","regulatory-affairs","quality-assurance","executive-business-development","clinical-research-coordinator","principal-investigator","site-director-owner"],"description":"Role slug belonging to the supplied companyType."},"suggestion":{"type":"string","minLength":2,"maxLength":1000,"description":"The protocol-derived document or workflow output being requested."},"email":{"type":"string","format":"email","maxLength":200,"description":"Optional work email for follow-up."},"sourcePage":{"type":"string","maxLength":300,"pattern":"^/solutions/","description":"Optional Trelice solution page where the suggestion originated."}}}}}},"responses":{"201":{"description":"The document suggestion was accepted for review.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuggestionSuccess"}}}},"400":{"description":"The submitted suggestion is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"The request body exceeds the allowed size.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Trelice could not deliver the suggestion.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/ask":{"get":{"tags":["Discovery"],"operationId":"searchTrelicePublicContent","summary":"Search authoritative public Trelice content","description":"Runs deterministic, read-only lexical retrieval over public Trelice pages and documentation and returns an NLWeb 0.55 response. It does not call an LLM or access customer data.","parameters":[{"name":"query","in":"query","required":true,"description":"Natural-language question about Trelice.","schema":{"type":"string","maxLength":1000}},{"name":"streaming","in":"query","required":false,"description":"Return Server-Sent Events when true.","schema":{"type":"boolean","default":false}}],"responses":{"200":{"description":"Authoritative Trelice page matches in the NLWeb response envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NlWebResponse"}},"text/event-stream":{"schema":{"type":"string","description":"NLWeb response delivered as SSE events."}}}},"400":{"description":"The NLWeb query is missing or exceeds 1000 characters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NlWebResponse"}}}}}},"post":{"tags":["Discovery"],"operationId":"queryTrelicePublicContent","summary":"Query authoritative public Trelice content with NLWeb","description":"Accepts an NLWeb query object and returns grounded public-page matches. This read-only operation does not call an LLM, submit a form, or access customer data.","requestBody":{"required":true,"description":"NLWeb 0.55 query, optional context, preferences, and metadata.","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["query"],"properties":{"query":{"type":"object","additionalProperties":true,"required":["text"],"description":"Natural-language query and optional schema.org-style filters.","properties":{"text":{"type":"string","maxLength":1000,"description":"Natural-language question about Trelice."},"site":{"type":"string","description":"Optional site scope. The public endpoint searches trelice.com."}}},"context":{"type":"object","additionalProperties":true,"description":"Optional conversational context supplied by the caller."},"prefer":{"type":"object","additionalProperties":true,"description":"Optional NLWeb response preferences, including streaming and mode.","properties":{"streaming":{"type":"boolean","description":"Return Server-Sent Events when true."},"mode":{"type":"string","enum":["list"],"description":"The public endpoint supports grounded list retrieval."}}},"meta":{"type":"object","additionalProperties":true,"description":"Optional request, conversation, and protocol metadata."}}}}}},"responses":{"200":{"description":"Authoritative Trelice page matches in the NLWeb response envelope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NlWebResponse"}},"text/event-stream":{"schema":{"type":"string","description":"NLWeb response delivered as SSE events."}}}},"400":{"description":"The NLWeb query is missing or exceeds 1000 characters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NlWebResponse"}}}}}}}},"components":{"schemas":{"Error":{"type":"object","additionalProperties":false,"required":["ok","error","code","message","resolution"],"properties":{"ok":{"type":"boolean","const":false},"error":{"type":"string","description":"Backward-compatible human-readable error text."},"code":{"type":"string","enum":["INVALID_JSON","PAYLOAD_TOO_LARGE","VALIDATION_ERROR","ENDPOINT_NOT_FOUND","INTERNAL_ERROR"],"description":"Stable machine-readable error code."},"message":{"type":"string","description":"Human-readable explanation of the failure."},"resolution":{"type":"string","description":"Concrete guidance for correcting or recovering from the failure."}}},"LeadSuccess":{"type":"object","additionalProperties":false,"required":["ok","provider","delivered"],"properties":{"ok":{"type":"boolean","const":true},"provider":{"type":"string","enum":["mailto","log","hubspot","ses"]},"delivered":{"type":"boolean","description":"Whether the configured provider completed delivery."}}},"SuggestionSuccess":{"type":"object","additionalProperties":false,"required":["ok","provider","delivered","sourcePage"],"properties":{"ok":{"type":"boolean","const":true},"provider":{"type":"string","enum":["server-log","log","hubspot","ses"]},"delivered":{"type":"boolean","description":"Whether the configured provider completed delivery."},"sourcePage":{"type":"string","description":"Validated same-site path associated with the suggestion."}}},"NlWebResponse":{"type":"object","additionalProperties":false,"required":["_meta","content"],"properties":{"_meta":{"type":"object","additionalProperties":true,"required":["response_type","version"],"properties":{"response_type":{"type":"string","enum":["Answer","Elicitation"]},"version":{"type":"string","const":"0.55"},"conversation_id":{"type":"string"},"request_id":{"type":"string"}}},"content":{"type":"array","minItems":1,"items":{"oneOf":[{"type":"object","additionalProperties":false,"required":["type","text"],"properties":{"type":{"type":"string","const":"text"},"text":{"type":"string"}}},{"type":"object","additionalProperties":false,"required":["type","resource"],"properties":{"type":{"type":"string","const":"resource"},"resource":{"type":"object","additionalProperties":false,"required":["data"],"properties":{"uri":{"type":"string","format":"uri"},"mimeType":{"type":"string"},"data":{"oneOf":[{"type":"object","additionalProperties":true},{"type":"array","items":{"type":"object","additionalProperties":true}}]}}}}}]}}}}}}}