{"swagger":"2.0","info":{"description":"# Introduction\n\nThe UbSub API is if you want to interface with the router and programatically introduce/modify/delete\ntopics and subscriptions.\n\n**You do not need this API to send and listen to normal events.** You can control everything you need\nusing the UbSub UI.\n\n## About Swagger\n\nYou can find the swagger JSON document [here](https://router.ubsub.io/docs/v2/swagger).\n\nYou can read more about swagger on [their website](https://swagger.io/).\n\n\n## Authentication\n\nAll API calls are authenticated via a `Bearer` token on the header. You can get your user's token via your dashboard (and generate one if it doesn't exist). You\ncan also substitute an API Token and secret from the user and bearer as well. The token may have limited permissions and not allowed to access every\nendpoint.\n\nExample:\n```http\nAuthorization: Bearer \n```\n\n**Note:** The `user` API is not currently open to call at the moment, and is only used by the UI.","version":"0.1.0","title":"UbSub","termsOfService":"https://ubsub.io","contact":{"email":"admin@ubsub.io"},"license":{"name":"Apache 2.0","url":"http://www.apache.org/licenses/LICENSE-2.0.html"}},"host":"router.ubsub.io","basePath":"/api/v1","tags":[{"name":"event","description":"Events are both sent and recorded in the database for later use."},{"name":"user","description":"Users can currently be created and modified only by the UI. They are the base of all other API calls that can happen."},{"name":"topic","description":"Topics can be created/modified/deleted for a given user. They are what are invoked and distribute requests to their subscribers."},{"name":"subscription","description":"Subscribers receive messages from topics that they are connected to. They can have various URI types and protocols. See the main documentation for details on supported protocols."},{"name":"template","description":"Templates have the ability to process against events, either validating them, or mapping their contents to another form"},{"name":"docs","description":"Self-documenting endpoints"}],"schemes":["https"],"securityDefinitions":{"token":{"type":"apiKey","name":"Authorization","in":"header"},"OAuth2":{"type":"oauth2","flow":"accessCode","authorizationUrl":"https://app.ubsub.io/oidc","tokenUrl":"https://app.ubsub.io/oidc/token"}},"paths":{"/user":{"post":{"consumes":["application/json"],"produces":["application/json"],"security":[{"token":["app"]}],"tags":["user"],"summary":"Create User","description":"Create a new user with an email and password","operationId":"createUser","parameters":[{"in":"body","name":"body","description":"User object","required":true,"schema":{"$ref":"#/definitions/UserCreate"}}],"responses":{"200":{"description":"Topic created","schema":{"$ref":"#/definitions/User"}},"400":{"description":"Invalid input","schema":{"$ref":"#/definitions/ApiResponse"}},"401":{"description":"Authorization denied","schema":{"$ref":"#/definitions/ApiResponse"}},"404":{"description":"Object not found","schema":{"$ref":"#/definitions/ApiResponse"}},"500":{"description":"Something unexpected happened"}}}},"/user/{userId}":{"get":{"consumes":["application/json"],"produces":["application/json"],"security":[{"token":["user"]}],"tags":["user"],"summary":"Get User","description":"Get a user by their id","operationId":"getUserById","parameters":[{"name":"userId","in":"path","description":"ID of the user","required":true,"type":"string"}],"responses":{"200":{"description":"User retrieved","schema":{"$ref":"#/definitions/User"}},"400":{"description":"Invalid input","schema":{"$ref":"#/definitions/ApiResponse"}},"401":{"description":"Authorization denied","schema":{"$ref":"#/definitions/ApiResponse"}},"404":{"description":"Object not found","schema":{"$ref":"#/definitions/ApiResponse"}},"500":{"description":"Something unexpected happened"}}},"patch":{"consumes":["application/json"],"produces":["application/json"],"security":[{"token":["user.update.password"]}],"tags":["user"],"summary":"Update user","description":"Update user information","operationId":"updateUser","parameters":[{"name":"userId","in":"path","description":"ID Of the user","required":true,"type":"string"},{"in":"body","name":"body","description":"User update","required":true,"schema":{"$ref":"#/definitions/UserUpdate"}}],"responses":{"200":{"description":"User updated","schema":{"$ref":"#/definitions/User"}},"400":{"description":"Invalid input","schema":{"$ref":"#/definitions/ApiResponse"}},"401":{"description":"Authorization denied","schema":{"$ref":"#/definitions/ApiResponse"}},"404":{"description":"Object not found","schema":{"$ref":"#/definitions/ApiResponse"}},"500":{"description":"Something unexpected happened"}}}},"/user/{userId}/topic":{"post":{"consumes":["application/json"],"produces":["application/json"],"security":[{"token":["topic.create","topic.*"]}],"tags":["topic"],"summary":"Create Topic","description":"Create a new topic for a user","operationId":"createTopic","parameters":[{"name":"userId","in":"path","description":"ID of the user","required":true,"type":"string"},{"in":"body","name":"body","description":"Topic object","required":true,"schema":{"$ref":"#/definitions/TopicCreate"}}],"responses":{"200":{"description":"Topic created","schema":{"$ref":"#/definitions/Topic"}},"400":{"description":"Invalid input","schema":{"$ref":"#/definitions/ApiResponse"}},"401":{"description":"Authorization denied","schema":{"$ref":"#/definitions/ApiResponse"}},"404":{"description":"Object not found","schema":{"$ref":"#/definitions/ApiResponse"}},"500":{"description":"Something unexpected happened"}}},"get":{"consumes":["application/json"],"produces":["application/json"],"security":[{"token":["topic","topic.*"]}],"tags":["topic"],"summary":"Get Topics","description":"Get all topics for a given user","operationId":"getTopicsByUser","parameters":[{"name":"userId","in":"path","description":"ID of the user","required":true,"type":"string"}],"responses":{"200":{"description":"Topic retrieved","schema":{"type":"array","items":{"$ref":"#/definitions/Topic"}}},"400":{"description":"Invalid input","schema":{"$ref":"#/definitions/ApiResponse"}},"401":{"description":"Authorization denied","schema":{"$ref":"#/definitions/ApiResponse"}},"404":{"description":"Object not found","schema":{"$ref":"#/definitions/ApiResponse"}},"500":{"description":"Something unexpected happened"}}}},"/user/{userId}/topic/{topicId}":{"get":{"consumes":["application/json"],"produces":["application/json"],"security":[{"token":["topic","topic.*"]}],"tags":["topic"],"summary":"Get Topic by Id","description":"Retrieves a topic given its user and topic id","operationId":"getTopic","parameters":[{"name":"userId","in":"path","description":"ID of the user","required":true,"type":"string"},{"name":"topicId","in":"path","description":"ID of the topic","required":true,"type":"string"}],"responses":{"200":{"description":"Topic retrieved","schema":{"$ref":"#/definitions/Topic"}},"400":{"description":"Invalid input","schema":{"$ref":"#/definitions/ApiResponse"}},"401":{"description":"Authorization denied","schema":{"$ref":"#/definitions/ApiResponse"}},"404":{"description":"Object not found","schema":{"$ref":"#/definitions/ApiResponse"}},"500":{"description":"Something unexpected happened"}}},"patch":{"consumes":["application/json"],"produces":["application/json"],"security":[{"token":["topic.update","topic.*"]}],"tags":["topic"],"summary":"Update topic","description":"Update topic configuration","operationId":"updateTopic","parameters":[{"name":"userId","in":"path","description":"ID of the user","required":true,"type":"string"},{"name":"topicId","in":"path","description":"ID of the topic","required":true,"type":"string"},{"in":"body","name":"body","description":"Topic object","required":true,"schema":{"$ref":"#/definitions/TopicUpdate"}}],"responses":{"200":{"description":"Topic updated","schema":{"$ref":"#/definitions/Topic"}},"400":{"description":"Invalid input","schema":{"$ref":"#/definitions/ApiResponse"}},"401":{"description":"Authorization denied","schema":{"$ref":"#/definitions/ApiResponse"}},"404":{"description":"Object not found","schema":{"$ref":"#/definitions/ApiResponse"}},"500":{"description":"Something unexpected happened"}}},"delete":{"consumes":["application/json"],"produces":["application/json"],"security":[{"token":["topic.delete","topic.*"]}],"tags":["topic"],"summary":"Delete a topic by id","description":"Deletes a topic given its user and topic id","operationId":"deleteTopic","parameters":[{"name":"userId","in":"path","description":"ID of the user","required":true,"type":"string"},{"name":"topicId","in":"path","description":"ID of the topic","required":true,"type":"string"}],"responses":{"200":{"description":"Topic deleted"},"400":{"description":"Invalid input","schema":{"$ref":"#/definitions/ApiResponse"}},"401":{"description":"Authorization denied","schema":{"$ref":"#/definitions/ApiResponse"}},"404":{"description":"Object not found","schema":{"$ref":"#/definitions/ApiResponse"}},"500":{"description":"Something unexpected happened"}}}},"/user/{userId}/template":{"post":{"consumes":["application/json"],"produces":["application/json"],"security":[{"token":["template.create","template.*"]}],"tags":["template"],"summary":"Create Template","description":"Create a new template code","operationId":"createTemplate","parameters":[{"name":"userId","in":"path","description":"ID of the user","required":true,"type":"string"},{"name":"body","in":"body","description":"Template definition","schema":{"$ref":"#/definitions/TemplateCreate"}}],"responses":{"200":{"description":"Templated created","schema":{"$ref":"#/definitions/Template"}},"400":{"description":"Invalid input","schema":{"$ref":"#/definitions/ApiResponse"}},"401":{"description":"Authorization denied","schema":{"$ref":"#/definitions/ApiResponse"}},"404":{"description":"Object not found","schema":{"$ref":"#/definitions/ApiResponse"}},"500":{"description":"Something unexpected happened"}}},"get":{"consumes":["application/json"],"produces":["application/json"],"security":[{"token":["template","template.*"]}],"tags":["template"],"summary":"Get templates","description":"Get all templates useable by user, including global templates","operationId":"getTemplates","parameters":[{"name":"userId","in":"path","description":"ID of the user","required":true,"type":"string"}],"responses":{"200":{"description":"Template retrieved","schema":{"type":"array","items":{"$ref":"#/definitions/Template"}}},"400":{"description":"Invalid input","schema":{"$ref":"#/definitions/ApiResponse"}},"401":{"description":"Authorization denied","schema":{"$ref":"#/definitions/ApiResponse"}},"404":{"description":"Object not found","schema":{"$ref":"#/definitions/ApiResponse"}},"500":{"description":"Something unexpected happened"}}}},"/user/{userId}/template/{templateId}":{"get":{"consumes":["application/json"],"produces":["application/json"],"security":[{"token":["template","template.*"]}],"tags":["template"],"summary":"Get template","description":"Get a template by id","operationId":"getTemplateById","parameters":[{"name":"userId","in":"path","description":"ID of the user","required":true,"type":"string"},{"name":"templateId","in":"path","description":"Id of template","required":true,"type":"string"}],"responses":{"200":{"description":"Template retrieved","schema":{"$ref":"#/definitions/Template"}},"400":{"description":"Invalid input","schema":{"$ref":"#/definitions/ApiResponse"}},"401":{"description":"Authorization denied","schema":{"$ref":"#/definitions/ApiResponse"}},"404":{"description":"Object not found","schema":{"$ref":"#/definitions/ApiResponse"}},"500":{"description":"Something unexpected happened"}}},"patch":{"consumes":["application/json"],"produces":["application/json"],"security":[{"token":["template.update","template.*"]}],"tags":["template"],"summary":"Update template","description":"Update code of a template","operationId":"updateTemplate","parameters":[{"name":"userId","in":"path","description":"ID of the user","required":true,"type":"string"},{"name":"templateId","in":"path","description":"Id of template","required":true,"type":"string"},{"name":"body","in":"body","description":"Template definition","required":true,"schema":{"$ref":"#/definitions/Template"}}],"responses":{"200":{"description":"Templated updated","schema":{"$ref":"#/definitions/Template"}},"400":{"description":"Invalid input","schema":{"$ref":"#/definitions/ApiResponse"}},"401":{"description":"Authorization denied","schema":{"$ref":"#/definitions/ApiResponse"}},"404":{"description":"Object not found","schema":{"$ref":"#/definitions/ApiResponse"}},"500":{"description":"Something unexpected happened"}}},"delete":{"consumes":["application/json"],"produces":["application/json"],"security":[{"token":["template.delete","template.*"]}],"tags":["template"],"summary":"Delete template","description":"Delete a template that belongs to you","operationId":"deleteTemplate","parameters":[{"name":"userId","in":"path","description":"ID of the user","required":true,"type":"string"},{"name":"templateId","in":"path","description":"Id of template","required":true,"type":"string"}],"responses":{"200":{"description":"Template deleted"},"400":{"description":"Invalid input","schema":{"$ref":"#/definitions/ApiResponse"}},"401":{"description":"Authorization denied","schema":{"$ref":"#/definitions/ApiResponse"}},"404":{"description":"Object not found","schema":{"$ref":"#/definitions/ApiResponse"}},"500":{"description":"Something unexpected happened"}}}},"/user/{userId}/template/{templateId}/event":{"post":{"consumes":["application/json"],"produces":["application/json"],"security":[{"token":["template.exec"]}],"tags":["template"],"summary":"Evaluate payload","description":"Post event payload to evaluate with template","operationId":"postEventToTemplate","parameters":[{"name":"userId","in":"path","description":"ID of the user","required":true,"type":"string"},{"name":"templateId","in":"path","description":"Id of template","required":true,"type":"string"},{"name":"body","in":"body","description":"Body to evaluate against the template","required":true,"schema":{"type":"object","properties":{"payload":{"type":"string","description":"Payload to evaluate"}}}}],"responses":{"200":{"description":"Templated evaluated","schema":{"type":"object"}},"400":{"description":"Invalid input","schema":{"$ref":"#/definitions/ApiResponse"}},"401":{"description":"Authorization denied","schema":{"$ref":"#/definitions/ApiResponse"}},"404":{"description":"Object not found","schema":{"$ref":"#/definitions/ApiResponse"}},"500":{"description":"Something unexpected happened"}}}},"/user/{userId}/topic/{topicId}/subscription":{"post":{"consumes":["application/json"],"produces":["application/json"],"security":[{"token":["subscription.create","subscription.*"]}],"tags":["subscription"],"summary":"Create subscription","description":"Create a new subscription on a topic","operationId":"createTopicSubscription","parameters":[{"name":"userId","in":"path","description":"ID of the user","required":true,"type":"string"},{"name":"topicId","in":"path","description":"ID of the topic","required":true,"type":"string"},{"in":"body","name":"body","description":"Subscription object","required":true,"schema":{"$ref":"#/definitions/SubscriptionCreate"}}],"responses":{"200":{"description":"Subscription created","schema":{"$ref":"#/definitions/Subscription"}},"400":{"description":"Invalid input","schema":{"$ref":"#/definitions/ApiResponse"}},"401":{"description":"Authorization denied","schema":{"$ref":"#/definitions/ApiResponse"}},"404":{"description":"Object not found","schema":{"$ref":"#/definitions/ApiResponse"}},"500":{"description":"Something unexpected happened"}}}},"/user/{userId}/topic/{topicId}/subscription/{subscriptionId}":{"patch":{"consumes":["application/json"],"produces":["application/json"],"security":[{"token":["subscription.update","subscription.*"]}],"tags":["subscription"],"summary":"Update subscription","description":"Update details of a subscription","operationId":"updateSubscription","parameters":[{"name":"userId","in":"path","description":"ID of the user","required":true,"type":"string"},{"name":"topicId","in":"path","description":"ID of the topic","required":true,"type":"string"},{"name":"subscriptionId","in":"path","description":"ID of the subscription","required":true,"type":"string"},{"name":"body","in":"body","description":"Subscription update","required":true,"schema":{"$ref":"#/definitions/SubscriptionUpdate"}}],"responses":{"200":{"description":"Subscription updated","schema":{"$ref":"#/definitions/Subscription"}},"400":{"description":"Invalid input","schema":{"$ref":"#/definitions/ApiResponse"}},"401":{"description":"Authorization denied","schema":{"$ref":"#/definitions/ApiResponse"}},"404":{"description":"Object not found","schema":{"$ref":"#/definitions/ApiResponse"}},"500":{"description":"Something unexpected happened"}}},"delete":{"consumes":["application/json"],"produces":["application/json"],"security":[{"token":["subscription.delete","subscription.*"]}],"tags":["subscription"],"summary":"Delete subscription","description":"Delete a subscription on a topic","operationId":"deleteTopicSubscription","parameters":[{"name":"userId","in":"path","description":"ID of the user","required":true,"type":"string"},{"name":"topicId","in":"path","description":"ID of the topic","required":true,"type":"string"},{"name":"subscriptionId","in":"path","description":"ID of the subscription","required":true,"type":"string"}],"responses":{"200":{"description":"Subscription deleted"},"400":{"description":"Invalid input","schema":{"$ref":"#/definitions/ApiResponse"}},"401":{"description":"Authorization denied","schema":{"$ref":"#/definitions/ApiResponse"}},"404":{"description":"Object not found","schema":{"$ref":"#/definitions/ApiResponse"}},"500":{"description":"Something unexpected happened"}}}},"/user/{userId}/events":{"get":{"consumes":["application/json"],"produces":["application/json"],"security":[{"token":["event","event.*"]}],"tags":["event"],"summary":"Get events","description":"Get searchable events for a given user","operationId":"getEventsByUser","parameters":[{"name":"userId","in":"path","description":"ID of the user","required":true,"type":"string"},{"name":"topic_id","in":"query","description":"Topic ID to limit results by","required":false,"type":"string"},{"name":"limit","in":"query","description":"Limit to number of events returned. Max: 500","required":false,"type":"integer","default":100},{"name":"offset","in":"query","description":"Offset to start reading events","required":false,"type":"integer"},{"name":"order","in":"query","description":"What field to order the results by","default":"createdAt","required":false,"type":"string"},{"name":"direction","in":"query","description":"Direction in which to return the ordered fields","default":"DESC","required":false,"type":"string"},{"name":"before","in":"query","description":"Events before (less-than) the date","required":false,"type":"string","format":"date-time"},{"name":"after","in":"query","description":"Events after (greater than or equal to) the date","required":false,"type":"string","format":"date-time"},{"name":"search","in":"query","description":"Searches the payload for a case-insensitive partial match","required":false,"type":"string"},{"name":"fields","in":"query","description":"Comma-separated list of extra fields to populate","required":false,"type":"string","enum":["responses","topic"]}],"responses":{"200":{"description":"Events retrieved","schema":{"type":"array","items":{"$ref":"#/definitions/Event"}}},"400":{"description":"Invalid input","schema":{"$ref":"#/definitions/ApiResponse"}},"401":{"description":"Authorization denied","schema":{"$ref":"#/definitions/ApiResponse"}},"404":{"description":"Object not found","schema":{"$ref":"#/definitions/ApiResponse"}},"500":{"description":"Something unexpected happened"}}}},"/user/{userId}/events/timeseries":{"get":{"consumes":["application/json"],"produces":["application/json"],"security":[{"token":["event.aggr","event.*"]}],"tags":["event"],"summary":"Get Time Series","description":"Get time series data about your events","operationId":"getTimeSeries","parameters":[{"name":"userId","in":"path","description":"ID of the user","required":true,"type":"string"},{"name":"topic_id","in":"query","description":"Topic ID to limit results by","required":false,"type":"string"},{"name":"after","in":"query","description":"Events after (greater than or equal to) the date","required":false,"type":"string","format":"date-time","default":"1 Day Ago"},{"name":"before","in":"query","description":"Events before (less than) the date","required":false,"type":"string","format":"date-time","default":"now"},{"name":"bucket","in":"query","description":"How to bucket the date in the time series","type":"string","enum":["year","quarter","months","weeks","days","hours","minutes","seconds"]}],"responses":{"200":{"description":"Time-series data","schema":{"type":"array","items":{"$ref":"#/definitions/EventTimeSeries"}}}}}},"/user/{userId}/token":{"get":{"consumes":["application/json"],"produces":["application/json"],"security":[{"token":["token","token.*"]}],"tags":["Token"],"summary":"Get all tokens","description":"Get all tokens belong to the user","operationId":"getTokens","parameters":[{"name":"userId","in":"path","description":"ID of the user","required":true,"type":"string"},{"name":"client_id","in":"query","type":"string","description":"If specified, returns a list of 1 or 0 elements for the matching client","required":false}],"responses":{"200":{"description":"Tokens","schema":{"type":"array","items":{"$ref":"#/definitions/ApiToken"}}},"400":{"description":"Invalid input","schema":{"$ref":"#/definitions/ApiResponse"}},"401":{"description":"Authorization denied","schema":{"$ref":"#/definitions/ApiResponse"}},"404":{"description":"Object not found","schema":{"$ref":"#/definitions/ApiResponse"}},"500":{"description":"Something unexpected happened"}}},"post":{"consumes":["application/json"],"produces":["application/json"],"security":[{"token":["token.create","token.*"]}],"tags":["Token"],"summary":"Create new token","description":"Create a new token for the current user","operationId":"createToken","parameters":[{"name":"userId","in":"path","description":"ID of the user","required":true,"type":"string"},{"name":"body","in":"body","description":"Api Token Creation","required":true,"schema":{"$ref":"#/definitions/ApiTokenCreate"}}],"responses":{"200":{"description":"Created token","schema":{"$ref":"#/definitions/ApiToken"}},"400":{"description":"Invalid input","schema":{"$ref":"#/definitions/ApiResponse"}},"401":{"description":"Authorization denied","schema":{"$ref":"#/definitions/ApiResponse"}},"404":{"description":"Object not found","schema":{"$ref":"#/definitions/ApiResponse"}},"500":{"description":"Something unexpected happened"}}}},"/user/{userId}/token/{tokenId}":{"get":{"consumes":["application/json"],"produces":["application/json"],"security":[{"token":["token","token.*"]}],"tags":["Token"],"summary":"Get token","description":"Get a single token for a user","operationId":"getToken","parameters":[{"name":"userId","in":"path","description":"ID of the user","required":true,"type":"string"},{"name":"tokenId","in":"path","description":"ID of the token","required":true,"type":"string"}],"responses":{"200":{"description":"Token","schema":{"$ref":"#/definitions/ApiToken"}},"400":{"description":"Invalid input","schema":{"$ref":"#/definitions/ApiResponse"}},"401":{"description":"Authorization denied","schema":{"$ref":"#/definitions/ApiResponse"}},"404":{"description":"Object not found","schema":{"$ref":"#/definitions/ApiResponse"}},"500":{"description":"Something unexpected happened"}}},"patch":{"consumes":["application/json"],"produces":["application/json"],"security":[{"token":["token.update","token.*"]}],"tags":["Token"],"summary":"Update token","description":"Update mutable attributes of a token","operationId":"updateToken","parameters":[{"name":"userId","in":"path","description":"ID of the user","required":true,"type":"string"},{"name":"tokenId","in":"path","description":"ID of the token","required":true,"type":"string"},{"name":"body","in":"body","description":"Api Token Update","required":true,"schema":{"$ref":"#/definitions/ApiTokenUpdate"}}],"responses":{"200":{"description":"Token","schema":{"$ref":"#/definitions/ApiToken"}},"400":{"description":"Invalid input","schema":{"$ref":"#/definitions/ApiResponse"}},"401":{"description":"Authorization denied","schema":{"$ref":"#/definitions/ApiResponse"}},"404":{"description":"Object not found","schema":{"$ref":"#/definitions/ApiResponse"}},"500":{"description":"Something unexpected happened"}}},"delete":{"consumes":["application/json"],"produces":["application/json"],"security":[{"token":["token.delete","token.*"]}],"tags":["Token"],"summary":"Delete token","description":"Delete a single token for a user","operationId":"deleteToken","parameters":[{"name":"userId","in":"path","description":"ID of the user","required":true,"type":"string"},{"name":"tokenId","in":"path","description":"ID of the token","required":true,"type":"string"}],"responses":{"200":{"description":"Token","schema":{"$ref":"#/definitions/ApiResponse"}},"400":{"description":"Invalid input","schema":{"$ref":"#/definitions/ApiResponse"}},"401":{"description":"Authorization denied","schema":{"$ref":"#/definitions/ApiResponse"}},"404":{"description":"Object not found","schema":{"$ref":"#/definitions/ApiResponse"}},"500":{"description":"Something unexpected happened"}}}},"/docs/v2/swagger":{"get":{"tags":["docs"],"summary":"Swagger definition","description":"Get swagger document (Used to generate this)","responses":{"200":{"description":"The swagger document"}}}},"/docs/v2/readme":{"get":{"tags":["docs"],"summary":"Router Readme","description":"Get the markdown readme for the router","responses":{"200":{"description":"The router readme"}}}},"/docs/cert":{"get":{"tags":["docs"],"summary":"Router Public Certificate","description":"Get the public certificate used to sign requests from the router","responses":{"200":{"description":"The router cert"}}}},"/docs/protocols":{"get":{"tags":["docs"],"summary":"Routing protocols","description":"Returns the set of protocols supported by the router","responses":{"200":{"description":"Supported protocols","schema":{"$ref":"#/definitions/Protocols"}}}}},"/docs/languages":{"get":{"tags":["docs"],"summary":"Templating languages","description":"Returns the set of supported templating languages","responses":{"200":{"description":"Set of templating languages","schema":{"type":"array","items":{"$ref":"#/definitions/Language"}}}}}}},"definitions":{"User":{"type":"object","description":"User object","properties":{"createdAt":{"type":"string","format":"date-time","readOnly":true},"updatedAt":{"type":"string","format":"date-time","readOnly":true},"id":{"type":"string","description":"ShortId user id","readOnly":true},"email":{"type":"string","description":"User email address","format":"email"},"secret":{"type":"string","description":"API Secret","readOnly":true},"passwordless":{"type":"boolean","description":"Whether or not the user is passwordless/userless","readOnly":true}}},"UserUpdate":{"type":"object","description":"User update","properties":{"password":{"type":"string","format":"password","description":"User password (will be hashed)"}}},"UserCreate":{"type":"object","description":"User object","properties":{"email":{"type":"string","description":"User email address","format":"email"},"password":{"type":"string","format":"password","description":"User password (hashed). Non-retrieveable"}}},"ApiTokenUpdate":{"type":"object","properties":{"name":{"type":"string","description":"Name of the api token, such as its use"},"scope":{"type":"string","description":"Space-separated list of requested access scope"}}},"ApiTokenCreate":{"type":"object","properties":{"name":{"type":"string","description":"Name of the api token, such as its use"},"scope":{"type":"string","description":"Space-separated list of requested access scope"},"client_id":{"type":"string","description":"Optional client Id the token belongs to, must be unique or null"}}},"ApiToken":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time","readOnly":true},"updatedAt":{"type":"string","format":"date-time","readOnly":true},"name":{"type":"string","description":"Name of the api token, such as its use"},"scope":{"type":"string","description":"Space-separated list of requested access scope"},"id":{"type":"string","description":"Generated token id","default":"24 bytes in hex encoding","readOnly":true},"secret":{"type":"string","description":"Generated token secret","default":"24 bytes in hex encoding","readOnly":true},"user_id":{"type":"string","description":"User the token belongs to","readOnly":true},"client_id":{"type":"string","description":"Client Id the token belongs to, can only be read once set","readOnly":true},"last_used":{"type":"string","description":"Last time the token was used via an API call","format":"date-time","readOnly":true}}},"TopicCreate":{"type":"object","properties":{"name":{"type":"string","description":"Name of the topic. Alphanumeric"},"key":{"type":"string","description":"Shared key to access topic. When creating, if the key is `true` it will be generated. `false` or `null` will be blank.","default":"true"},"async":{"type":"boolean","description":"If true, an event posted to the topic will not wait for the response before returning","default":"false"},"transient":{"type":"boolean","description":"If true, events won't be written to the database. NOTE: Cannot retry events that are transient","default":"false"},"template_id":{"type":"string","description":"Id of the template to execute against an event sent to this topic","default":"null"}}},"TopicUpdate":{"type":"object","properties":{"name":{"type":"string","description":"Name of the topic. Alphanumeric"},"key":{"type":"string","description":"Shared key to access topic. When creating, if the key is `true` it will be generated. `false` or `null` will be blank.","default":"true"},"async":{"type":"boolean","description":"If true, an event posted to the topic will not wait for the response before returning","default":"false"},"transient":{"type":"boolean","description":"If true, events won't be written to the database. NOTE: Cannot retry events that are transient","default":"false"},"template_id":{"type":"string","description":"Id of the template to execute against an event sent to this topic","default":"null"}}},"Topic":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time","readOnly":true},"updatedAt":{"type":"string","format":"date-time","readOnly":true},"name":{"type":"string","description":"Name of the topic. Alphanumeric"},"key":{"type":"string","description":"Shared key to access topic. When creating, if the key is `true` it will be generated. `false` or `null` will be blank.","default":"true"},"async":{"type":"boolean","description":"If true, an event posted to the topic will not wait for the response before returning","default":"false"},"transient":{"type":"boolean","description":"If true, events won't be written to the database. NOTE: Cannot retry events that are transient","default":"false"},"template_id":{"type":"string","description":"Id of the template to execute against an event sent to this topic","default":"null"},"id":{"type":"string","description":"ShortId of the topic","readOnly":true},"user_id":{"type":"string","description":"User the topic belongs to","readOnly":true},"subscriptions":{"type":"array","readOnly":true,"items":{"$ref":"#/definitions/Subscription"}}}},"SubscriptionCreate":{"type":"object","properties":{"name":{"type":"string","description":"Human-readable description of the subscription"},"key":{"type":"string","description":"Shared key sent to the subscriber upon invocation","default":"null"},"method":{"type":"string","description":"HTTP Method to invoke the endpoint with. SOURCE is special, and will copy the the invocation method","enum":["GET","POST","PUT","PATCH","DELETE","SOURCE"],"default":"POST"},"uri":{"type":"string","description":"The URI to be invoked. Can be any supported URI types (See subscription docs)"},"template_id":{"type":"string","description":"The id of the template to invoke ont he payload before sending to the destination","default":"null"},"volatile":{"type":"boolean","description":"If true, the subscription will be removed automatically and immediately upton the first failure to call the endpoint","default":"false"},"retry":{"type":"boolean","description":"If true, the subscription will be queued for retry if there is an error posting to it. eg a non-2xx","default":"false"},"enabled":{"type":"boolean","description":"If false, the subscription will not be triggered on an incoming event","default":"true"}}},"SubscriptionUpdate":{"type":"object","properties":{"name":{"type":"string","description":"Human-readable description of the subscription"},"key":{"type":"string","description":"Shared key sent to the subscriber upon invocation","default":"null"},"method":{"type":"string","description":"HTTP Method to invoke the endpoint with. SOURCE is special, and will copy the the invocation method","enum":["GET","POST","PUT","PATCH","DELETE","SOURCE"],"default":"POST"},"uri":{"type":"string","description":"The URI to be invoked. Can be any supported URI types (See subscription docs)"},"template_id":{"type":"string","description":"The id of the template to invoke ont he payload before sending to the destination","default":"null"},"volatile":{"type":"boolean","description":"If true, the subscription will be removed automatically and immediately upton the first failure to call the endpoint","default":"false"},"retry":{"type":"boolean","description":"If true, the subscription will be queued for retry if there is an error posting to it. eg a non-2xx","default":"false"},"enabled":{"type":"boolean","description":"If false, the subscription will not be triggered on an incoming event","default":"true"}}},"Subscription":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time","readOnly":true},"updatedAt":{"type":"string","format":"date-time","readOnly":true},"name":{"type":"string","description":"Human-readable description of the subscription"},"key":{"type":"string","description":"Shared key sent to the subscriber upon invocation","default":"null"},"method":{"type":"string","description":"HTTP Method to invoke the endpoint with. SOURCE is special, and will copy the the invocation method","enum":["GET","POST","PUT","PATCH","DELETE","SOURCE"],"default":"POST"},"uri":{"type":"string","description":"The URI to be invoked. Can be any supported URI types (See subscription docs)"},"template_id":{"type":"string","description":"The id of the template to invoke ont he payload before sending to the destination","default":"null"},"volatile":{"type":"boolean","description":"If true, the subscription will be removed automatically and immediately upton the first failure to call the endpoint","default":"false"},"retry":{"type":"boolean","description":"If true, the subscription will be queued for retry if there is an error posting to it. eg a non-2xx","default":"false"},"enabled":{"type":"boolean","description":"If false, the subscription will not be triggered on an incoming event","default":"true"},"id":{"type":"string","description":"ShortId of the subscription","readOnly":true}}},"TemplateCreate":{"type":"object","properties":{"name":{"type":"string","description":"Human-readable name of the template"},"language":{"type":"string","description":"Language the template is in","enum":["VALID:KEYS"]},"source":{"type":"string","description":"The source code for the template"}}},"TemplateUpdate":{"type":"object","properties":{"name":{"type":"string","description":"Human-readable name of the template"},"language":{"type":"string","description":"Language the template is in","enum":["VALID:KEYS"]},"source":{"type":"string","description":"The source code for the template"}}},"Template":{"type":"object","properties":{"id":{"type":"string","description":"ID of the template","readOnly":true},"owner_user_id":{"type":"string","description":"The owner of the template. If null, is global template","readOnly":true},"createdAt":{"type":"string","format":"date-time","readOnly":true},"updatedAt":{"type":"string","format":"date-time","readOnly":true},"name":{"type":"string","description":"Human-readable name of the template"},"language":{"type":"string","description":"Language the template is in","enum":["VALID:KEYS"]},"source":{"type":"string","description":"The source code for the template"}}},"Event":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time","readOnly":true},"updatedAt":{"type":"string","format":"date-time","readOnly":true},"id":{"type":"string","description":"UUID of event","readOnly":true},"topic_id":{"type":"string","description":"Owning topic id","readOnly":true},"user_id":{"type":"string","description":"Owning user id","readOnly":true},"payload":{"type":"string","description":"Raw payload of the event","readOnly":true},"delivery_count":{"type":"integer","description":"Number of times the event was attempted delivered","readOnly":true},"responses":{"description":"(Optional) Array of responses returned to the event","type":"array","readOnly":true,"items":{"$ref":"#/definitions/EventResponse"}},"topic":{"description":"(Optional) The topic object that the event belongs to","type":"object"}}},"EventResponse":{"type":"object","properties":{"createdAt":{"type":"string","format":"date-time","readOnly":true},"updatedAt":{"type":"string","format":"date-time","readOnly":true},"id":{"type":"string","description":"UUID Of the event response","readOnly":true},"event_id":{"type":"string","description":"UUID of the event that was responded to","readOnly":true},"user_id":{"type":"string","description":"ShortId of the user","readOnly":true},"subscription_id":{"type":"string","description":"ShortId of the subscription","readOnly":true},"payload":{"type":"string","description":"Raw payload of the response","readOnly":true}}},"EventTimeSeries":{"type":"object","properties":{"topic_id":{"type":"string","description":"Id of the topic","readOnly":true},"bucket":{"type":"string","description":"The bucket date-time","readOnly":true},"count":{"type":"integer","description":"The number of events that were published in the time bucket","readOnly":true}}},"ApiResponse":{"type":"object","properties":{"statusCode":{"type":"integer","format":"int32"},"message":{"type":"string","example":"A message describing the error"},"error":{"type":"string","example":"Information about an error"}}},"Protocols":{"type":"object","properties":{"protocolName":{"description":"The name of the protocol in the URI segment","type":"object","properties":{"handler":{"type":"string","description":"What builtin module handles the request"},"description":{"type":"string","description":"A description of what the protocol does"}}}}},"Language":{"type":"object","properties":{"language":{"type":"string","description":"Language unique identifier"},"description":{"type":"string","description":"Short description of language"}}}},"externalDocs":{"description":"Find out more about Swagger","url":"http://swagger.io"}}