{"openapi":"3.1.0","info":{"title":"OmniCredit API","version":"1.0.0","description":"The API of OmniCredit. Every call needs an API key: Authorization: Bearer omc_…\n\nEach path is sent as ?path=… to the API address, e.g. https://omnicredit.app/functions/api?path=/v1/products"},"servers":[{"url":"https://omnicredit.app/functions/api"}],"x-path-style":"query","x-scopes":{"products:read":"Loan products and branches","applications:read":"Loan applications and their status","clients:read":"Clients and loans from the core system","portfolio:read":"Portfolio figures: outstanding, PAR, arrears, collections","leads:read":"Leads","leads:write":"Create leads","posts:read":"Publishing: posts and their results","posts:write":"Publishing: create drafts, schedule and publish posts"},"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","bearerFormat":"omc_…"}}},"security":[{"apiKey":[]}],"paths":{"/v1/company":{"get":{"operationId":"getCompany","summary":"The company and this key","description":"Name, website, languages and what this key may do.","tags":["company"],"x-mcp-tool":"get_company","x-scope":null,"parameters":[],"responses":{"200":{"description":"OK"},"400":{"description":"Invalid input"},"401":{"description":"Missing or invalid key"},"403":{"description":"Missing scope"},"404":{"description":"Not found"},"429":{"description":"Too many calls"}}}},"/v1/products":{"get":{"operationId":"listProducts","summary":"Loan products","description":"The active loan products with rates, amounts and terms.\n\nScope: `products:read`","tags":["products"],"x-mcp-tool":"list_products","x-scope":"products:read","parameters":[],"responses":{"200":{"description":"OK"},"400":{"description":"Invalid input"},"401":{"description":"Missing or invalid key"},"403":{"description":"Missing scope"},"404":{"description":"Not found"},"429":{"description":"Too many calls"}}}},"/v1/branches":{"get":{"operationId":"listBranches","summary":"Branches","description":"Branches with address, phone and working hours.\n\nScope: `products:read`","tags":["branches"],"x-mcp-tool":"list_branches","x-scope":"products:read","parameters":[],"responses":{"200":{"description":"OK"},"400":{"description":"Invalid input"},"401":{"description":"Missing or invalid key"},"403":{"description":"Missing scope"},"404":{"description":"Not found"},"429":{"description":"Too many calls"}}}},"/v1/applications":{"get":{"operationId":"listApplications","summary":"Loan applications","description":"Applications, newest first. Filter by status, date or text (name, phone, e-mail, number).\n\nScope: `applications:read`","tags":["applications"],"x-mcp-tool":"search_applications","x-scope":"applications:read","parameters":[{"name":"status","in":"query","required":false,"description":"Status","schema":{"type":"string","enum":["new_application","documents_review","credit_scoring","approved","disbursed","active_loan","closed","rejected"]}},{"name":"from","in":"query","required":false,"description":"Created on or after (YYYY-MM-DD)","schema":{"type":"string"}},{"name":"to","in":"query","required":false,"description":"Created on or before (YYYY-MM-DD)","schema":{"type":"string"}},{"name":"q","in":"query","required":false,"description":"Text to find","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"description":"How many to return (1–100, default 25).","schema":{"type":"number"}},{"name":"offset","in":"query","required":false,"description":"Where to start (from next_offset).","schema":{"type":"number"}}],"responses":{"200":{"description":"OK"},"400":{"description":"Invalid input"},"401":{"description":"Missing or invalid key"},"403":{"description":"Missing scope"},"404":{"description":"Not found"},"429":{"description":"Too many calls"}}}},"/v1/applications/{id}":{"get":{"operationId":"getApplication","summary":"One application","description":"One application with its timeline and documents (names and status).\n\nScope: `applications:read`","tags":["applications"],"x-mcp-tool":"get_application","x-scope":"applications:read","parameters":[{"name":"id","in":"path","required":true,"description":"Application id","schema":{"type":"string"}}],"responses":{"200":{"description":"OK"},"400":{"description":"Invalid input"},"401":{"description":"Missing or invalid key"},"403":{"description":"Missing scope"},"404":{"description":"Not found"},"429":{"description":"Too many calls"}}}},"/v1/clients":{"get":{"operationId":"listClients","summary":"Clients","description":"Clients from the core system. Search by name, phone, e-mail or personal number.\n\nScope: `clients:read`","tags":["clients"],"x-mcp-tool":"search_clients","x-scope":"clients:read","parameters":[{"name":"q","in":"query","required":false,"description":"Text to find","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"description":"How many to return (1–100, default 25).","schema":{"type":"number"}},{"name":"offset","in":"query","required":false,"description":"Where to start (from next_offset).","schema":{"type":"number"}}],"responses":{"200":{"description":"OK"},"400":{"description":"Invalid input"},"401":{"description":"Missing or invalid key"},"403":{"description":"Missing scope"},"404":{"description":"Not found"},"429":{"description":"Too many calls"}}}},"/v1/clients/{id}":{"get":{"operationId":"getClient","summary":"One client and their loans","description":"A client from the core system with every loan, balance and days past due.\n\nScope: `clients:read`","tags":["clients"],"x-mcp-tool":"get_client","x-scope":"clients:read","parameters":[{"name":"id","in":"path","required":true,"description":"Client id in the core system","schema":{"type":"string"}}],"responses":{"200":{"description":"OK"},"400":{"description":"Invalid input"},"401":{"description":"Missing or invalid key"},"403":{"description":"Missing scope"},"404":{"description":"Not found"},"429":{"description":"Too many calls"}}}},"/v1/loans":{"get":{"operationId":"listLoans","summary":"Loans","description":"Loans from the core system. Filter to late ones with min_days_past_due.\n\nScope: `clients:read`","tags":["loans"],"x-mcp-tool":"list_loans","x-scope":"clients:read","parameters":[{"name":"min_days_past_due","in":"query","required":false,"description":"Only loans this many days late or more","schema":{"type":"number"}},{"name":"status","in":"query","required":false,"description":"active (default) or all","schema":{"type":"string","enum":["active","all"]}},{"name":"branch","in":"query","required":false,"description":"Branch name","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"description":"How many to return (1–100, default 25).","schema":{"type":"number"}},{"name":"offset","in":"query","required":false,"description":"Where to start (from next_offset).","schema":{"type":"number"}}],"responses":{"200":{"description":"OK"},"400":{"description":"Invalid input"},"401":{"description":"Missing or invalid key"},"403":{"description":"Missing scope"},"404":{"description":"Not found"},"429":{"description":"Too many calls"}}}},"/v1/portfolio":{"get":{"operationId":"getPortfolio","summary":"Portfolio summary","description":"Outstanding portfolio, PAR30/PAR90, arrears buckets, collections and disbursements this month, by product and branch.\n\nScope: `portfolio:read`","tags":["portfolio"],"x-mcp-tool":"portfolio_summary","x-scope":"portfolio:read","parameters":[],"responses":{"200":{"description":"OK"},"400":{"description":"Invalid input"},"401":{"description":"Missing or invalid key"},"403":{"description":"Missing scope"},"404":{"description":"Not found"},"429":{"description":"Too many calls"}}}},"/v1/leads":{"get":{"operationId":"listLeads","summary":"Leads","description":"Leads from ads, the website and conversations, newest first.\n\nScope: `leads:read`","tags":["leads"],"x-mcp-tool":"list_leads","x-scope":"leads:read","parameters":[{"name":"status","in":"query","required":false,"description":"Lead status","schema":{"type":"string"}},{"name":"source","in":"query","required":false,"description":"meta, google, linkedin, tiktok, web, chat, manual, other","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"description":"How many to return (1–100, default 25).","schema":{"type":"number"}},{"name":"offset","in":"query","required":false,"description":"Where to start (from next_offset).","schema":{"type":"number"}}],"responses":{"200":{"description":"OK"},"400":{"description":"Invalid input"},"401":{"description":"Missing or invalid key"},"403":{"description":"Missing scope"},"404":{"description":"Not found"},"429":{"description":"Too many calls"}}},"post":{"operationId":"createLead","summary":"Create a lead","description":"Adds a lead. It is assigned to an officer, summarised by AI and sent to Terra like any other lead.\n\nScope: `leads:write`","tags":["leads"],"x-mcp-tool":"create_lead","x-scope":"leads:write","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["full_name"],"properties":{"full_name":{"type":"string","description":"Name"},"phone":{"type":"string","description":"Phone (international format)"},"email":{"type":"string","description":"E-mail"},"city":{"type":"string","description":"City"},"product_interest":{"type":"string","description":"Product the person wants"},"amount":{"type":"number","description":"Amount wanted"},"notes":{"type":"string","description":"Anything else"},"external_id":{"type":"string","description":"Your id, to avoid duplicates"}}}}}},"responses":{"200":{"description":"OK"},"400":{"description":"Invalid input"},"401":{"description":"Missing or invalid key"},"403":{"description":"Missing scope"},"404":{"description":"Not found"},"429":{"description":"Too many calls"}}}},"/v1/publish/accounts":{"get":{"operationId":"listPublishAccounts","summary":"Places to publish","description":"Connected pages and channels: Facebook, Instagram, LinkedIn, TikTok, Viber, Telegram, blog, financial education.\n\nScope: `posts:read`","tags":["publish"],"x-mcp-tool":"list_publish_accounts","x-scope":"posts:read","parameters":[],"responses":{"200":{"description":"OK"},"400":{"description":"Invalid input"},"401":{"description":"Missing or invalid key"},"403":{"description":"Missing scope"},"404":{"description":"Not found"},"429":{"description":"Too many calls"}}}},"/v1/publish/posts":{"get":{"operationId":"listPosts","summary":"Posts","description":"Posts with their status and the result on each network.\n\nScope: `posts:read`","tags":["publish"],"x-mcp-tool":"list_posts","x-scope":"posts:read","parameters":[{"name":"status","in":"query","required":false,"description":"Status","schema":{"type":"string","enum":["draft","scheduled","publishing","published","partial","failed"]}},{"name":"limit","in":"query","required":false,"description":"How many to return (1–100, default 25).","schema":{"type":"number"}},{"name":"offset","in":"query","required":false,"description":"Where to start (from next_offset).","schema":{"type":"number"}}],"responses":{"200":{"description":"OK"},"400":{"description":"Invalid input"},"401":{"description":"Missing or invalid key"},"403":{"description":"Missing scope"},"404":{"description":"Not found"},"429":{"description":"Too many calls"}}},"post":{"operationId":"createPost","summary":"Create, schedule or publish a post","description":"One post to the accounts you pick. when = draft (default), schedule (needs scheduled_at) or now. Media must be public https URLs.\n\nScope: `posts:write`","tags":["publish"],"x-mcp-tool":"create_post","x-scope":"posts:write","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["text"],"properties":{"text":{"type":"string","description":"The text"},"title":{"type":"string","description":"Title, for blog and financial education"},"account_ids":{"type":"array","items":{"type":"string"},"description":"Accounts from /v1/publish/accounts"},"variants":{"type":"object","description":"Text per network, e.g. {\"instagram\": \"…\"}"},"media":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string"},"type":{"type":"string","enum":["image","video"]}}},"description":"Photos or a video: [{url, type}]"},"link":{"type":"string","description":"A link"},"when":{"type":"string","enum":["draft","schedule","now"],"description":"What to do"},"scheduled_at":{"type":"string","description":"ISO date and time, for schedule"}}}}}},"responses":{"200":{"description":"OK"},"400":{"description":"Invalid input"},"401":{"description":"Missing or invalid key"},"403":{"description":"Missing scope"},"404":{"description":"Not found"},"429":{"description":"Too many calls"}}}}}}