{"openapi":"3.1.0","info":{"title":"Link4Sync Public API","version":"1.0.0","summary":"Manage your topics from code.","description":"The Link4Sync Public API lets your services list, create, and delete topics.\n\nMessages do not go through this API. Publish to a topic's HTTPS, HTTP, or MQTT connection,\nand read by subscribing to `<topic ID>/out` over MQTT.\n\nEvery request needs a Keycloak access token in the `Authorization: Bearer <token>` header.\nTwo kinds of token are accepted:\n\n- **Account token**: issued by the `kafka-connect-access` client for your Link4Sync login.\n  It can manage every topic of your account.\n- **Subaccount token**: issued with client credentials for an OAuth subaccount. It can list\n  the topics of that subaccount.\n","contact":{"email":"support@link4sync.com"}},"servers":[{"url":"https://api.link4sync.com","description":"Production"}],"security":[{"bearerAuth":[]}],"tags":[{"name":"Topics","description":"List, create, and delete topics."}],"paths":{"/v1/topics":{"get":{"operationId":"listTopics","tags":["Topics"],"summary":"List topics","description":"Lists the topics this token can use. An account token lists every topic of the account.\nA subaccount token lists only its own topics: a producer subaccount can write to them, a\nconsumer subaccount can read them.\n","responses":{"200":{"description":"The topics this token can use.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TopicList"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"},"502":{"$ref":"#/components/responses/BadGateway"},"503":{"$ref":"#/components/responses/Unavailable"}}},"post":{"operationId":"createTopic","tags":["Topics"],"summary":"Create a topic","description":"Creates a topic in your account. Requires an account token. Plan limits apply: on Basic,\nturn on a shared connection first.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTopicRequest"}}}},"responses":{"201":{"description":"The topic was created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Topic"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/TooManyRequests"},"502":{"$ref":"#/components/responses/BadGateway"},"503":{"$ref":"#/components/responses/Unavailable"}}}},"/v1/topics/{topic}":{"parameters":[{"$ref":"#/components/parameters/TopicPath"}],"delete":{"operationId":"deleteTopic","tags":["Topics"],"summary":"Delete a topic","description":"Deletes a topic and its messages. Requires an account token. An immutable topic cannot be\ndeleted while it holds locked messages.\n","responses":{"204":{"description":"The topic was deleted."},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"429":{"$ref":"#/components/responses/TooManyRequests"},"502":{"$ref":"#/components/responses/BadGateway"},"503":{"$ref":"#/components/responses/Unavailable"}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"A Keycloak access token: an account token from the `kafka-connect-access` client, or a\nsubaccount token from client credentials. Tokens are short-lived; request a new one when\nyou get `401`.\n"}},"parameters":{"TopicPath":{"name":"topic","in":"path","required":true,"description":"The topic name, as shown in the dashboard.","schema":{"$ref":"#/components/schemas/TopicName"}}},"schemas":{"TopicName":{"type":"string","description":"Lowercase letters, digits, and hyphens; starts and ends with a letter or digit.","minLength":1,"maxLength":201,"pattern":"^[a-z0-9](?:[-a-z0-9]*[a-z0-9])?$","examples":["orders"]},"Topic":{"type":"object","additionalProperties":false,"required":["name","access"],"properties":{"name":{"$ref":"#/components/schemas/TopicName"},"access":{"type":"array","description":"What this token may do with the topic's messages through its connections: `write`\nmeans publish, `read` means subscribe to `<topic ID>/out`.\n","items":{"type":"string","enum":["read","write"]},"uniqueItems":true}}},"TopicList":{"type":"object","additionalProperties":false,"required":["topics"],"properties":{"topics":{"type":"array","items":{"$ref":"#/components/schemas/Topic"}}}},"CreateTopicRequest":{"type":"object","additionalProperties":false,"required":["name"],"properties":{"name":{"$ref":"#/components/schemas/TopicName"}}},"Error":{"type":"object","additionalProperties":false,"required":["error"],"properties":{"error":{"type":"string","description":"A short description of the problem."}}}},"responses":{"BadRequest":{"description":"The request is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Unauthorized":{"description":"The access token is missing, invalid, or expired.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Forbidden":{"description":"This token may not do this, or the account must first accept the current terms.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"NotFound":{"description":"The topic does not exist or is not available to this token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Conflict":{"description":"The request conflicts with the topic's current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"TooManyRequests":{"description":"Too many requests. Wait the number of seconds in `Retry-After`.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"BadGateway":{"description":"The platform could not complete the request. Retry later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Unavailable":{"description":"The service is temporarily unavailable. Retry later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}