{"openapi":"3.1.0","info":{"title":"Tinycord agent API","version":"1.0.0","summary":"Free Discord link shortener for AI agents: cover image + real link buttons.","description":"Create a short link that Discord unfurls as a component embed with a cover image and up to five https buttons. No account or API key. Free cards end with a \"Made with Tinycord\" link."},"servers":[{"url":"https://www.tinycord.com"}],"externalDocs":{"url":"https://www.tinycord.com/agents"},"paths":{"/api/v1/links":{"post":{"operationId":"createDiscordLink","summary":"Create a Discord link with buttons","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LinkInput"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LinkResult"}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Slug taken","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/links/{slug}":{"parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"}}],"get":{"operationId":"getDiscordLink","summary":"Read a link","responses":{"200":{"description":"OK"},"404":{"description":"Not found"}}},"patch":{"operationId":"updateDiscordLink","summary":"Replace the card behind a link","description":"Same URL, new content. Fields left out are removed. Discord recrawls in about 30 minutes.","security":[{"editToken":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LinkInput"}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LinkResult"}}}},"401":{"description":"Missing token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Wrong slug or token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"schemas":{"LinkInput":{"type":"object","properties":{"url":{"description":"Destination link. People who click the short link in a browser are sent here; Discord still shows the card. Becomes an \"Open\" button when no buttons are given.","type":"string","maxLength":2048},"title":{"description":"Bold heading on the card. Leave out for a buttons-only card.","type":"string","maxLength":180},"description":{"description":"Body text under the title. Discord markdown works.","type":"string","maxLength":2000},"image":{"description":"Cover image shown on the card. Leave out and the card is just text and buttons.","type":"string","maxLength":2048},"buttons":{"description":"Up to five link buttons.","maxItems":5,"type":"array","items":{"type":"object","properties":{"label":{"description":"Button text, e.g. \"Buy\". Needs a label, an emoji, or both.","type":"string","maxLength":80},"url":{"type":"string","maxLength":2048,"description":"Where the button goes. https only."},"emoji":{"description":"One unicode emoji shown before the label, e.g. \"🛒\".","type":"string","maxLength":32}},"required":["url"]}},"color":{"description":"Accent bar color as hex, e.g. #5865F2.","type":"string","pattern":"^#?[0-9a-fA-F]{6}$"},"slug":{"description":"Custom path for tinycord.com/p/{slug}. Random 7 characters when left out.","type":"string","maxLength":48}}},"LinkResult":{"type":"object","properties":{"url":{"type":"string","description":"Paste this in Discord."},"slug":{"type":"string"},"embed_json":{"type":"string","description":"The component embed JSON Discord reads."},"preview":{"type":"string","description":"Browser view of the card without the redirect."},"edit_token":{"type":"string","description":"Create only. Bearer token for PATCH. Store it; it is not shown again."},"attribution":{"type":"string"},"next":{"type":"string"}},"required":["url","slug","embed_json","preview"]},"Error":{"type":"object","properties":{"error":{"type":"string"},"docs":{"type":"string"}},"required":["error"]}},"securitySchemes":{"editToken":{"type":"http","scheme":"bearer","description":"edit_token from the create response"}}}}