{"openapi":"3.1.0","info":{"title":"Unicorn Contracts API","version":"1.0.0","description":"Unicorn Contracts, your online tender office: every day it finds the open public tenders that suit your company and prepares the turnkey bid, ready to sign, within 48 hours. This API lets you read the public tenders matched to your company profile and get alerts in your own tools. Every tender comes from an official procurement notice (TED and national notice boards) with a link to the notice. Read only: the API does not start turnkey bids or any paid action; you request a bid from the dashboard (bidUrl). Rate limit: 300 requests per minute per account.","termsOfService":"https://contracts.unicornprivate.com/terms/","contact":{"url":"https://contracts.unicornprivate.com/docs"}},"servers":[{"url":"https://contracts.unicornprivate.com"}],"security":[{"bearer":[]}],"tags":[{"name":"Account"},{"name":"Tenders"},{"name":"Webhooks"}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","description":"API key ct_live_... created by an admin in the dashboard (Access tab). Shown once, stored only as a hash."}},"responses":{"Error":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"schemas":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"status":{"type":"integer"},"docs":{"type":"string"}}}}},"ListMeta":{"type":"object","properties":{"total":{"type":"integer"},"limit":{"type":"integer"},"offset":{"type":"integer"},"count":{"type":"integer"},"hasMore":{"type":"boolean"}}},"Lot":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"}}},"Tender":{"type":"object","properties":{"id":{"type":"string","description":"Tender id \"<source>:<key>\", for example ted:123456-2026. URL-encode it in paths."},"title":{"type":"string"},"buyer":{"type":["string","null"]},"country":{"type":["string","null"]},"buyerCountry":{"type":["string","null"]},"description":{"type":["string","null"]},"cpv":{"type":"array","items":{"type":"string"},"description":"CPV codes (8 digits), main object first"},"value":{"type":["number","null"]},"currency":{"type":["string","null"]},"publishedAt":{"type":["string","null"]},"deadline":{"type":["string","null"],"format":"date-time","description":"Submission deadline, ISO 8601 with offset"},"procedure":{"type":["string","null"],"description":"open | restricted | negotiated | direct | other"},"awardCriteria":{"type":["string","null"],"description":"price | quality | mixed | unknown"},"status":{"type":"string","description":"open | closed | awarded"},"noticeUrl":{"type":["string","null"],"description":"Official notice"},"documentsUrl":{"type":["string","null"]},"lots":{"type":"array","items":{"$ref":"#/components/schemas/Lot"}},"matched":{"type":"boolean","description":"true if the tender is matched to your profile"},"score":{"type":["integer","null"],"description":"Relevance to your profile, 0-100 (null if not matched)"},"matchedAt":{"type":["string","null"],"format":"date-time"},"pageUrl":{"type":"string","description":"Public page of the tender on Unicorn Contracts"},"bidUrl":{"type":"string","description":"Dashboard link to request the turnkey bid"}}},"DeadlineTender":{"allOf":[{"$ref":"#/components/schemas/Tender"},{"type":"object","properties":{"daysLeft":{"type":"integer"}}}]},"Profile":{"type":"object","properties":{"name":{"type":["string","null"]},"vat":{"type":["string","null"]},"country":{"type":["string","null"]},"website":{"type":["string","null"]},"cpv":{"type":"array","items":{"type":"string"}},"keywords":{"type":"array","items":{"type":"string"}},"countries":{"type":"array","items":{"type":"string"}},"region":{"type":["string","null"]},"reach":{"type":["string","null"],"description":"region | near | country | abroad"},"extraRegions":{"type":"array","items":{"type":"string"}},"size":{"type":["string","null"]},"employees":{"type":["integer","null"]},"certifications":{"type":"array","items":{"type":"string"}},"profileUrl":{"type":"string"}}},"Me":{"type":"object","properties":{"organization":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"country":{"type":["string","null"]}}},"key":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"prefix":{"type":"string"},"createdAt":{"type":"string"}}},"plan":{"type":"string"},"rateLimitPerMinute":{"type":"integer"},"eventTypes":{"type":"array","items":{"type":"string"}}}},"Webhook":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"types":{"type":"array","items":{"type":"string","enum":["tender.matched","tender.deadline"]}},"deadlineDays":{"type":"integer"},"active":{"type":"boolean"},"createdAt":{"type":"string"},"lastSuccessAt":{"type":["string","null"]},"lastFailureAt":{"type":["string","null"]},"secret":{"type":"string","description":"Signing secret, only in the creation response"}}},"WebhookCreate":{"type":"object","required":["url"],"properties":{"url":{"type":"string","description":"Public HTTPS URL (port 443)"},"types":{"type":"array","items":{"type":"string","enum":["tender.matched","tender.deadline"]},"description":"Default: all event types"},"deadlineDays":{"type":"integer","minimum":1,"maximum":30,"default":7,"description":"tender.deadline fires when a matched tender closes within this many days"}}},"WebhookTest":{"type":"object","properties":{"delivered":{"type":"boolean"},"status":{"type":"integer"},"error":{"type":["string","null"]}}},"Event":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["tender.matched","tender.deadline","test"]},"created":{"type":"string","format":"date-time"},"data":{"$ref":"#/components/schemas/DeadlineTender"}}}}},"paths":{"/v1/me":{"get":{"tags":["Account"],"summary":"Check the API key","description":"Organization, key and rate limit. Use it to test a connection.","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Me"},"meta":{"type":"object"}}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/v1/profile":{"get":{"tags":["Account"],"summary":"Company profile used for matching","description":"Sectors (CPV), keywords, countries and area. Change it in the dashboard (profileUrl).","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Profile"},"meta":{"type":"object"}}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/v1/tenders":{"get":{"tags":["Tenders"],"summary":"List open tenders matched to your profile","parameters":[{"name":"q","in":"query","required":false,"schema":{"type":"string"},"description":"Text in the title or the buyer"},{"name":"country","in":"query","required":false,"schema":{"type":"string"},"description":"ISO alpha-2, comma separated (IT,DE)"},{"name":"cpv","in":"query","required":false,"schema":{"type":"string"},"description":"CPV code or prefix (at least 2 digits)"},{"name":"minScore","in":"query","required":false,"schema":{"type":"integer","minimum":0,"maximum":100},"description":"Minimum relevance"},{"name":"minValue","in":"query","required":false,"schema":{"type":"number"},"description":"Minimum estimated value"},{"name":"maxValue","in":"query","required":false,"schema":{"type":"number"},"description":"Maximum estimated value"},{"name":"deadlineAfter","in":"query","required":false,"schema":{"type":"string","format":"date-time"},"description":"Deadline on or after"},{"name":"deadlineBefore","in":"query","required":false,"schema":{"type":"string","format":"date-time"},"description":"Deadline on or before"},{"name":"matchedSince","in":"query","required":false,"schema":{"type":"string","format":"date-time"},"description":"Matched on or after (new tenders)"},{"name":"sort","in":"query","required":false,"schema":{"type":"string","enum":["score","deadline","matched","published"],"default":"score"},"description":"Order"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":25},"description":"Page size"},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0},"description":"Items to skip"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Tender"}},"meta":{"$ref":"#/components/schemas/ListMeta"}}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/v1/tenders/{id}":{"get":{"tags":["Tenders"],"summary":"Get a tender","description":"Any tender in the database; matched and score tell if it is matched to your profile.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Tender id, URL-encoded (ted%3A123456-2026)"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Tender"},"meta":{"type":"object"}}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/v1/webhooks":{"get":{"tags":["Webhooks"],"summary":"List webhook endpoints","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Webhook"}}}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}},"post":{"tags":["Webhooks"],"summary":"Create a webhook endpoint","description":"Up to 10 per account. The response has the signing secret (only once) and a Location header for deletion.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookCreate"}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Webhook"},"meta":{"type":"object"}}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/v1/webhooks/{id}":{"delete":{"tags":["Webhooks"],"summary":"Delete a webhook endpoint","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"wh_..."}],"responses":{"204":{"description":"Deleted"},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/v1/webhooks/{id}/test":{"post":{"tags":["Webhooks"],"summary":"Send a test event","description":"Delivers a signed event of type \"test\" with an example tender, right away.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"wh_..."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/WebhookTest"},"meta":{"type":"object"}}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}}},"webhooks":{"tender.matched":{"post":{"summary":"A new tender is matched to your profile","description":"Signed with Unicorn-Contracts-Signature: t=<unix>,v1=<hex HMAC-SHA256 of \"<t>.<body>\">. Retries after 1, 5, 30, 120, 360, 720, 1440 minutes.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"}}}},"responses":{"200":{"description":"Any 2xx acknowledges the event"}}}},"tender.deadline":{"post":{"summary":"A matched open tender closes soon","description":"Signed with Unicorn-Contracts-Signature: t=<unix>,v1=<hex HMAC-SHA256 of \"<t>.<body>\">. Retries after 1, 5, 30, 120, 360, 720, 1440 minutes.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"}}}},"responses":{"200":{"description":"Any 2xx acknowledges the event"}}}}}}