{"openapi":"3.1.0","info":{"title":"Flared API","version":"1.11.0","description":"Create and edit short links and read their click analytics. Authenticate with an API token from Settings in the Flared app: `Authorization: Bearer flr_…`. Each token works in one workspace and only for its scopes. A token of a workspace member cannot use `domains:write`.","license":{"name":"AGPL-3.0-only","identifier":"AGPL-3.0-only"}},"servers":[{"url":"https://api.flared.page/v1"}],"security":[{"bearerAuth":[]}],"paths":{"/me":{"get":{"summary":"Describe the calling token and its workspace","description":"Needs no scope.","x-required-scopes":[],"responses":{"200":{"description":"The credential and the workspace it acts in.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Identity"}}}},"default":{"description":"An error. See the code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/links":{"get":{"summary":"List links, newest first","description":"Needs the `links:read` scope.","x-required-scopes":["links:read"],"parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":50}},{"name":"cursor","in":"query","schema":{"type":"string"}},{"name":"q","in":"query","description":"Search slugs and titles.","schema":{"type":"string","maxLength":100}},{"name":"domain","in":"query","description":"Only links on this domain, by its ID from GET /v1/domains.","schema":{"type":"string","maxLength":64}}],"responses":{"200":{"description":"A page of links.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LinkPage"}}}},"default":{"description":"An error. See the code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"summary":"Create a link","description":"Needs the `links:write` scope.","x-required-scopes":["links:write"],"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"Kept for 24 hours. Reuse it to retry safely.","schema":{"type":"string","minLength":1,"maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateLinkInput"}}}},"responses":{"201":{"description":"The link. A repeated request with the same key and input returns the stored result with `Idempotent-Replayed: true`.","content":{"application/json":{"schema":{"type":"object","properties":{"link":{"$ref":"#/components/schemas/Link"}},"required":["link"]}}}},"default":{"description":"An error. See the code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/links/import":{"post":{"summary":"Import links in bulk","description":"Needs the `links:write` scope.","x-required-scopes":["links:write"],"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"Kept for 24 hours. Reuse it with the same items to retry safely; each item is stored as `<key>:<index>`.","schema":{"type":"string","minLength":1,"maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportLinksInput"}}}},"responses":{"200":{"description":"One result for each item, in order. A repeated request with the same key and items returns the same results and creates nothing twice. A real run must fit the workspace’s hourly import allowance as a whole, or it answers 429 with Retry-After and creates nothing; a dry run uses none of it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportLinksResult"}}}},"default":{"description":"An error. See the code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/links/{id}":{"get":{"summary":"Read a link","description":"Needs the `links:read` scope.","x-required-scopes":["links:read"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The link.","content":{"application/json":{"schema":{"type":"object","properties":{"link":{"$ref":"#/components/schemas/Link"}},"required":["link"]}}}},"default":{"description":"An error. See the code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"summary":"Edit a link","description":"Needs the `links:write` scope.","x-required-scopes":["links:write"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateLinkInput"}}}},"responses":{"200":{"description":"The changed link.","content":{"application/json":{"schema":{"type":"object","properties":{"link":{"$ref":"#/components/schemas/Link"}},"required":["link"]}}}},"default":{"description":"An error. See the code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/links/{id}/analytics":{"get":{"summary":"Read click analytics for a link","description":"Needs the `analytics:read` scope.","x-required-scopes":["analytics:read"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"from","in":"query","schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}}],"responses":{"200":{"description":"UTC daily totals and breakdowns, clamped to the retention period.","content":{"application/json":{"schema":{"type":"object","properties":{"analytics":{"$ref":"#/components/schemas/LinkAnalytics"}},"required":["analytics"]}}}},"default":{"description":"An error. See the code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/links/{id}/preview-image":{"put":{"summary":"Set the image of a link card","description":"Needs the `links:write` scope and social previews on the plan (LINK_PREVIEW_REQUIRES_PLAN otherwise). Send the image itself as the body: PNG, JPEG, or WebP, at most 5 MB; 1200 x 630 pixels shows best. A new image replaces the old one.","x-required-scopes":["links:write"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"image/png":{"schema":{"type":"string","format":"binary"}},"image/jpeg":{"schema":{"type":"string","format":"binary"}},"image/webp":{"schema":{"type":"string","format":"binary"}}}},"responses":{"200":{"description":"The link with its new previewImage.","content":{"application/json":{"schema":{"type":"object","properties":{"link":{"$ref":"#/components/schemas/Link"}},"required":["link"]}}}},"default":{"description":"An error. See the code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"summary":"Remove the image of a link card","description":"Needs the `links:write` scope.","x-required-scopes":["links:write"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The link without previewImage.","content":{"application/json":{"schema":{"type":"object","properties":{"link":{"$ref":"#/components/schemas/Link"}},"required":["link"]}}}},"default":{"description":"An error. See the code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/links/{id}/qr":{"get":{"summary":"Download a QR code for a link","description":"Needs the `links:read` scope.","x-required-scopes":["links:read"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"format","in":"query","schema":{"type":"string","enum":["svg","png"],"default":"svg"}},{"name":"size","in":"query","description":"The image width and height in pixels.","schema":{"type":"integer","minimum":128,"maximum":2048,"default":512}},{"name":"download","in":"query","description":"Send 1 to download the image as a file.","schema":{"type":"string","enum":["1"]}}],"responses":{"200":{"description":"A QR code of the short URL, black on white.","content":{"image/svg+xml":{"schema":{"type":"string"}},"image/png":{"schema":{"type":"string","format":"binary"}}}},"default":{"description":"An error. See the code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/links/{id}/automations":{"get":{"summary":"List the automations applied to a link","description":"Needs the `links:read` scope.","x-required-scopes":["links:read"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The templates on the link, oldest application first.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LinkAutomationPage"}}}},"default":{"description":"An error. See the code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/links/{id}/automations/{automationId}":{"put":{"summary":"Apply an automation to a link","description":"Needs the `links:write` scope.","x-required-scopes":["links:write"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"automationId","in":"path","required":true,"schema":{"type":"string"},"description":"An automation ID from GET /v1/automations."}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApplyAutomationInput"}}}},"responses":{"200":{"description":"The templates on the link after the apply. A link takes at most 5 templates.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApplyLinkAutomationResult"}}}},"default":{"description":"An error. See the code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"summary":"Remove an automation from a link","description":"Needs the `links:write` scope.","x-required-scopes":["links:write"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"automationId","in":"path","required":true,"schema":{"type":"string"},"description":"An automation ID from GET /v1/automations."}],"responses":{"204":{"description":"Removed. The template stays in the workspace."},"default":{"description":"An error. See the code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/domains":{"get":{"summary":"List domains you can use","description":"Needs the `domains:read` scope.","x-required-scopes":["domains:read"],"responses":{"200":{"description":"Platform domains, then your workspace domains.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DomainPage"}}}},"default":{"description":"An error. See the code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"summary":"Add a custom domain","description":"Needs the `domains:write` scope and the workspace owner role.","x-required-scopes":["domains:write"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"hostname":{"type":"string","description":"A subdomain such as go.example.com."}},"required":["hostname"]}}}},"responses":{"200":{"description":"Your workspace already has this domain.","content":{"application/json":{"schema":{"type":"object","properties":{"domain":{"$ref":"#/components/schemas/Domain"}},"required":["domain"]}}}},"201":{"description":"The domain. Follow its setup next.","content":{"application/json":{"schema":{"type":"object","properties":{"domain":{"$ref":"#/components/schemas/Domain"}},"required":["domain"]}}}},"default":{"description":"An error. See the code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/domains/{id}":{"get":{"summary":"Read a domain","description":"Needs the `domains:read` scope.","x-required-scopes":["domains:read"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The domain.","content":{"application/json":{"schema":{"type":"object","properties":{"domain":{"$ref":"#/components/schemas/Domain"}},"required":["domain"]}}}},"default":{"description":"An error. See the code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"summary":"Remove a custom domain","description":"Needs the `domains:write` scope and the workspace owner role.","x-required-scopes":["domains:write"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Removed. Its links stop within a minute."},"default":{"description":"An error. See the code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/domains/{id}/check":{"post":{"summary":"Check a custom domain now","description":"Needs the `domains:write` scope and the workspace owner role.","x-required-scopes":["domains:write"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The domain after the check.","content":{"application/json":{"schema":{"type":"object","properties":{"domain":{"$ref":"#/components/schemas/Domain"}},"required":["domain"]}}}},"default":{"description":"An error. See the code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/hooks":{"post":{"summary":"Subscribe a hook to a link event","description":"Needs the `links:read` scope.","x-required-scopes":["links:read"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateHookInput"}}}},"responses":{"201":{"description":"The hook. A subscribe by the same person with the same event and target URL replaces their earlier hook. Workspaces without webhooks on their plan get WEBHOOK_LIMIT_REACHED, and so does the 51st live hook.","content":{"application/json":{"schema":{"type":"object","properties":{"hook":{"$ref":"#/components/schemas/Hook"}},"required":["hook"]}}}},"default":{"description":"An error. See the code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/hooks/{id}":{"delete":{"summary":"Delete a hook","description":"Needs the `links:read` scope.","x-required-scopes":["links:read"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"A hook ID from POST /v1/hooks."}],"responses":{"204":{"description":"Deleted. A member deletes their own hooks; the workspace owner deletes any."},"default":{"description":"An error. See the code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/usage":{"get":{"summary":"Read usage against the workspace limits","description":"Needs the `usage:read` scope.","x-required-scopes":["usage:read"],"responses":{"200":{"description":"Clicks in the current UTC month, links, domains, and limit warnings.","content":{"application/json":{"schema":{"type":"object","properties":{"usage":{"$ref":"#/components/schemas/Usage"}},"required":["usage"]}}}},"default":{"description":"An error. See the code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/export/links":{"get":{"summary":"Export every link","description":"Needs the `links:read` scope.","x-required-scopes":["links:read"],"parameters":[{"name":"cursor","in":"query","description":"The nextCursor of the previous page.","schema":{"type":"string"}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":1000,"default":1000}}],"responses":{"200":{"description":"Up to limit links, active and disabled, newest first. Follow nextCursor until it is null.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExportLinkPage"}}}},"default":{"description":"An error. See the code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/export/daily-totals":{"get":{"summary":"Export retained daily click totals","description":"Needs the `analytics:read` scope.","x-required-scopes":["analytics:read"],"parameters":[{"name":"cursor","in":"query","description":"The nextCursor of the previous page.","schema":{"type":"string"}}],"responses":{"200":{"description":"Up to 10000 rows by link and UTC day, within the retention period.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExportTotalsPage"}}}},"default":{"description":"An error. See the code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/export/daily-dimensions":{"get":{"summary":"Export retained daily breakdowns","description":"Needs the `analytics:read` scope.","x-required-scopes":["analytics:read"],"parameters":[{"name":"cursor","in":"query","description":"The nextCursor of the previous page.","schema":{"type":"string"}}],"responses":{"200":{"description":"Up to 10000 rows of clicks by link, UTC day, and country, device, referrer, browser, or OS, within the retention period.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExportDimensionsPage"}}}},"default":{"description":"An error. See the code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/automations":{"get":{"summary":"List the workspace’s automation templates","description":"Needs the `links:read` scope.","x-required-scopes":["links:read"],"responses":{"200":{"description":"Templates, oldest first. Each is a trigger, then its actions. The workspace owner creates them in the Flared app.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutomationPage"}}}},"default":{"description":"An error. See the code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/automations/{id}/links":{"post":{"summary":"Apply an automation to links","description":"Needs the `links:write` scope.","x-required-scopes":["links:write"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"An automation ID from GET /v1/automations."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApplyAutomationLinksInput"}}}},"responses":{"200":{"description":"One result for each link, in order; each link is applied or fails on its own. Applying again re-arms a template that already ran on a link.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApplyAutomationLinksResult"}}}},"default":{"description":"An error. See the code.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/openapi.json":{"get":{"summary":"This document","security":[],"responses":{"200":{"description":"The OpenAPI document."}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"An API token (flr_…), or an OAuth access token issued for this API."}},"schemas":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["INVALID_INPUT","INVALID_IMPORT","TOO_MANY_ITEMS","IDEMPOTENCY_KEY_REQUIRED","IDEMPOTENCY_KEY_REUSED","SLUG_TAKEN","DEFAULT_DOMAIN_UNAVAILABLE","DOMAIN_UNAVAILABLE","PLAN_LIMIT_REACHED","DOMAIN_TAKEN","DOMAIN_LIMIT_REACHED","DOMAINS_UNAVAILABLE","DOMAIN_CHECK_TOO_SOON","RATE_LIMITED","UNAUTHENTICATED","ORIGIN_REJECTED","INSUFFICIENT_SCOPE","REAUTH_REQUIRED","TOKEN_LIMIT_REACHED","NO_WORKSPACE","WORKSPACE_PENDING","ACCOUNT_DELETING","WORKSPACE_SUSPENDED","WORKSPACE_CHANGED","WORKSPACE_LIMIT_REACHED","OWNER_REQUIRED","MEMBER_LIMIT_REACHED","WEBHOOK_LIMIT_REACHED","AUTOMATION_LIMIT_REACHED","LINK_AUTOMATION_LIMIT_REACHED","ALREADY_MEMBER","INVITE_PENDING","INVITE_FOR_ANOTHER_EMAIL","OWNER_CANNOT_LEAVE","LINK_ACCESS_REQUIRES_PLAN","LINK_PREVIEW_REQUIRES_PLAN","LINK_BLOCKED","NOT_FOUND","METHOD_NOT_ALLOWED","PAYLOAD_TOO_LARGE","UNSUPPORTED_MEDIA_TYPE","SERVICE_UNAVAILABLE"]},"message":{"type":"string"},"requestId":{"type":"string"},"field":{"type":"string","description":"The input that failed validation."}},"required":["code","message","requestId"]}},"required":["error"]},"Scope":{"type":"string","enum":["links:read","links:write","analytics:read","domains:read","domains:write","usage:read"]},"Link":{"type":"object","properties":{"id":{"type":"string"},"domainId":{"type":"string"},"hostname":{"type":"string"},"slug":{"type":"string"},"shortUrl":{"type":"string","format":"uri"},"destination":{"type":"string","format":"uri"},"title":{"anyOf":[{"type":"string"},{"type":"null"}]},"iosDestination":{"anyOf":[{"type":"string","maxLength":4096,"description":"Where iPhone visitors go instead of destination: an http(s) URL or an app link in the scheme://… form. Link previews and other visitors get destination."},{"type":"null"}]},"androidDestination":{"anyOf":[{"type":"string","maxLength":4096,"description":"Where Android visitors go instead of destination: an http(s) URL or an app link in the scheme://… form, including intent://. Link previews and other visitors get destination."},{"type":"null"}]},"startsAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"The link opens at this time; null is now."},"endsAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"The link stops at this time; null is never."},"endedDestination":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}],"description":"Where visitors go after endsAt."},"hasPassword":{"type":"boolean","description":"Visitors enter a password before the redirect."},"previewTitle":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The title that link cards show; null uses the destination page title."},"previewDescription":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"The description that link cards show; null uses the destination page."},"previewImage":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}],"description":"The image that link cards show, on the short-link host. Set it with PUT /links/{id}/preview-image."},"enabled":{"type":"boolean"},"blocked":{"anyOf":[{"type":"object","properties":{"reason":{"type":"string","enum":["phishing","malware","spam","illegal","other"]}},"required":["reason"]},{"type":"null"}],"description":"Set while Flared blocks the link for abuse. A blocked link does not redirect and cannot be edited or turned on."},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","domainId","hostname","slug","shortUrl","destination","title","iosDestination","androidDestination","startsAt","endsAt","endedDestination","hasPassword","previewTitle","previewDescription","previewImage","enabled","blocked","createdAt","updatedAt"]},"ListedLink":{"allOf":[{"$ref":"#/components/schemas/Link"},{"type":"object","properties":{"clicksLast30Days":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}],"description":"Clicks in the last 30 UTC days; null when analytics are unavailable."},"dailyClicksLast30Days":{"anyOf":[{"type":"array","items":{"type":"integer","minimum":0},"minItems":30,"maxItems":30},{"type":"null"}],"description":"Clicks on each of the last 30 UTC days, oldest first, ending today; null when analytics are unavailable."}},"required":["clicksLast30Days","dailyClicksLast30Days"]}]},"LinkPage":{"type":"object","properties":{"links":{"type":"array","items":{"$ref":"#/components/schemas/ListedLink"}},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["links","nextCursor"]},"CreateLinkInput":{"type":"object","properties":{"destination":{"type":"string","format":"uri","maxLength":4096},"slug":{"type":"string","pattern":"^[a-z0-9](?:[a-z0-9-]{1,62}[a-z0-9])$","description":"Omit for a generated slug. Reserved paths are refused."},"title":{"type":"string","maxLength":200},"domainId":{"type":"string","description":"Omit for the default short-link domain."},"iosDestination":{"anyOf":[{"type":"string","maxLength":4096,"description":"Where iPhone visitors go instead of destination: an http(s) URL or an app link in the scheme://… form. Link previews and other visitors get destination."},{"type":"null"}]},"androidDestination":{"anyOf":[{"type":"string","maxLength":4096,"description":"Where Android visitors go instead of destination: an http(s) URL or an app link in the scheme://… form, including intent://. Link previews and other visitors get destination."},{"type":"null"}]},"startsAt":{"anyOf":[{"type":"string","format":"date-time","description":"The link opens at this time: ISO 8601 with Z or an offset. Setting it needs link access on the plan (LINK_ACCESS_REQUIRES_PLAN otherwise); clearing it does not."},{"type":"null"}]},"endsAt":{"anyOf":[{"type":"string","format":"date-time","description":"The link stops at this time, after startsAt: ISO 8601 with Z or an offset. Setting it needs link access on the plan (LINK_ACCESS_REQUIRES_PLAN otherwise); clearing it does not."},{"type":"null"}]},"endedDestination":{"anyOf":[{"type":"string","format":"uri","maxLength":4096,"description":"Where visitors go after endsAt; needs endsAt. Without it, visitors see that the link has ended. Setting it needs link access on the plan (LINK_ACCESS_REQUIRES_PLAN otherwise); clearing it does not."},{"type":"null"}]},"password":{"anyOf":[{"type":"string","minLength":4,"maxLength":128,"description":"Visitors enter it before the redirect. It is stored as a hash and never returned; reads show hasPassword. Setting it needs link access on the plan (LINK_ACCESS_REQUIRES_PLAN otherwise); clearing it does not."},{"type":"null"}]},"previewTitle":{"anyOf":[{"type":"string","maxLength":200,"description":"The title that link cards in chat apps and social networks show, instead of the destination page title. Setting it needs social previews on the plan (LINK_PREVIEW_REQUIRES_PLAN otherwise); clearing it does not."},{"type":"null"}]},"previewDescription":{"anyOf":[{"type":"string","maxLength":500,"description":"The description that link cards show, instead of the destination page description. Setting it needs social previews on the plan (LINK_PREVIEW_REQUIRES_PLAN otherwise); clearing it does not."},{"type":"null"}]}},"required":["destination"]},"UpdateLinkInput":{"type":"object","properties":{"destination":{"type":"string","format":"uri","maxLength":4096},"title":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"iosDestination":{"anyOf":[{"type":"string","maxLength":4096,"description":"Where iPhone visitors go instead of destination: an http(s) URL or an app link in the scheme://… form. Link previews and other visitors get destination."},{"type":"null"}],"description":"null clears it."},"androidDestination":{"anyOf":[{"type":"string","maxLength":4096,"description":"Where Android visitors go instead of destination: an http(s) URL or an app link in the scheme://… form, including intent://. Link previews and other visitors get destination."},{"type":"null"}],"description":"null clears it."},"startsAt":{"anyOf":[{"type":"string","format":"date-time","description":"The link opens at this time: ISO 8601 with Z or an offset. Setting it needs link access on the plan (LINK_ACCESS_REQUIRES_PLAN otherwise); clearing it does not."},{"type":"null"}],"description":"null clears it. The link opens at this time: ISO 8601 with Z or an offset. Setting it needs link access on the plan (LINK_ACCESS_REQUIRES_PLAN otherwise); clearing it does not."},"endsAt":{"anyOf":[{"type":"string","format":"date-time","description":"The link stops at this time, after startsAt: ISO 8601 with Z or an offset. Setting it needs link access on the plan (LINK_ACCESS_REQUIRES_PLAN otherwise); clearing it does not."},{"type":"null"}],"description":"null clears it and endedDestination. The link stops at this time, after startsAt: ISO 8601 with Z or an offset. Setting it needs link access on the plan (LINK_ACCESS_REQUIRES_PLAN otherwise); clearing it does not."},"endedDestination":{"anyOf":[{"type":"string","format":"uri","maxLength":4096,"description":"Where visitors go after endsAt; needs endsAt. Without it, visitors see that the link has ended. Setting it needs link access on the plan (LINK_ACCESS_REQUIRES_PLAN otherwise); clearing it does not."},{"type":"null"}],"description":"null clears it. Where visitors go after endsAt; needs endsAt. Without it, visitors see that the link has ended. Setting it needs link access on the plan (LINK_ACCESS_REQUIRES_PLAN otherwise); clearing it does not."},"password":{"anyOf":[{"type":"string","minLength":4,"maxLength":128,"description":"Visitors enter it before the redirect. It is stored as a hash and never returned; reads show hasPassword. Setting it needs link access on the plan (LINK_ACCESS_REQUIRES_PLAN otherwise); clearing it does not."},{"type":"null"}],"description":"null clears it. Visitors enter it before the redirect. It is stored as a hash and never returned; reads show hasPassword. Setting it needs link access on the plan (LINK_ACCESS_REQUIRES_PLAN otherwise); clearing it does not."},"previewTitle":{"anyOf":[{"type":"string","maxLength":200,"description":"The title that link cards in chat apps and social networks show, instead of the destination page title. Setting it needs social previews on the plan (LINK_PREVIEW_REQUIRES_PLAN otherwise); clearing it does not."},{"type":"null"}],"description":"null clears it. The title that link cards in chat apps and social networks show, instead of the destination page title. Setting it needs social previews on the plan (LINK_PREVIEW_REQUIRES_PLAN otherwise); clearing it does not."},"previewDescription":{"anyOf":[{"type":"string","maxLength":500,"description":"The description that link cards show, instead of the destination page description. Setting it needs social previews on the plan (LINK_PREVIEW_REQUIRES_PLAN otherwise); clearing it does not."},{"type":"null"}],"description":"null clears it. The description that link cards show, instead of the destination page description. Setting it needs social previews on the plan (LINK_PREVIEW_REQUIRES_PLAN otherwise); clearing it does not."},"enabled":{"type":"boolean"}},"required":[],"minProperties":1},"ImportLinksInput":{"type":"object","properties":{"dryRun":{"type":"boolean","description":"true checks each item and writes nothing; false creates the links."},"items":{"type":"array","items":{"$ref":"#/components/schemas/CreateLinkInput"},"minItems":1,"description":"Links to create, in order. Each installation sets the most items in one request (3 by default); more fail with TOO_MANY_ITEMS. An invalid item fails alone."}},"required":["dryRun","items"]},"ImportItemResult":{"type":"object","properties":{"index":{"type":"integer","minimum":0,"description":"The item’s position in items."},"status":{"type":"string","enum":["ready","created","failed"],"description":"ready: a dry run found nothing that stops the item. created: the link exists. failed: see error; nothing was created."},"link":{"$ref":"#/components/schemas/Link"},"error":{"type":"object","properties":{"code":{"type":"string","enum":["INVALID_INPUT","INVALID_IMPORT","TOO_MANY_ITEMS","IDEMPOTENCY_KEY_REQUIRED","IDEMPOTENCY_KEY_REUSED","SLUG_TAKEN","DEFAULT_DOMAIN_UNAVAILABLE","DOMAIN_UNAVAILABLE","PLAN_LIMIT_REACHED","DOMAIN_TAKEN","DOMAIN_LIMIT_REACHED","DOMAINS_UNAVAILABLE","DOMAIN_CHECK_TOO_SOON","RATE_LIMITED","UNAUTHENTICATED","ORIGIN_REJECTED","INSUFFICIENT_SCOPE","REAUTH_REQUIRED","TOKEN_LIMIT_REACHED","NO_WORKSPACE","WORKSPACE_PENDING","ACCOUNT_DELETING","WORKSPACE_SUSPENDED","WORKSPACE_CHANGED","WORKSPACE_LIMIT_REACHED","OWNER_REQUIRED","MEMBER_LIMIT_REACHED","WEBHOOK_LIMIT_REACHED","AUTOMATION_LIMIT_REACHED","LINK_AUTOMATION_LIMIT_REACHED","ALREADY_MEMBER","INVITE_PENDING","INVITE_FOR_ANOTHER_EMAIL","OWNER_CANNOT_LEAVE","LINK_ACCESS_REQUIRES_PLAN","LINK_PREVIEW_REQUIRES_PLAN","LINK_BLOCKED","NOT_FOUND","METHOD_NOT_ALLOWED","PAYLOAD_TOO_LARGE","UNSUPPORTED_MEDIA_TYPE","SERVICE_UNAVAILABLE"]},"message":{"type":"string"},"field":{"type":"string","description":"The input that failed validation."}},"required":["code","message"]}},"required":["index","status"]},"ImportLinksResult":{"type":"object","properties":{"dryRun":{"type":"boolean"},"results":{"type":"array","items":{"$ref":"#/components/schemas/ImportItemResult"}},"summary":{"oneOf":[{"type":"object","properties":{"ready":{"type":"integer","minimum":0},"failed":{"type":"integer","minimum":0}},"required":["ready","failed"]},{"type":"object","properties":{"created":{"type":"integer","minimum":0},"failed":{"type":"integer","minimum":0}},"required":["created","failed"]}],"description":"ready and failed for a dry run; created and failed otherwise."}},"required":["dryRun","results","summary"]},"DailyClicks":{"type":"object","properties":{"day":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"clicks":{"type":"integer","minimum":0}},"required":["day","clicks"]},"DimensionClicks":{"type":"object","properties":{"value":{"type":"string"},"clicks":{"type":"integer","minimum":0}},"required":["value","clicks"]},"LinkAnalytics":{"type":"object","properties":{"linkId":{"type":"string"},"from":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"to":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"total":{"type":"integer","minimum":0},"days":{"type":"array","items":{"$ref":"#/components/schemas/DailyClicks"}},"countries":{"type":"array","items":{"$ref":"#/components/schemas/DimensionClicks"},"description":"Two-letter country codes, or \"unknown\"."},"devices":{"type":"array","items":{"$ref":"#/components/schemas/DimensionClicks"},"description":"One of desktop, mobile, tablet, unknown."},"referrers":{"type":"array","items":{"$ref":"#/components/schemas/DimensionClicks"},"description":"Referrer host names; at most 50 per link and day, the rest under \"other\"."},"browsers":{"type":"array","items":{"$ref":"#/components/schemas/DimensionClicks"},"description":"One of chrome, safari, firefox, edge, samsung, opera, other, unknown. Clicks recorded before browser recording started have no entry, so the sum can be less than total."},"operatingSystems":{"type":"array","items":{"$ref":"#/components/schemas/DimensionClicks"},"description":"One of ios, android, windows, macos, linux, chromeos, other, unknown. Clicks recorded before OS recording started have no entry, so the sum can be less than total."},"asOf":{"type":"string","format":"date-time"}},"required":["linkId","from","to","total","days","countries","devices","referrers","browsers","operatingSystems","asOf"]},"LimitUsage":{"type":"object","properties":{"used":{"type":"integer","minimum":0},"limit":{"type":"integer","minimum":0}},"required":["used","limit"]},"UsageWarning":{"type":"object","properties":{"resource":{"type":"string","enum":["clicks","links","domains"]},"level":{"type":"integer","enum":[80,100],"description":"The percentage of the limit reached."}},"required":["resource","level"]},"Usage":{"type":"object","properties":{"workspace":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"description":"The workspace the usage belongs to."},"month":{"type":"string","pattern":"^\\d{4}-\\d{2}$"},"clicks":{"type":"integer","minimum":0,"description":"Clicks recorded this UTC month."},"clickLimit":{"type":"integer","minimum":0,"description":"Clicks that can be recorded each UTC month."},"unrecordedClicks":{"type":"integer","minimum":0,"description":"Clicks this month after the allowance was full. Links kept redirecting."},"unrecordedSince":{"anyOf":[{"type":"string","format":"date-time","description":"When the first click this month was not recorded."},{"type":"null"}]},"links":{"$ref":"#/components/schemas/LimitUsage","description":"Active links and the active link limit."},"domains":{"$ref":"#/components/schemas/LimitUsage","description":"Custom domains in use and the custom domain limit."},"retentionDays":{"type":"integer","minimum":0,"description":"Days of click history kept."},"warnings":{"type":"array","items":{"$ref":"#/components/schemas/UsageWarning"},"description":"Each limit at 80% or more."},"asOf":{"type":"string","format":"date-time"}},"required":["workspace","month","clicks","clickLimit","unrecordedClicks","unrecordedSince","links","domains","retentionDays","warnings","asOf"]},"ExportLinkPage":{"type":"object","properties":{"links":{"type":"array","items":{"$ref":"#/components/schemas/Link"},"maxItems":1000},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["links","nextCursor"]},"ExportDailyTotal":{"type":"object","properties":{"linkId":{"type":"string"},"day":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"clicks":{"type":"integer","minimum":0}},"required":["linkId","day","clicks"]},"ExportDailyDimension":{"type":"object","properties":{"linkId":{"type":"string"},"day":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"dimension":{"type":"string","enum":["country","device","referrer","browser","os"]},"value":{"type":"string"},"clicks":{"type":"integer","minimum":0}},"required":["linkId","day","dimension","value","clicks"]},"ExportTotalsPage":{"type":"object","properties":{"from":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"The first retained UTC day."},"retentionDays":{"type":"integer","minimum":0},"rows":{"type":"array","items":{"$ref":"#/components/schemas/ExportDailyTotal"},"maxItems":10000},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["from","retentionDays","rows","nextCursor"]},"ExportDimensionsPage":{"type":"object","properties":{"from":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"The first retained UTC day."},"retentionDays":{"type":"integer","minimum":0},"rows":{"type":"array","items":{"$ref":"#/components/schemas/ExportDailyDimension"},"maxItems":10000},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["from","retentionDays","rows","nextCursor"]},"Domain":{"type":"object","properties":{"id":{"type":"string"},"hostname":{"type":"string"},"kind":{"type":"string","enum":["platform","workspace"],"description":"platform: provided for every workspace. workspace: added by yours."},"state":{"type":"string","enum":["pending","verifying","active","failed","disabled"],"description":"Only an active domain serves links."},"isDefault":{"type":"boolean","description":"Used for links created without a domain."},"setup":{"anyOf":[{"type":"string","enum":["dns","worker_custom_domain"]},{"type":"null"}],"description":"How to connect the hostname. dns: create the records below. worker_custom_domain: add the hostname as a Custom Domain of this installation’s Worker in the Cloudflare dashboard. Null for platform domains."},"records":{"type":"array","items":{"type":"object","properties":{"type":{"const":"CNAME"},"name":{"type":"string"},"value":{"type":"string"}},"required":["type","name","value"]},"description":"The DNS records to create when setup is dns. Otherwise empty."},"error":{"anyOf":[{"type":"object","properties":{"code":{"type":"string","enum":["dns_not_found","record_removed","certificate_failed","blocked","expired","provider_error"]},"message":{"type":"string"}},"required":["code","message"]},{"type":"null"}]},"activeLinks":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}],"description":"Active links that stop when the domain is removed; null for platform domains."},"createdAt":{"type":"string","format":"date-time"},"activatedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["id","hostname","kind","state","isDefault","setup","records","error","activeLinks","createdAt","activatedAt"]},"DomainPage":{"type":"object","properties":{"domains":{"type":"array","items":{"$ref":"#/components/schemas/Domain"}},"used":{"type":"integer","minimum":0,"description":"Workspace domains that count against the limit."},"limit":{"type":"integer","minimum":0}},"required":["domains","used","limit"]},"AutomationTrigger":{"oneOf":[{"type":"object","properties":{"type":{"const":"end_date"}},"required":["type"]},{"type":"object","properties":{"type":{"const":"link_age"},"days":{"type":"integer","minimum":1,"maximum":3650}},"required":["type","days"]},{"type":"object","properties":{"type":{"const":"clicks"},"clicks":{"type":"integer","minimum":100,"maximum":100000000,"multipleOf":100}},"required":["type","clicks"]},{"type":"object","properties":{"type":{"const":"destination_down"}},"required":["type"]}],"description":"end_date: at the end date given when the template is applied to a link. link_age: this many days after the link was created. clicks: when the link reaches this many counted clicks. destination_down: when the destination fails two checks in a row, where the installation checks destinations."},"AutomationAction":{"oneOf":[{"type":"object","properties":{"type":{"const":"change_destination"},"destination":{"type":"string","format":"uri","maxLength":4096}},"required":["type","destination"]},{"type":"object","properties":{"type":{"const":"disable_link"}},"required":["type"]},{"type":"object","properties":{"type":{"const":"send_webhook"},"endpointId":{"type":"string","description":"A webhook endpoint of the workspace."}},"required":["type","endpointId"]},{"type":"object","properties":{"type":{"const":"post_message"},"endpointId":{"type":"string","description":"A message target of the workspace, where the installation posts messages."}},"required":["type","endpointId"]},{"type":"object","properties":{"type":{"const":"email_owner"}},"required":["type"]}],"description":"Actions run in this order: change the destination, turn the link off, send an automation.triggered event to the webhook endpoint, post a message to the message target, email the workspace owner."},"Automation":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","minLength":1,"maxLength":80},"enabled":{"type":"boolean","description":"A template that is off does not run; its due applications are skipped."},"trigger":{"$ref":"#/components/schemas/AutomationTrigger"},"actions":{"type":"array","items":{"$ref":"#/components/schemas/AutomationAction"},"minItems":1,"maxItems":5},"links":{"type":"integer","minimum":0,"description":"Links the template is applied to, whether it ran or not."},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","name","enabled","trigger","actions","links","createdAt","updatedAt"]},"AutomationPage":{"type":"object","properties":{"automations":{"type":"array","items":{"$ref":"#/components/schemas/Automation"}},"used":{"type":"integer","minimum":0},"limit":{"type":"integer","minimum":0,"description":"Templates the workspace may keep; 0 turns automations off."},"actionTypes":{"type":"array","items":{"type":"string","enum":["change_destination","disable_link","send_webhook","post_message","email_owner"]},"description":"The actions this installation offers."},"triggerTypes":{"type":"array","items":{"type":"string","enum":["end_date","link_age","clicks","destination_down"]},"description":"The triggers this installation offers."},"perLinkLimit":{"const":5,"description":"Templates one link takes at most."}},"required":["automations","used","limit","actionTypes","triggerTypes","perLinkLimit"]},"LinkAutomation":{"type":"object","properties":{"automationId":{"type":"string"},"name":{"type":"string"},"enabled":{"type":"boolean"},"trigger":{"$ref":"#/components/schemas/AutomationTrigger"},"state":{"type":"string","enum":["waiting","done","failed","skipped"],"description":"waiting: not run yet. done: it ran. failed and skipped: see result. Each application runs once; applying the template again re-arms it."},"endsAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"dueAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"When the trigger is met, once that is known."},"firedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"result":{"anyOf":[{"type":"string","enum":["link_blocked","endpoint_missing","target_missing","webhooks_off","plan","off","attempts","not_checkable"]},{"type":"null"}]},"appliedAt":{"type":"string","format":"date-time"},"check":{"anyOf":[{"type":"object","properties":{"lastCheckedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"lastResult":{"anyOf":[{"type":"string"},{"type":"null"}]},"failures":{"type":"integer","minimum":0}},"required":["lastCheckedAt","lastResult","failures"]},{"type":"null"}],"description":"The destination checks of a destination_down template; null for the others."}},"required":["automationId","name","enabled","trigger","state","endsAt","dueAt","firedAt","result","appliedAt","check"]},"LinkAutomationPage":{"type":"object","properties":{"linkId":{"type":"string"},"automations":{"type":"array","items":{"$ref":"#/components/schemas/LinkAutomation"},"maxItems":5}},"required":["linkId","automations"]},"ApplyLinkAutomationResult":{"allOf":[{"$ref":"#/components/schemas/LinkAutomationPage"},{"type":"object","properties":{"status":{"type":"string","enum":["applied","unchanged"],"description":"unchanged: the template already waited on the link with the same end date."}},"required":["status"]}]},"ApplyAutomationInput":{"type":"object","properties":{"endsAt":{"type":"string","format":"date-time","description":"Required by an end_date template and refused by the others: an ISO 8601 time with an offset, within 10 years. A past time runs at the next scheduled run."}},"required":[]},"ApplyAutomationLinksInput":{"type":"object","properties":{"linkIds":{"type":"array","items":{"type":"string"},"minItems":1,"maxItems":100,"description":"Up to 100 link IDs; more fail with TOO_MANY_ITEMS."},"endsAt":{"type":"string","format":"date-time","description":"Required by an end_date template and refused by the others: an ISO 8601 time with an offset, within 10 years. A past time runs at the next scheduled run."}},"required":["linkIds"]},"ApplyAutomationLinkResult":{"type":"object","properties":{"linkId":{"type":"string"},"status":{"type":"string","enum":["applied","unchanged","failed"]},"error":{"type":"object","properties":{"code":{"type":"string","enum":["INVALID_INPUT","INVALID_IMPORT","TOO_MANY_ITEMS","IDEMPOTENCY_KEY_REQUIRED","IDEMPOTENCY_KEY_REUSED","SLUG_TAKEN","DEFAULT_DOMAIN_UNAVAILABLE","DOMAIN_UNAVAILABLE","PLAN_LIMIT_REACHED","DOMAIN_TAKEN","DOMAIN_LIMIT_REACHED","DOMAINS_UNAVAILABLE","DOMAIN_CHECK_TOO_SOON","RATE_LIMITED","UNAUTHENTICATED","ORIGIN_REJECTED","INSUFFICIENT_SCOPE","REAUTH_REQUIRED","TOKEN_LIMIT_REACHED","NO_WORKSPACE","WORKSPACE_PENDING","ACCOUNT_DELETING","WORKSPACE_SUSPENDED","WORKSPACE_CHANGED","WORKSPACE_LIMIT_REACHED","OWNER_REQUIRED","MEMBER_LIMIT_REACHED","WEBHOOK_LIMIT_REACHED","AUTOMATION_LIMIT_REACHED","LINK_AUTOMATION_LIMIT_REACHED","ALREADY_MEMBER","INVITE_PENDING","INVITE_FOR_ANOTHER_EMAIL","OWNER_CANNOT_LEAVE","LINK_ACCESS_REQUIRES_PLAN","LINK_PREVIEW_REQUIRES_PLAN","LINK_BLOCKED","NOT_FOUND","METHOD_NOT_ALLOWED","PAYLOAD_TOO_LARGE","UNSUPPORTED_MEDIA_TYPE","SERVICE_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"]}},"required":["linkId","status"]},"ApplyAutomationLinksResult":{"type":"object","properties":{"results":{"type":"array","items":{"$ref":"#/components/schemas/ApplyAutomationLinkResult"}}},"required":["results"]},"HookEvent":{"type":"string","enum":["link.created","link.updated","link.disabled","link.enabled","link.click_milestone"],"description":"link.disabled and link.enabled are edits that turn the link off or on; link.updated is any other edit."},"CreateHookInput":{"type":"object","properties":{"event":{"$ref":"#/components/schemas/HookEvent"},"targetUrl":{"type":"string","format":"uri","maxLength":2048,"description":"An https URL on a host that this installation sends hooks to. Flared POSTs each event to it as one JSON object: the link fields, then clicks (milestones) or previous (edits), then event, eventId, and occurredAt. Answer 410 to end the hook."},"milestoneInterval":{"anyOf":[{"type":"integer","minimum":100,"maximum":1000000,"multipleOf":100},{"type":"null"}],"description":"For link.click_milestone: the hook gets every milestone that this number divides. 1000 when left out."}},"required":["event","targetUrl"]},"Hook":{"type":"object","properties":{"id":{"type":"string"},"event":{"$ref":"#/components/schemas/HookEvent"},"milestoneInterval":{"anyOf":[{"type":"integer","minimum":0},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time"},"renewAt":{"type":"string","format":"date-time","description":"Subscribe again after this time, then delete this hook."},"expiresAt":{"type":"string","format":"date-time","description":"The hook gets no event that happens at or after this time."}},"required":["id","event","milestoneInterval","createdAt","renewAt","expiresAt"]},"Workspace":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"role":{"type":"string","enum":["owner","member"]}},"required":["id","name","role"]},"Identity":{"oneOf":[{"type":"object","properties":{"kind":{"const":"session"},"scopes":{"type":"array","items":{"$ref":"#/components/schemas/Scope"}},"workspace":{"$ref":"#/components/schemas/Workspace","description":"The workspace the session acts in."}},"required":["kind","scopes","workspace"]},{"type":"object","properties":{"kind":{"const":"token"},"scopes":{"type":"array","items":{"$ref":"#/components/schemas/Scope"}},"workspace":{"$ref":"#/components/schemas/Workspace","description":"The workspace the token acts in."},"token":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"start":{"type":"string","description":"The prefix and first characters."},"expiresAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["id","name","start","expiresAt"]}},"required":["kind","scopes","workspace","token"]},{"type":"object","properties":{"kind":{"const":"oauth"},"scopes":{"type":"array","items":{"$ref":"#/components/schemas/Scope"}},"workspace":{"$ref":"#/components/schemas/Workspace","description":"The workspace the person chose when they connected the app."}},"required":["kind","scopes","workspace"]}]}}}}