{"swagger":"2.0","info":{"version":"0.56.7","title":"TT Content API","description":"\n## Current status\n* All endpoints are implemented and working according to spec.\n* `400` errors have a formalized body data structure. Other error types may return\n  any value in the body, and may be formalized in the future.\n\n## Authentication\nThe content API supports OAuth2 token bearer authentication. Documentation [here](https://developer.tt.se/api/oauth2/).\n\nIn order to access the API, the token must have at least scope `roles`.\nThe endpoints under `/user/v1/organization/user` additionally requires the token to have the scope `admin`, and the user to have access level `admin`\n"},"host":"api.tt.se","basePath":"/","schemes":["https"],"consumes":["application/json"],"produces":["application/json","text/plain"],"securityDefinitions":{"OAuth2":{"type":"oauth2","flow":"implicit","authorizationUrl":"https://tt.se/o/oauth2/auth","scopes":{"roles":"Allow access to user roles","admin":"Allow access to user administration API"}},"NtbJwtBearer":{"type":"apiKey","in":"header","name":"Authorization"},"TTJwtBearer":{"type":"apiKey","in":"header","name":"Authorization"},"ElephantJwtBearer":{"type":"apiKey","in":"header","name":"Authorization"},"ApiKey":{"type":"apiKey","in":"header","name":"Authorization"},"Default":{"type":"basic"}},"security":[{"OAuth2":[]},{"NtbJwtBearer":[]},{"TTJwtBearer":[]},{"ApiKey":[]}],"parameters":{"mediaTypes":{"name":"mediaType","in":"path","type":"string","enum":["_all","image","video","graphic","text","feature","page","planning","calendar","stockfoto"],"required":true,"description":"Only return items of this media type.","x-example":"image"},"streamingMediaTypes":{"name":"mediaType","in":"path","type":"string","enum":["_all","image","video","graphic","text","feature","page","planning","calendar"],"required":true,"description":"Only return items of this media type.","x-example":"image"},"q":{"name":"q","in":"query","type":"string","description":"A query string used for free text searching.","x-example":"panda"},"p":{"name":"p","in":"query","type":"array","collectionFormat":"csv","items":{"type":"string"},"description":"A list of product codes. Only items matching at least one of these codes will be returned. The list of current product codes is [here](https://tt.se/spec/product/1.0).\nIndividual product codes may be prefixed with a '-' sign, indicating that the code should instead be excluded from the search result.","x-example":["FOGNRE","-FOGNREEJ"]},"agr":{"name":"agr","in":"query","type":"array","collectionFormat":"csv","items":{"type":"integer"},"description":"A list of customer agreement IDs belonging to the current user. Only items covered by at least one of there agreements will be returned.","x-example":[20031,20035]},"tr":{"name":"tr","in":"query","type":"string","enum":["h","d","w","m","y"],"description":"Time range: last hour, day, week, month, or year.","x-example":"w"},"trs":{"name":"trs","in":"query","type":"string","format":"date","description":"Start date"},"tre":{"name":"tre","in":"query","type":"string","format":"date","description":"End date"},"pubstatus":{"name":"pubstatus","description":"Searching for `commissioned` items requires admin privileges.","in":"query","type":"array","collectionFormat":"csv","items":{"type":"string","enum":["usable","replaced","commissioned"]},"default":["usable"]},"s":{"name":"s","in":"query","type":"integer","maximum":10000,"default":20,"description":"Size of search result."},"fr":{"name":"fr","in":"query","type":"integer","maximum":10000,"description":"Index into the search result. Used for pagination. It is recommended to make this value a multiple of the search result size (`s`), as some media types do not support arbitrary values here."},"sort":{"name":"sort","in":"query","type":"string","enum":["default:desc","default:asc","date:desc","date:asc","versioncreated:desc","versioncreated:asc","versionstored:desc","versionstored:asc","relevance"],"default":"default:desc","description":"Sort order for the result. Documentation on various date fields can be found [here](http://spec.tt.se/dates).\n  * default:desc / default:asc - Sort on the internal field '_tstamp' in descending or ascending order respectively.\n  * date:desc / date:asc - Sort on the field 'date' in descending or ascending order respectively.\n  * versioncreated:desc / versioncreated:asc - Sort on the field 'versioncreated' in descending or ascending order respectively.\n  * versionstored:desc / versionstored:asc - Sort on the field 'versionstored' in descending or ascending order respectively.\n  * relevance - Sort on relevance. The most relevant matches first.","x-example":"date:asc"},"facets":{"name":"facets","in":"query","type":"array","items":{"type":"string","enum":["copyrightholder","person.name","place.name","product.code","subject.code"]},"description":"Enable search facets; in addition to the regular search result the API will also return one or more additional facets which contain information about how many search results can be expected if the current query is narrowed down using popular subject codes, product codes, etc."},"layout":{"name":"layout","in":"query","type":"string","enum":["bare","full"],"default":"full","description":"By default the full TTNinjs document is returned for each search hit. This may be too cumbersome for some use cases; for example when the client requests a large search result to be displayed in a list form.\nThis parameter allows the client to control the layout of the items in the search result:\n* full - (default) return the full TTNinjs document\n* bare - return only `headline`, `date`, `uri`, `renditions`, `associations`, `pubstatus`, `originaltransmissionreference`, `copyrightholder`. In addition, all `associations` except the first are stripped away, and `renditions` will only contain the thumbnail rendition."},"collectionId":{"name":"id","in":"path","type":"string","required":true,"description":"ID of a collection.","x-example":"123"},"collection":{"name":"collection","in":"body","schema":{"type":"object","properties":{"name":{"type":"string"},"public":{"type":"boolean"}},"required":["name"],"example":{"name":"my collection"}},"required":true},"collectionItem":{"name":"items","in":"body","schema":{"type":"array","minItems":1,"items":{"type":"object","properties":{"uri":{"type":"string","format":"uri"}},"required":["uri"]},"example":[{"uri":"http://tt.se/media/image/sdltd8f4d87"}]},"required":true,"description":"A list list of items to add to or remove from a collection. Each object in the list should have an `uri` property."},"property":{"name":"property","description":"A list of property names.","in":"path","type":"array","items":{"type":"string"},"collectionFormat":"csv","required":true,"x-example":["property1","property2"]},"notificationId":{"name":"id","description":"An notification UUID string.","in":"path","type":"string","format":"uuid","required":true,"x-example":"4a37869c-808f-496f-b549-3da0821ce187"},"notificationEmail":{"name":"email","in":"query","type":"string","required":true,"description":"The email address to send emails to.","x-example":"my.email@address.com"},"notificationSchedule":{"name":"schedule","in":"query","type":"string","required":true,"description":"A cron expression.","x-example":"0 0 12 * * MON-FRI"},"notificationTimezone":{"name":"timezone","in":"query","type":"string","format":"timezone","description":"A valid time zone name","default":"Europe/Stockholm","x-example":"Europe/Stockholm"},"userId":{"name":"id","type":"integer","in":"path","required":true,"description":"A user ID","x-example":123},"userCreateInput":{"name":"user","in":"body","schema":{"type":"object","additionalProperties":false,"properties":{"firstName":{"type":"string"},"lastName":{"type":"string"},"emailAddress":{"type":"string","format":"email"},"phoneNumber":{"$ref":"#/definitions/phoneNumber"},"department":{"type":"string"},"access":{"$ref":"#/definitions/access"}},"required":["emailAddress","firstName","lastName"]}},"userUpdateInput":{"name":"user","in":"body","schema":{"type":"object","additionalProperties":false,"properties":{"firstName":{"type":"string"},"lastName":{"type":"string"},"emailAddress":{"type":"string","format":"email"},"phoneNumber":{"$ref":"#/definitions/phoneNumber"},"department":{"type":"string"},"access":{"$ref":"#/definitions/access"}}}},"orderInput":{"name":"order","in":"body","schema":{"type":"object","additionalProperties":false,"properties":{"license":{"type":"object","additionalProperties":false,"properties":{"uuid":{"type":"string","format":"uuid"}},"required":["uuid"]},"invoiceText":{"type":"string"},"approve":{"type":"boolean","description":"If 'true', a `license` must be supplied. Applicable licenses can be obtained by calling `GET <uri>/pricelist`\n"}},"required":["approve"]}}},"definitions":{"ttninjs":{"$ref":"https://tt.se/spec/ttninjs/ttninjs-schema_1.6.json#/"},"access":{"type":"object","description":"Describes a user's special access levels.","additionalProperties":false,"properties":{"admin":{"type":"boolean","description":"Indicates that the user has administrative access for user accounts belonging to the same organization."},"mediebank":{"type":"boolean","description":"Indicates that the user has access to the Mediebank product."}}},"address":{"type":"object","additionalProperties":false,"properties":{"street":{"type":"string","x-expample":"Gatvägen 1"},"box":{"type":"string","example":"Box 123"},"zipCode":{"type":"string","example":"123 45"},"city":{"type":"string","example":"Staden"},"country":{"type":"string","example":"Sverige"}}},"agreement":{"type":"object","properties":{"id":{"type":"integer"},"description":{"type":["string","null"]},"type":{"type":"string","enum":["Subscription","Direct","Normal","Sketch"]},"isSuperAgreement":{"type":"boolean","description":"An agreement that has a truthy value of isSuperAgreement will override any agreement of Subscription type."},"products":{"type":"array","items":{"$ref":"#/definitions/product"}}}},"agreement2":{"type":"object","title":"agreement","additionalProperties":false,"properties":{"id":{"type":"integer"},"name":{"type":"string","example":"Nyhetspaket"},"type":{"$ref":"#/definitions/agreementType"},"description":{"type":"string"},"expires":{"type":"string","format":"date-time"},"superAgreement":{"type":"boolean"},"products":{"type":"array","items":{"$ref":"#/definitions/product2"}},"prepaids":{"type":"object","additionalProperties":false,"properties":{"total":{"type":"integer"},"remaining":{"type":"integer"}},"required":["total","remaining"]}},"required":["id","type","superAgreement","products"]},"agreementType":{"title":"agreementType","enum":["Subscription","Direct","Normal","Prepaid"]},"collection":{"title":"collection","type":"object","additionalProperties":false,"properties":{"accessed":{"type":"string","format":"date-time"},"content":{"type":"array","items":{"type":"string","format":"uri"}},"removedContent":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"uri":{"type":"string"},"headline":{"type":"string"},"description_text":{"type":"string"},"timestamp":{"type":"string","format":"date-time"}}}},"created":{"type":"string","format":"date-time"},"id":{"type":"string"},"modified":{"type":"string","format":"date-time"},"name":{"type":"string"},"owner":{"type":"string"},"public":{"type":"boolean"}},"required":["accessed","content","created","id","name","owner","public"]},"collectionItem":{"type":"object","allOf":[{"$ref":"#/definitions/collection"}],"properties":{"items":{"type":"array","items":{"$ref":"#/definitions/ttninjs"}}},"required":["items"]},"error":{"type":"object","additionalProperties":false,"properties":{"errorCode":{"type":"string"},"location":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}}},"errors":{"type":"object","properties":{"errors":{"type":"array","items":{"$ref":"#/definitions/error"}}}},"facet":{"type":"object","properties":{"key":{"type":"string"},"count":{"type":"integer"}}},"license":{"type":"object","additionalProperties":false,"properties":{"uuid":{"type":"string","format":"uuid"},"period":{"enum":["Year","Month","Single"]},"volume":{"type":"string"},"price":{"$ref":"#/definitions/monetaryAmount"},"description":{"type":"string"},"product":{"$ref":"#/definitions/product"}},"required":["product"]},"monetaryAmount":{"type":"string","pattern":"^-?\\d+\\.\\d\\d","description":"Monetary amount expressed as a string, with exactly two decimals.","example":100},"order":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"integer"},"item":{"type":"object","additionalProperties":false,"properties":{"uri":{"type":"string"},"headline":{"type":"string"},"byline":{"type":"string"},"source":{"type":"string"}}},"price":{"type":"object","additionalProperties":false,"properties":{"name":{"type":"string"},"description":{"type":"string"},"license":{"$ref":"#/definitions/license"},"agreement":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"integer"},"name":{"type":"string"},"type":{"$ref":"#/definitions/agreementType"}},"required":["id","type"]}},"required":["name","license","agreement"]},"invoiceText":{"type":"string"},"created":{"type":"string","format":"date-time"},"downloadableUntil":{"type":"string","format":"date-time"},"reportingDeadline":{"type":"string","format":"date-time"},"reported":{"type":"string","format":"date-time","description":"The date when usage was reported for this order."},"approved":{"type":"boolean","description":"`true` if the download has been approved, `false` if not."},"manual":{"type":"boolean","description":"`true` if manual order handling has been requested."}},"required":["id","item","price","created","downloadableUntil"]},"notification":{"type":"object","required":["id","type","mediaType"],"properties":{"id":{"type":"string","format":"uuid"},"title":{"type":"string"},"type":{"type":"string","enum":["mobile","email","scheduled-email","stream"],"description":"The type of notification:\n  * `mobile`: mobile notifications will be sent to each\n  device registered by this users.\n  * `email`: notifications will be sent as email to the\n  specified email address.\n  * `scheduled-email`: notifications will be sent as an\n  email to the specified email address according to the\n  specified schedule.\n  * `stream`: notifications are consumed by calling the\n  the `GET /content/v1/{mediaType}/notification/{id}/stream/new`\n  endpoint."},"mediaType":{"type":"string","enum":["_all","image","video","graphic","text","feature","page","planning","calendar"]},"q":{"type":"string","description":"A query string."},"p":{"type":"array","items":{"type":"string"},"description":"A list of product codes."},"agr":{"type":"array","items":{"type":"integer"},"description":"A list of customer agreement IDs."},"schedule":{"type":"string","description":"A cron expression. Only applicable for `scheduled-email` notifications."},"timezone":{"type":"string","description":"A time zone name. Only applicable for `scheduled-email` notifications."},"email":{"type":"string","description":"Address to send notifications to. Only applicable for `email` and `scheduled-email` notifications."}}},"organization":{"type":"object","title":"organization","additionalProperties":false,"properties":{"id":{"type":"integer"},"name":{"type":"string"},"currency":{"type":"string","example":"SEK"},"country":{"type":"string","example":"Sverige"},"address":{"title":"addresses","type":"object","additionalProperties":false,"properties":{"visit":{"$ref":"#/definitions/address"},"postal":{"$ref":"#/definitions/address"},"billing":{"$ref":"#/definitions/address"}}},"phoneNumber":{"$ref":"#/definitions/phoneNumberDirect"}},"required":["id","address","phoneNumber"]},"phoneNumber":{"type":"object","additionalProperties":false,"properties":{"direct":{"type":"string"},"mobile":{"type":"string"}}},"phoneNumberDirect":{"type":"object","additionalProperties":false,"properties":{"direct":{"type":"string"}}},"product":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":["string","null"]},"code":{"type":"string"}}},"product2":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"integer"},"name":{"type":"string"},"description":{"type":"string"},"code":{"type":"string"}},"required":["id","code"]},"user":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"integer"},"customerId":{"type":"integer"},"userName":{"type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"},"emailAddress":{"type":"string"},"department":{"type":"string"},"phoneNumber":{"$ref":"#/definitions/phoneNumber"},"agreements":{"type":"array","items":{"$ref":"#/definitions/agreement2"}},"access":{"$ref":"#/definitions/access"},"active":{"type":"boolean"}},"required":["id","userName","phoneNumber","agreements","access","active"]},"userBase":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"integer"},"customerId":{"type":"integer"},"userName":{"type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"},"emailAddress":{"type":"string"},"department":{"type":"string"},"active":{"type":"boolean"}},"required":["id","userName","active"]}},"paths":{"/content/v1/{mediaType}/search":{"get":{"summary":"Searching the TT archives.","operationId":"search","tags":["content"],"security":[{"OAuth2":[]},{"NtbJwtBearer":[]},{"TTJwtBearer":[]},{"ElephantJwtBearer":["content-api"]},{"ApiKey":[]},{"Default":[]}],"parameters":[{"$ref":"#/parameters/mediaTypes"},{"$ref":"#/parameters/q"},{"$ref":"#/parameters/p"},{"$ref":"#/parameters/agr"},{"$ref":"#/parameters/tr"},{"$ref":"#/parameters/trs"},{"$ref":"#/parameters/tre"},{"$ref":"#/parameters/pubstatus"},{"$ref":"#/parameters/s"},{"$ref":"#/parameters/fr"},{"$ref":"#/parameters/sort"},{"$ref":"#/parameters/facets"},{"$ref":"#/parameters/layout"}],"responses":{"200":{"description":"Success","schema":{"type":"object","properties":{"hits":{"type":"array","items":{"$ref":"#/definitions/ttninjs"}},"total":{"type":"integer"},"facets":{"type":"object","properties":{"subject.code":{"type":"array","items":{"$ref":"#/definitions/facet"}},"product.code":{"type":"array","items":{"$ref":"#/definitions/facet"}},"place.name":{"type":"array","items":{"$ref":"#/definitions/facet"}},"person.name":{"type":"array","items":{"$ref":"#/definitions/facet"}},"copyrightholder":{"type":"array","items":{"$ref":"#/definitions/facet"}}}}},"required":["hits","total"]}},"400":{"description":"Illegal argument","schema":{"$ref":"#/definitions/errors"}}}},"parameters":[]},"/content/v1/{mediaType}/stream":{"get":{"summary":"Realtime delivery of content.","operationId":"stream","description":"Long poll call that will wait for a specified time period (default: 60s, max 300s) until a matching item is published. The parameters are similar to those for `search`, with the exception that time ranges and pagination doesn't make sense in this context (we will always return the most recent item).\n*DEPRECATED:* This endpoint cannot guarantee delivery in the event that two items are published at the exact same time. Consider using `/content/v1/{mediaType}/notification/stream` instead.","deprecated":true,"tags":["content"],"security":[{"OAuth2":[]},{"NtbJwtBearer":[]},{"TTJwtBearer":[]},{"ElephantJwtBearer":["content-api"]},{"ApiKey":[]},{"Default":[]}],"parameters":[{"$ref":"#/parameters/streamingMediaTypes"},{"$ref":"#/parameters/q"},{"$ref":"#/parameters/p"},{"$ref":"#/parameters/agr"},{"$ref":"#/parameters/sort"},{"$ref":"#/parameters/layout"},{"name":"last","in":"query","type":"string","format":"uri","description":"The uri of the last item received."},{"name":"wait","in":"query","type":"integer","default":60,"maximum":300,"description":"The time (in seconds) to wait for updates before returning an empty result."}],"responses":{"200":{"description":"Success","schema":{"type":"object","properties":{"hits":{"type":"array","items":{"$ref":"#/definitions/ttninjs"}}},"required":["hits"]}},"400":{"description":"Illegal argument","schema":{"$ref":"#/definitions/errors"}}}},"parameters":[]},"/content/v1/{mediaType}/notification":{"get":{"summary":"List all notifications","operationId":"notificationGet","tags":["notification"],"parameters":[{"$ref":"#/parameters/streamingMediaTypes"}],"responses":{"200":{"description":"Success","schema":{"type":"array","items":{"$ref":"#/definitions/notification"}}},"400":{"description":"Illegal argument","schema":{"$ref":"#/definitions/errors"}}}},"parameters":[]},"/content/v1/{mediaType}/notification/mobile":{"post":{"summary":"Create a new mobile notification","operationId":"mobileNotificationPost","tags":["notification"],"consumes":["application/octet-stream"],"parameters":[{"$ref":"#/parameters/streamingMediaTypes"},{"$ref":"#/parameters/q"},{"$ref":"#/parameters/p"},{"$ref":"#/parameters/agr"},{"name":"title","in":"query","type":"string","required":true,"x-example":"my mobile notification"}],"responses":{"200":{"description":"Success","schema":{"$ref":"#/definitions/notification"}},"400":{"description":"Illegal argument","schema":{"$ref":"#/definitions/errors"}}}},"parameters":[]},"/content/v1/{mediaType}/notification/email":{"post":{"summary":"Create a new email notification","operationId":"emailNotificationPost","tags":["notification"],"consumes":["application/octet-stream"],"parameters":[{"$ref":"#/parameters/streamingMediaTypes"},{"$ref":"#/parameters/q"},{"$ref":"#/parameters/p"},{"$ref":"#/parameters/agr"},{"name":"title","in":"query","type":"string","required":true,"x-example":"my email notification"},{"name":"email","in":"query","type":"string","required":true,"description":"The email address to send emails to.","x-example":"my.email@address.com"}],"responses":{"200":{"description":"Success","schema":{"$ref":"#/definitions/notification"}},"400":{"description":"Illegal argument","schema":{"$ref":"#/definitions/errors"}}}},"parameters":[]},"/content/v1/{mediaType}/notification/scheduled-email":{"post":{"summary":"Create a new scheduled email notification","operationId":"scheduledEmailNotificationPost","tags":["notification"],"consumes":["application/octet-stream"],"parameters":[{"$ref":"#/parameters/streamingMediaTypes"},{"$ref":"#/parameters/q"},{"$ref":"#/parameters/p"},{"$ref":"#/parameters/agr"},{"$ref":"#/parameters/tr"},{"name":"title","in":"query","type":"string","required":true,"x-example":"my scheduled email notification"},{"$ref":"#/parameters/notificationEmail"},{"$ref":"#/parameters/notificationSchedule"},{"$ref":"#/parameters/notificationTimezone"}],"responses":{"200":{"description":"Success","schema":{"$ref":"#/definitions/notification"}},"400":{"description":"Illegal argument","schema":{"$ref":"#/definitions/errors"}}}},"parameters":[]},"/content/v1/{mediaType}/notification/stream":{"post":{"summary":"Create a new content stream","description":"Creates a new notification of type `stream` and returns the details.\nItems of the given `mediaType` matching the parameters `q`, `p` and `agr` will be added to the stream in near real-time as they are indexed into the content database.\nThe contents of the stream can be consumed by calling the `GET /content/v1/{mediaType}/notification/{id}/stream` endpoint.\n","operationId":"streamNotificationPost","tags":["notification"],"consumes":["application/octet-stream"],"parameters":[{"$ref":"#/parameters/streamingMediaTypes"},{"$ref":"#/parameters/q"},{"$ref":"#/parameters/p"},{"$ref":"#/parameters/agr"},{"name":"title","in":"query","type":"string","default":"","x-example":"my stream notification"}],"responses":{"200":{"description":"Success","schema":{"$ref":"#/definitions/notification"}},"400":{"description":"Illegal argument","schema":{"$ref":"#/definitions/errors"}}}},"parameters":[]},"/content/v1/{mediaType}/notification/{id}/mobile":{"put":{"summary":"Update an existing mobile notification","operationId":"mobileNotificationPut","tags":["notification"],"consumes":["application/octet-stream"],"parameters":[{"$ref":"#/parameters/streamingMediaTypes"},{"$ref":"#/parameters/notificationId"},{"$ref":"#/parameters/q"},{"$ref":"#/parameters/p"},{"$ref":"#/parameters/agr"},{"name":"title","in":"query","type":"string","required":true,"x-example":"my mobile notification"}],"responses":{"200":{"description":"Success","schema":{"$ref":"#/definitions/notification"}},"400":{"description":"Illegal argument","schema":{"$ref":"#/definitions/errors"}}}},"parameters":[]},"/content/v1/{mediaType}/notification/{id}/email":{"put":{"summary":"Update an existing email notification","operationId":"emailNotificationPut","tags":["notification"],"consumes":["application/octet-stream"],"parameters":[{"$ref":"#/parameters/streamingMediaTypes"},{"$ref":"#/parameters/notificationId"},{"$ref":"#/parameters/q"},{"$ref":"#/parameters/p"},{"$ref":"#/parameters/agr"},{"name":"title","in":"query","type":"string","required":true,"x-example":"my email notification"},{"$ref":"#/parameters/notificationEmail"}],"responses":{"200":{"description":"Success","schema":{"$ref":"#/definitions/notification"}},"400":{"description":"Illegal argument","schema":{"$ref":"#/definitions/errors"}}}},"parameters":[]},"/content/v1/{mediaType}/notification/{id}/scheduled-email":{"put":{"summary":"Update an existing scheduled email notification","operationId":"scheduledEmailNotificationPut","tags":["notification"],"consumes":["application/octet-stream"],"parameters":[{"$ref":"#/parameters/streamingMediaTypes"},{"$ref":"#/parameters/notificationId"},{"$ref":"#/parameters/q"},{"$ref":"#/parameters/p"},{"$ref":"#/parameters/agr"},{"$ref":"#/parameters/tr"},{"name":"title","in":"query","type":"string","required":true,"x-example":"my scheduled email notification"},{"$ref":"#/parameters/notificationEmail"},{"$ref":"#/parameters/notificationSchedule"},{"$ref":"#/parameters/notificationTimezone"}],"responses":{"200":{"description":"Success","schema":{"$ref":"#/definitions/notification"}},"400":{"description":"Illegal argument","schema":{"$ref":"#/definitions/errors"}}}},"parameters":[]},"/content/v1/{mediaType}/notification/{id}/stream":{"put":{"summary":"Update an existing content stream","operationId":"streamNotificationPut","tags":["notification"],"consumes":["application/octet-stream"],"parameters":[{"$ref":"#/parameters/streamingMediaTypes"},{"$ref":"#/parameters/notificationId"},{"$ref":"#/parameters/q"},{"$ref":"#/parameters/p"},{"$ref":"#/parameters/agr"},{"$ref":"#/parameters/tr"},{"name":"title","in":"query","type":"string","required":true,"x-example":"my stream notification"}],"responses":{"200":{"description":"Success","schema":{"$ref":"#/definitions/notification"}},"400":{"description":"Illegal argument","schema":{"$ref":"#/definitions/errors"}}}},"get":{"summary":"Read new items from a content stream","description":"This is a HTTP long-poll request that consumes items from a previously created notification stream. It will hang until content is available, or a pre-determined number of seconds (given by the `wait` parameter) has passed, whichever comes first. In the latter case, the response code will still be HTTP 200, but the `hits` property of the result body will be an empty array.\nNote that this endpoint is not idempotent; calling it repeatedly will yield different results depending on the current contents of the stream.\nNotification streams expire after 5 minutes of client inactivity.\n","operationId":"streamNotificationGet","tags":["notification"],"consumes":["application/octet-stream"],"parameters":[{"$ref":"#/parameters/streamingMediaTypes"},{"$ref":"#/parameters/notificationId"},{"$ref":"#/parameters/s"},{"$ref":"#/parameters/layout"},{"name":"wait","in":"query","type":"integer","default":60,"minimum":1,"maximum":60,"description":"The time (in seconds) to wait for updates before returning an empty result."}],"responses":{"200":{"description":"Success","schema":{"type":"object","properties":{"hits":{"type":"array","items":{"$ref":"#/definitions/ttninjs"}}},"required":["hits"]}},"400":{"description":"Illegal argument","schema":{"$ref":"#/definitions/errors"}},"404":{"description":"Not found. Either the stream does not exist, or it has expired."}}},"parameters":[]},"/content/v1/{mediaType}/notification/{id}":{"delete":{"summary":"Remove an existing notification","operationId":"notificationDelete","tags":["notification"],"consumes":["application/octet-stream"],"parameters":[{"$ref":"#/parameters/streamingMediaTypes"},{"$ref":"#/parameters/notificationId"}],"responses":{"200":{"description":"Success","schema":{"type":"string"}},"400":{"description":"Illegal argument","schema":{"$ref":"#/definitions/errors"}}}},"parameters":[]},"/user/v1/agreement":{"get":{"summary":"Get the current customer agreements.","operationId":"agreementGet","description":"Return a list of applicable customer agreements for the current user. An agreement that has a truthy value of isSuperAgreement will override any agreement of Subscription type.\n\n*DEPRECATED*: This endpoint has been deprecated in favor of `/user/v1/user`","deprecated":true,"tags":["user"],"responses":{"200":{"description":"Success","schema":{"type":"array","items":{"$ref":"#/definitions/agreement"}}},"400":{"description":"Illegal argument","schema":{"$ref":"#/definitions/errors"}}}},"parameters":[]},"/user/v1/order":{"get":{"summary":"Get the order/license history for the current user. If the user has customer admin privileges, include all orders for the whole organization.","operationId":"orderList","tags":["user"],"parameters":[{"name":"size","type":"number","default":20,"in":"query"},{"name":"start","type":"number","default":0,"in":"query"},{"name":"status","in":"query","type":"string","enum":["reported","unreported","all"],"default":"all"}],"responses":{"200":{"description":"Success","schema":{"type":"object","additionalProperties":false,"properties":{"orders":{"type":"array","items":{"$ref":"#/definitions/order"}}}}},"400":{"description":"Illegal argument","schema":{"$ref":"#/definitions/errors"}}}},"parameters":[]},"/user/v1/order/{id}":{"put":{"summary":"Update an unreported order row.","operationId":"orderPut","tags":["user"],"parameters":[{"name":"id","type":"number","in":"path","required":true},{"$ref":"#/parameters/orderInput"}],"responses":{"200":{"description":"Success","schema":{"$ref":"#/definitions/order"}},"400":{"description":"Illegal argument","schema":{"$ref":"#/definitions/errors"}}}},"parameters":[]},"/user/v1/profile":{"get":{"summary":"Get the profile for the current user.","operationId":"profileGet","description":"The user profile is an unstructured JSON object containing non-secret application data (settings and such). Web applications are free to access this information as they see fit.","tags":["user"],"responses":{"200":{"description":"Success","schema":{"type":"object"}},"400":{"description":"Illegal argument","schema":{"$ref":"#/definitions/errors"}}}},"put":{"summary":"Update the profile for the current user.","operationId":"profilePut","description":"Replaces the entire user profile with the object passed in the request body.\n\nFor more controlled updates of the user profile, use the `PUT /user/v1/profile/{property}` endpoint.","tags":["user"],"parameters":[{"name":"profile","description":"The user profile object.","in":"body","schema":{"type":"object","example":{"property1":"customValue"}}}],"responses":{"200":{"description":"Success","schema":{"type":"string"}},"400":{"description":"Illegal argument","schema":{"$ref":"#/definitions/errors"}}}},"parameters":[]},"/user/v1/profile/{property}":{"get":{"summary":"Get selected properties of the profile for the current user.","operationId":"profilePropertyGet","description":"The user profile is an unstructured JSON object containing non-secret application data (settings and such). Web applications are free to access this information as they see fit.\nOften, applications are not interested in the whole user profile. This endpoint returns only selected properties.","tags":["user"],"parameters":[{"$ref":"#/parameters/property"}],"responses":{"200":{"description":"Success\nThe response object is a subset of the regular user profile, with only the selected properties listed.","schema":{"type":"object"}},"400":{"description":"Illegal argument","schema":{"$ref":"#/definitions/errors"}}}},"put":{"summary":"Update selected properties of the profile for the current user.","operationId":"profilePropertyPut","description":"Replaces selected properties, but doesn't modify the rest of the user profile. This is a more controlled version of the `PUT /user/v1/profile` endpoint.\n\nGiven a `profile` object like\n\n    {\n        \"property1\": { ... },\n        \"property2\": { ... },\n        ...\n    }\n\nand a `property` parameter like `property1,property2`, this endpoint will update the given properties, but leave the rest of the user profile intact.\nProperties present in `profile` but not listed in `property` will not be written. Conversely, properties listed in `property` but not present in `profile` will not be overwritten with `null`.","tags":["user"],"parameters":[{"$ref":"#/parameters/property"},{"name":"profile","description":"A user profile object. Only the properties matching the `property` parameter will actually be updated, so it is safe to pass a larger object if this is convenient (for example the original user profile with some but not all properties changed).","in":"body","schema":{"type":"object","example":{"property1":"customValue"}}}],"responses":{"200":{"description":"Success","schema":{"type":"string"}},"400":{"description":"Illegal argument","schema":{"$ref":"#/definitions/errors"}}}},"parameters":[]},"/user/v1/device/{token}":{"put":{"summary":"Register a new mobile device.","operationId":"devicePut","tags":["notification","user"],"consumes":["application/octet-stream"],"parameters":[{"name":"token","in":"path","type":"string","required":true,"x-example":"5a21a38a24857b344c66aadade0abf2a748fcacf2ddf466e83e4fcd1cefab66a"},{"name":"type","in":"query","type":"string","enum":["ios","ios-sandbox","android"],"required":true,"description":"The type of device:\n     * `ios` (for the production environment)\n     * `ios-sandbox` (for the APN sandbox)\n     * `android`","x-example":"ios"},{"name":"name","in":"query","type":"string","description":"The name of this mobile device.","x-example":"my iPhone"},{"name":"model","in":"query","type":"string","required":true,"description":"The model of this mobile device.","x-example":"iPhone 8"}],"responses":{"200":{"description":"Success","schema":{"type":"string"}},"400":{"description":"Illegal argument","schema":{"$ref":"#/definitions/errors"}}}},"delete":{"summary":"Unregister a mobile device.","operationId":"deviceDelete","tags":["notification","user"],"parameters":[{"name":"token","in":"path","type":"string","required":true,"x-example":"5a21a38a24857b344c66aadade0abf2a748fcacf2ddf466e83e4fcd1cefab66a"}],"responses":{"200":{"description":"Success","schema":{"type":"string"}},"400":{"description":"Illegal argument","schema":{"$ref":"#/definitions/errors"}}}},"parameters":[]},"/user/v1/organization":{"x-swagger-router-controller":"organization","get":{"summary":"Get information about the organization that the current user belongs to.\n","operationId":"organizationGet","tags":["user"],"responses":{"200":{"description":"Success","schema":{"$ref":"#/definitions/organization"}},"400":{"description":"Illegal argument","schema":{"$ref":"#/definitions/errors"}}}},"parameters":[]},"/user/v1/organization/user":{"get":{"summary":"List the users belonging to the same organization as the current user.\nRequires the user to have the `admin` access level, and the token to have the `admin` scope.\n","operationId":"organizationUserList","tags":["user"],"security":[{"OAuth2":["admin"]},{"NtbJwtBearer":[]},{"TTJwtBearer":["admin"]},{"ApiKey":[]}],"responses":{"200":{"description":"Success","schema":{"type":"array","items":{"$ref":"#/definitions/userBase"}}},"400":{"description":"Illegal argument","schema":{"$ref":"#/definitions/errors"}}}},"post":{"summary":"Create a new user for the same organization as the current user.\nRequires the user to have the `admin` access level, and the token to have the `admin` scope.\n","operationId":"organizationUserPost","tags":["user"],"security":[{"OAuth2":["admin"]},{"NtbJwtBearer":[]},{"TTJwtBearer":["admin"]},{"ApiKey":[]}],"parameters":[{"$ref":"#/parameters/userCreateInput"}],"responses":{"200":{"description":"Success","schema":{"$ref":"#/definitions/user"}},"400":{"description":"Illegal argument\nApart from validation errors, the `errorCode` field can also contain:\n\n  * `userName_in_use`\n  * `phoneNumber_direct_invalid`","schema":{"$ref":"#/definitions/errors"}}}},"parameters":[]},"/user/v1/organization/user/{id}":{"get":{"summary":"Get information about a user belonging to the same organization as the current user.\nRequires the user to have the `admin` access level, and the token to have the `admin` scope.\n","operationId":"organizationUserGet","parameters":[{"$ref":"#/parameters/userId"}],"tags":["user"],"security":[{"OAuth2":["admin"]},{"NtbJwtBearer":[]},{"TTJwtBearer":["admin"]},{"ApiKey":[]}],"responses":{"200":{"description":"Success","schema":{"$ref":"#/definitions/user"}},"404":{"description":"Not found"}}},"put":{"summary":"Update a user belonging to the same organization as the current user.\nRequires the user to have the `admin` access level, and the token to have the `admin` scope.\n","operationId":"organizationUserPut","tags":["user"],"security":[{"OAuth2":["admin"]},{"NtbJwtBearer":[]},{"TTJwtBearer":["admin"]},{"ApiKey":[]}],"parameters":[{"$ref":"#/parameters/userId"},{"$ref":"#/parameters/userUpdateInput"}],"responses":{"200":{"description":"Success","schema":{"$ref":"#/definitions/user"}},"400":{"description":"Illegal argument","schema":{"$ref":"#/definitions/errors"}},"404":{"description":"Not found"}}},"parameters":[]},"/user/v1/user":{"x-swagger-router-controller":"user","get":{"summary":"Get information about the current user.","operationId":"userGet","tags":["user"],"responses":{"200":{"description":"Success","schema":{"$ref":"#/definitions/user"}},"400":{"description":"Illegal argument","schema":{"$ref":"#/definitions/errors"}}}},"parameters":[]},"/collection/v1/collection":{"get":{"summary":"List all collections","operationId":"collectionList","description":"Returns a list of all collections belonging to the current user.","tags":["collection"],"responses":{"200":{"description":"Success","schema":{"type":"array","items":{"$ref":"#/definitions/collection"}}},"400":{"description":"Illegal argument","schema":{"$ref":"#/definitions/errors"}}}},"post":{"summary":"Create a new collection.","operationId":"collectionPost","description":"Creates an new named collection for the current user. This operation is asynchronous, and there may be a delay before the change is visible using the `GET /collection/v1/collection` endpoint.","tags":["collection"],"parameters":[{"$ref":"#/parameters/collection"}],"responses":{"200":{"description":"Success","schema":{"$ref":"#/definitions/collection"}},"400":{"description":"Illegal argument","schema":{"$ref":"#/definitions/errors"}}}},"parameters":[]},"/collection/v1/collection/{id}":{"get":{"summary":"Get collection properties and contents","operationId":"collectionGet","description":"Returns all properties and contents of a single collection.","tags":["collection"],"parameters":[{"$ref":"#/parameters/collectionId"}],"responses":{"200":{"description":"Success","schema":{"$ref":"#/definitions/collectionItem"}},"400":{"description":"Illegal argument","schema":{"$ref":"#/definitions/errors"}}}},"put":{"summary":"Update collection properties","operationId":"collectionPut","description":"Updates an existing collection belonging to the current user. This operation is asynchronous, and there may be a delay before the change is visible using the `GET /collection/v1/collection` endpoint.","tags":["collection"],"parameters":[{"$ref":"#/parameters/collectionId"},{"$ref":"#/parameters/collection"}],"responses":{"200":{"description":"Success","schema":{"$ref":"#/definitions/collection"}},"400":{"description":"Illegal argument","schema":{"$ref":"#/definitions/errors"}},"404":{"description":"Collection not found","schema":{"type":"string"}}}},"delete":{"summary":"Remove an existing collection","operationId":"collectionDelete","description":"Removes an existing collection belonging to the current user. This operation is asynchronous, and there may be a delay before the change is visible using the `GET /collection/v1/collection` endpoint.","tags":["collection"],"parameters":[{"$ref":"#/parameters/collectionId"}],"responses":{"200":{"description":"Success","schema":{"type":"string"}},"400":{"description":"Illegal argument","schema":{"$ref":"#/definitions/errors"}},"404":{"description":"Collection not found","schema":{"type":"string"}}}},"parameters":[]},"/collection/v1/collection/{id}/items":{"post":{"summary":"Add items to collection","operationId":"collectionItemsAdd","description":"Adds any number of items to a given collection belonging to the current user. The items must exist in the content database and be visible for the user. If not, this call will still return successfully, but the collection remain unchanged.\nThis operation is asynchronous, and there may be a delay before changes are visible using the `GET /collection/v1/collection/{id}` endpoint.","tags":["collection"],"parameters":[{"$ref":"#/parameters/collectionId"},{"$ref":"#/parameters/collectionItem"}],"responses":{"200":{"description":"Success","schema":{"type":"string"}},"400":{"description":"Illegal argument","schema":{"$ref":"#/definitions/errors"}}}},"delete":{"summary":"Remove items from collection","operationId":"collectionItemsRemove","description":"Removes any number of items from a given collection belonging to the current user. If one or more items do not currently belong to the collection, this call will still return successfully, but those items will be ignored.\nThis operation is asynchronous, and there may be a delay before changes are visible using the `GET /collection/v1/collection/{id}` endpoint.","tags":["collection"],"parameters":[{"$ref":"#/parameters/collectionId"},{"$ref":"#/parameters/collectionItem"}],"responses":{"200":{"description":"Success","schema":{"type":"string"}},"400":{"description":"Illegal argument","schema":{"$ref":"#/definitions/errors"}}}},"parameters":[]}},"x-express-openapi-additional-middleware":[null,null],"tags":[{"name":"collection"},{"name":"content"},{"name":"notification"},{"name":"user"}]}