{"openapi":"3.0.3","info":{"title":"TAG Lending Group Public API","version":"1.0.0","description":"Public, read-only facts about TAG Lending Group LLC (NMLS #2329372), a wholesale and non-delegated correspondent mortgage lender. No rates, pricing or borrower data. Versioning and deprecation: the version is in the URL (/api/v1). Breaking changes ship under a new version, and a deprecated version announces its retirement with Deprecation and Sunset response headers at least 90 days before removal. Not a commitment to lend. Equal Housing Lender. TAG Lending Group LLC, NMLS #2329372."},"servers":[{"url":"https://api.taglendinggroup.com"}],"paths":{"/api/v1/company":{"get":{"operationId":"getCompany","summary":"Company information","description":"Who TAG is, NMLS number and audience served.","security":[{"oauth2":["company:read"]}],"responses":{"200":{"description":"Company","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Company"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}}}},"/api/v1/licensing":{"get":{"operationId":"getLicensing","summary":"Licensed states","description":"States where TAG is a lender and where it is broker-only.","security":[{"oauth2":["licensing:read"]}],"responses":{"200":{"description":"Licensing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Licensing"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}}}},"/api/v1/contact":{"get":{"operationId":"getContact","summary":"Public contact details","description":"Office address, phone and hours.","security":[{"oauth2":["contact:read"]}],"responses":{"200":{"description":"Contact","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Contact"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}}}},"/api/v1/programs":{"get":{"operationId":"listPrograms","summary":"Loan program pages","parameters":[{"name":"limit","in":"query","required":false,"description":"Page size, 1 to 50 (default 25).","schema":{"type":"integer","minimum":1,"maximum":50,"default":25}},{"name":"cursor","in":"query","required":false,"description":"Opaque cursor from next_cursor of the previous page.","schema":{"type":"string"}}],"description":"Links to public loan program pages. No rates or pricing.","security":[{"oauth2":["programs:read"]}],"responses":{"200":{"description":"Programs","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Programs"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}}}},"/ask":{"post":{"operationId":"askTag","summary":"NLWeb question endpoint","description":"Ask a question about TAG public pages. NLWeb v0.55. Set prefer.streaming=true for SSE.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["query"],"properties":{"query":{"type":"object","required":["text"],"properties":{"text":{"type":"string","description":"The question"}}},"prefer":{"type":"object","properties":{"streaming":{"type":"boolean"}}}}}}}},"responses":{"200":{"description":"NLWeb response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NLWebResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/oauth/register":{"post":{"operationId":"registerClient","summary":"Register an anonymous client","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Optional. Repeating a request with the same key returns the same client credentials, so retries are safe.","schema":{"type":"string","maxLength":128}}],"description":"Returns client_id and client_secret. No body required.","responses":{"201":{"description":"Client credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientCredentials"}}}},"429":{"description":"Too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/oauth/token":{"post":{"operationId":"getToken","summary":"Exchange client credentials for an access token","description":"grant_type=client_credentials with client_id, client_secret and optional scope.","requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["grant_type","client_id","client_secret"],"properties":{"grant_type":{"type":"string","enum":["client_credentials"]},"client_id":{"type":"string"},"client_secret":{"type":"string"},"scope":{"type":"string"}}}}}},"responses":{"200":{"description":"Access token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenResponse"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthError"}}}},"401":{"description":"Invalid client","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthError"}}}}}}}},"components":{"securitySchemes":{"oauth2":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"https://api.taglendinggroup.com/oauth/token","scopes":{"company:read":"Read public company information","licensing:read":"Read states where TAG is licensed as lender or broker","contact:read":"Read public office and contact details","programs:read":"Read links to public loan program pages (no rates or pricing)"}}}}},"responses":{"Unauthorized":{"description":"Missing or invalid token","headers":{"WWW-Authenticate":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Forbidden":{"description":"Token lacks the required scope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"schemas":{"ClientCredentials":{"type":"object","properties":{"client_id":{"type":"string"},"client_secret":{"type":"string"},"token_endpoint":{"type":"string"}}},"TokenResponse":{"type":"object","properties":{"access_token":{"type":"string"},"token_type":{"type":"string"},"expires_in":{"type":"integer"},"scope":{"type":"string"}}},"OAuthError":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"}}},"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"docs":{"type":"string"}}}}},"Company":{"type":"object","properties":{"name":{"type":"string"},"nmls":{"type":"string"},"type":{"type":"string"},"city":{"type":"string"},"audience":{"type":"string"},"disclaimer":{"type":"string"}}},"Licensing":{"type":"object","properties":{"lender":{"type":"array","items":{"type":"string"}},"broker_only":{"type":"array","items":{"type":"string"}},"note":{"type":"string"}}},"Contact":{"type":"object","properties":{"phone":{"type":"string"},"address":{"type":"string"},"hours":{"type":"string"},"url":{"type":"string"}}},"Programs":{"type":"object","properties":{"total":{"type":"integer"},"next_cursor":{"type":"string","nullable":true},"programs":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"url":{"type":"string"}}}},"note":{"type":"string"}}},"NLWebResponse":{"type":"object","properties":{"_meta":{"type":"object","properties":{"response_type":{"type":"string"},"version":{"type":"string"}}},"results":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string"},"name":{"type":"string"},"site":{"type":"string"},"score":{"type":"number"},"description":{"type":"string"}}}}}}}}}