{"openapi":"3.0.0","info":{"version":"1.0.0","title":"API"},"servers":[{"url":"https://api2.sesamy.com","description":"Current environment"}],"security":[{"OpenID":["openid","email","profile"]}],"components":{"securitySchemes":{"OpenID":{"type":"openIdConnect","openIdConnectUrl":"https://token.sesamy.com/.well-known/openid-configuration"},"Basic":{"type":"http","scheme":"basic"}},"schemas":{"Vendor":{"type":"object","properties":{"name":{"type":"string"},"id":{"type":"string"},"logo":{"type":"string"}},"required":["name","id"]},"Bill":{"type":"object","properties":{"id":{"type":"string","example":"1d78271264b9c76d5842911dd70b4353"},"items":{"type":"array","items":{"type":"object","properties":{"sku":{"type":"string"},"title":{"type":"string"},"purchaseOptionId":{"type":"string"}},"required":["sku","title"]}},"price":{"type":"number"},"currency":{"type":"string"},"receiptUrl":{"type":"string"},"paymentProvider":{"type":"string"},"paymentMethod":{"type":"string"},"status":{"type":"string"},"updatedAt":{"type":"string"},"createdAt":{"type":"string"}},"required":["id","items","price","receiptUrl","paymentProvider","paymentMethod","status","updatedAt","createdAt"]},"Contract":{"type":"object","properties":{"id":{"type":"string","example":"1d78271264b9c76d5842911dd70b4353"},"name":{"type":"string"},"userId":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"price":{"type":"number"},"nextBillAt":{"type":"string","nullable":true},"nextPrice":{"type":"number","nullable":true},"currency":{"type":"string"},"manageUrl":{"type":"string"},"contractDuration":{"type":"string","enum":["RECURRING","RENEWABLE","PERPETUAL"]},"issuesRemaining":{"type":"number"},"items":{"type":"array","items":{"type":"object","properties":{"sku":{"type":"string"},"purchaseOptionId":{"type":"string"},"purchaseOptionName":{"type":"string"},"name":{"type":"string"},"cover":{"type":"string"},"purchaseType":{"type":"string"}},"required":["sku","name"]}},"status":{"type":"string"},"isActive":{"type":"boolean"},"recurringInterval":{"type":"string","enum":["DAY","WEEK","MONTH","YEAR"]},"recurringTime":{"type":"number"},"willCancelAt":{"type":"string","nullable":true},"cancelRequestedAt":{"type":"string","nullable":true},"expiresAt":{"type":"string"},"paymentData":{"type":"object","properties":{"method":{"type":"string"},"description":{"type":"string"},"brand":{"type":"string"}}},"appliedDiscounts":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"id":{"type":"string"}},"required":["code","name","description","id"]}}},"required":["id","name","userId","createdAt","updatedAt","price","nextBillAt","nextPrice","currency","items","status","isActive","willCancelAt","cancelRequestedAt","appliedDiscounts"]},"Transaction":{"type":"object","properties":{"id":{"type":"string","example":"1d78271264b9c76d5842911dd70b4353"},"amount":{"type":"number"},"currency":{"type":"string"},"contractId":{"type":"string"},"isRefund":{"type":"boolean"},"userId":{"type":"string"},"billId":{"type":"string"},"updatedAt":{"type":"string"},"createdAt":{"type":"string"}},"required":["id","amount","contractId","isRefund","userId","billId","updatedAt","createdAt"]},"Product":{"type":"object","properties":{"cover":{"type":"string"},"language":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"sku":{"type":"string"},"title":{"type":"string"},"productType":{"type":"string"},"publisherContentId":{"type":"string"}},"required":["cover","language","createdAt","updatedAt","sku","title","productType"]},"Fulfillment":{"type":"object","properties":{"status":{"type":"string"},"updatedAt":{"type":"string"},"createdAt":{"type":"string"},"deliversAt":{"type":"string"},"sku":{"type":"string"},"title":{"type":"string"}},"required":["status","updatedAt","createdAt","sku","title"]},"Profile":{"type":"object","properties":{"userId":{"type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"},"email":{"type":"string"},"emailVerified":{"type":"boolean"},"locale":{"type":"string"},"nickname":{"type":"string"},"picture":{"type":"string"},"name":{"type":"string"},"mobilePhone":{"type":"string"},"workPhone":{"type":"string"},"homePhone":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}},"user_metadata":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"}]}},"billingAddress":{"type":"object","properties":{"country":{"type":"string","minLength":2,"maxLength":2},"zip":{"type":"string"},"city":{"type":"string"},"street":{"type":"string"},"co":{"type":"string"},"lastName":{"type":"string"},"firstName":{"type":"string"}}},"deliveryAddress":{"type":"object","properties":{"country":{"type":"string","minLength":2,"maxLength":2},"zip":{"type":"string"},"city":{"type":"string"},"street":{"type":"string"},"co":{"type":"string"},"lastName":{"type":"string"},"firstName":{"type":"string"}}},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"company":{"type":"string"},"sub":{"type":"string"},"given_name":{"type":"string"},"family_name":{"type":"string"},"phone_number":{"type":"string"}},"required":["userId","createdAt","updatedAt"]},"UserMetadata":{"anyOf":[{"type":"string"},{"type":"number"},{"nullable":true},{"nullable":true}]},"EntitlementType":{"type":"string","enum":["article","audiobook","ebook","bundle","podcast","pass","publication","physical_issue"]},"Entitlement":{"type":"object","properties":{"id":{"type":"string","example":"1d78271264b9c76d5842911dd70b4353"},"sku":{"type":"string"},"purchaseOption":{"type":"string"},"cover":{"type":"string"},"title":{"type":"string"},"url":{"type":"string"},"presentationUrl":{"type":"string"},"publisherContentId":{"type":"string"},"type":{"$ref":"#/components/schemas/EntitlementType"},"origin":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["EXTERNAL"]},"id":{"type":"string"},"listId":{"type":"string"},"name":{"type":"string"}},"required":["type","id"]},{"type":"object","properties":{"type":{"type":"string","enum":["PAYMENTS"]},"contractId":{"type":"string"}},"required":["type"]}]},"hasAccess":{"type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"token":{"type":"string"},"expiresAt":{"type":"string"}},"required":["id","sku","title","type","hasAccess","createdAt","updatedAt"]},"Paywall":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the paywall","example":"aM8o7LqpkGZJ-szyPwe_E"},"vendorId":{"type":"string","description":"Vendor identifier","example":"24victoria"},"currency":{"type":"string","description":"Currency code for pricing","example":"DKK"},"version":{"type":"number","description":"Paywall version number","example":2},"settings":{"type":"object","properties":{"template":{"type":"string","enum":["LOGIN","BOXES","ARTICLE"],"description":"Paywall template type - LOGIN for authentication-only, BOXES for subscription options","example":"BOXES"},"useDefaultLogo":{"type":"boolean","description":"Whether to use the default vendor logo","example":true},"useDefaultCurrency":{"type":"boolean","description":"Whether to use the default vendor currency","example":true},"useDefaultColor":{"type":"boolean","description":"Whether to use the default vendor color","example":true},"styling":{"type":"object","properties":{"dropShadow":{"type":"boolean","description":"Whether to show drop shadow on paywall elements","example":true},"backgroundColor":{"type":"string","description":"Background color in hex format","example":"#000000"},"showBackground":{"type":"boolean","description":"Whether to show the background","example":false}},"required":["dropShadow","backgroundColor","showBackground"]}},"required":["template","useDefaultLogo","useDefaultCurrency","useDefaultColor"]},"showLoginButton":{"type":"boolean","description":"Whether to show a login button. When true, indicates a subscription/entitlement paywall. When false with LOGIN template, indicates a login-only paywall.","example":true},"subscriptions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Subscription identifier","example":"R4gX0YSbSU1WJA7bCrbQw"},"sku":{"type":"string","description":"Product SKU","example":"sid:fGb4GbMUclADQtBxoX1rl"},"poId":{"type":"string","description":"Purchase option identifier","example":"VDuH_poxqIPKW638Ok43q"},"title":{"type":"string","description":"Subscription title","example":"Månedsabonnement"},"description":{"type":"string","description":"Subscription description (can contain HTML)","example":"<p>Kun 720 kr./år – spar 20%</p>"},"price":{"type":"number","description":"Regular price","example":99},"discountPrice":{"type":"number","description":"Discounted price if applicable","example":75},"discountCode":{"type":"string","description":"Applied discount code","example":""},"periodText":{"type":"string","description":"Period text (e.g., \"måned\", \"month\")","example":"måned"},"tag":{"type":"string","description":"Tag for categorization","example":""},"selected":{"type":"boolean","description":"Whether this subscription is pre-selected","example":true},"features":{"type":"array","items":{"type":"string"},"description":"List of features included in this subscription","example":["Daglige nyheder om tech, startups og scaleups","Eksklusive interviews med founders"]},"buttonText":{"type":"string","description":"Custom button text","example":"KØB ADGANG"},"readMoreText":{"type":"string","description":"Read more link text","example":"Læs mere"},"preferBusiness":{"type":"boolean","description":"Whether this option is preferred for business customers","example":false},"url":{"type":"string","description":"External URL for more information","example":"https://24victoria.dk/business"}},"required":["id","sku","poId","title","description","discountCode","periodText","tag","selected"]}},"features":{"type":"array","items":{"type":"string"},"description":"General features displayed on the paywall","example":["Danmarks nyhedsmedie om techvirksomeder. startups & scaleups"]},"mainColor":{"type":"string","description":"Main brand color in hex format","example":"#3377fe"},"headline":{"type":"string","description":"Paywall headline text","example":"Login for at læse artiklen"},"logoUrl":{"type":"string","description":"URL to the vendor logo","example":"https://assets.sesamy.com/vendor-assets/24victoria/ad29ee3a-4648-453e-92ad-a2d43c68cd39.svg"},"footerPaymentMethods":{"type":"array","items":{"type":"string"},"description":"Payment methods displayed in the footer","example":["visa","mastercard","google-pay","apple-pay"]},"singlePurchase":{"type":"object","properties":{"enabled":{"type":"boolean","description":"Whether single purchase is enabled","example":true},"title":{"type":"string","description":"Single purchase option title","example":"Buy Now"},"description":{"type":"string","description":"Single purchase option description","example":"One-time purchase"},"discountCode":{"type":"string","description":"Applied discount code for single purchase","example":""}},"required":["enabled","title","description","discountCode"]}},"required":["id","vendorId","currency","version","settings","showLoginButton","subscriptions","features","footerPaymentMethods"]},"AccessList":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the access list","example":"src_123abc"},"name":{"type":"string","description":"Name of the access list","example":"My Partner API"},"description":{"type":"string","description":"Description of the access list","example":"Purchases from partner system"},"type":{"type":"string","enum":["CSV_FILE_OLD","CSV_FILE","CSV_TRANSACTIONS","CLAIMED","MANUAL","HOOK","BASIC_API"],"description":"Type of access list","example":"MANUAL"},"status":{"type":"string","enum":["DRAFT","ACTIVE","CANCELED"],"description":"Status of the access list","example":"ACTIVE"},"excludeFromStats":{"type":"boolean","description":"Whether to exclude from statistics","example":false}},"required":["id","name","type","status"]},"CreateAccessList":{"type":"object","properties":{"name":{"type":"string","description":"Name of the access list","example":"My Partner API"},"description":{"type":"string","description":"Description of the access list","example":"Purchases from partner system"},"type":{"type":"string","enum":["CSV_FILE_OLD","CSV_FILE","CSV_TRANSACTIONS","CLAIMED","MANUAL","HOOK","BASIC_API"],"description":"Type of access list","example":"MANUAL"},"status":{"type":"string","enum":["DRAFT","ACTIVE","CANCELED"],"description":"Status of the access list","example":"ACTIVE"},"excludeFromStats":{"type":"boolean","description":"Whether to exclude from statistics","example":false}},"required":["name","type","status"]},"UpdateAccessList":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the access list","example":"src_123abc"},"name":{"type":"string","description":"Name of the access list","example":"My Partner API"},"description":{"type":"string","description":"Description of the access list","example":"Purchases from partner system"},"type":{"type":"string","enum":["CSV_FILE_OLD","CSV_FILE","CSV_TRANSACTIONS","CLAIMED","MANUAL","HOOK","BASIC_API"],"description":"Type of access list","example":"MANUAL"},"status":{"type":"string","enum":["DRAFT","ACTIVE","CANCELED"],"description":"Status of the access list","example":"ACTIVE"},"excludeFromStats":{"type":"boolean","description":"Whether to exclude from statistics","example":false}}},"GrantAddress":{"type":"object","properties":{"street":{"type":"string"},"city":{"type":"string"},"zip":{"type":"string"},"country":{"type":"string"},"co":{"type":"string"}}},"Grant":{"type":"object","properties":{"id":{"type":"string","description":"Unique identifier for the grant","example":"grant_123abc"},"source":{"type":"string","description":"Source/access list ID","example":"src_123abc"},"email":{"type":"string","format":"email","description":"Email address of the user","example":"user@example.com"},"userId":{"type":"string","description":"User ID","example":"pub_user_123"},"publisherUserId":{"type":"string","description":"Publisher user ID","example":"pub_user_123"},"sku":{"type":"string","description":"Product SKU","example":"premium-article-123"},"poId":{"type":"string","description":"Purchase option ID","example":"po_123abc"},"status":{"type":"string","enum":["ACTIVE","INACTIVE","CANCELED"],"description":"Status of the grant","example":"ACTIVE"},"startsAt":{"type":"string","format":"date-time","description":"Grant start date","example":"2024-01-01T00:00:00Z"},"endsAt":{"type":"string","format":"date-time","description":"Grant end date","example":"2024-12-31T23:59:59Z"},"firstName":{"type":"string","description":"First name","example":"John"},"lastName":{"type":"string","description":"Last name","example":"Doe"},"phone":{"type":"string","description":"Phone number","example":"+1234567890"},"deliveryAddress":{"$ref":"#/components/schemas/GrantAddress"},"billingAddress":{"$ref":"#/components/schemas/GrantAddress"},"publisherPurchaseId":{"type":"string","description":"Publisher purchase ID","example":"pub_purchase_123"},"notes":{"type":"string","description":"Notes about the grant","example":"Bulk purchase"},"extraFields":{"type":"object","additionalProperties":{"type":"string"},"description":"Additional custom fields","example":{"custom_field":"value"}},"excludeFromStats":{"type":"boolean","description":"Whether to exclude from statistics","example":false}},"required":["id","source","email","sku","poId","status"]},"CreateGrant":{"type":"object","properties":{"email":{"type":"string","format":"email","description":"Email address of the user","example":"user@example.com"},"userId":{"type":"string","description":"User ID","example":"pub_user_123"},"publisherUserId":{"type":"string","description":"Publisher user ID","example":"pub_user_123"},"sku":{"type":"string","minLength":1,"description":"Product SKU (required)","example":"premium-article-123"},"poId":{"type":"string","minLength":1,"description":"Purchase option ID (required)","example":"po_123abc"},"status":{"type":"string","enum":["ACTIVE","INACTIVE","CANCELED"],"description":"Status of the grant","example":"ACTIVE"},"startsAt":{"type":"string","format":"date-time","description":"Grant start date","example":"2024-01-01T00:00:00Z"},"endsAt":{"type":"string","format":"date-time","description":"Grant end date","example":"2024-12-31T23:59:59Z"},"firstName":{"type":"string","description":"First name","example":"John"},"lastName":{"type":"string","description":"Last name","example":"Doe"},"phone":{"type":"string","description":"Phone number","example":"+1234567890"},"deliveryAddress":{"$ref":"#/components/schemas/GrantAddress"},"billingAddress":{"$ref":"#/components/schemas/GrantAddress"},"publisherPurchaseId":{"type":"string","description":"Publisher purchase ID","example":"pub_purchase_123"},"notes":{"type":"string","description":"Notes about the grant","example":"Bulk purchase"},"extraFields":{"type":"object","additionalProperties":{"type":"string"},"description":"Additional custom fields","example":{"custom_field":"value"}},"excludeFromStats":{"type":"boolean","description":"Whether to exclude from statistics","example":false},"source":{"type":"string","description":"Source/access list ID","example":"src_123abc"}},"required":["email","sku","poId","status","source"]},"UpdateGrant":{"type":"object","properties":{"email":{"type":"string","format":"email","description":"Email address of the user","example":"user@example.com"},"userId":{"type":"string","description":"User ID","example":"pub_user_123"},"publisherUserId":{"type":"string","description":"Publisher user ID","example":"pub_user_123"},"sku":{"type":"string","description":"Product SKU","example":"premium-article-123"},"poId":{"type":"string","description":"Purchase option ID","example":"po_123abc"},"status":{"type":"string","enum":["ACTIVE","INACTIVE","CANCELED"],"description":"Status of the grant","example":"ACTIVE"},"startsAt":{"type":"string","format":"date-time","description":"Grant start date","example":"2024-01-01T00:00:00Z"},"endsAt":{"type":"string","format":"date-time","description":"Grant end date","example":"2024-12-31T23:59:59Z"},"firstName":{"type":"string","description":"First name","example":"John"},"lastName":{"type":"string","description":"Last name","example":"Doe"},"phone":{"type":"string","description":"Phone number","example":"+1234567890"},"deliveryAddress":{"$ref":"#/components/schemas/GrantAddress"},"billingAddress":{"$ref":"#/components/schemas/GrantAddress"},"publisherPurchaseId":{"type":"string","description":"Publisher purchase ID","example":"pub_purchase_123"},"notes":{"type":"string","description":"Notes about the grant","example":"Bulk purchase"},"extraFields":{"type":"object","additionalProperties":{"type":"string"},"description":"Additional custom fields","example":{"custom_field":"value"}},"excludeFromStats":{"type":"boolean","description":"Whether to exclude from statistics","example":false}}}},"parameters":{}},"paths":{"/management/vendors":{"get":{"tags":["Vendors"],"security":[{"OpenID":[]}],"responses":{"200":{"description":"A list of vendors","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Vendor"}}}}}}},"post":{"tags":["Vendors"],"security":[{"OpenID":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"id":{"type":"string"},"website":{"type":"string"},"country":{"type":"string","minLength":2,"maxLength":2}},"required":["name","id","website","country"]}}}},"responses":{"201":{"description":"Status"}}}},"/management/vendors/:vendorId/token-handler":{"get":{"tags":["Vendors"],"security":[{"OpenID":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"vendorId","in":"path"}],"responses":{"200":{"description":"Current token handler settings for the vendor","content":{"application/json":{"schema":{"type":"object","properties":{"clientId":{"type":"string"},"authHostname":{"type":"string"},"hasEncryptionSecret":{"type":"boolean"}},"required":["hasEncryptionSecret"]}}}},"404":{"description":"Vendor not found or settings unavailable"},"502":{"description":"Failed to fetch settings from upstream"}}},"put":{"tags":["Vendors"],"security":[{"OpenID":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"vendorId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"clientId":{"type":"string","description":"OAuth client ID for this vendor"},"authHostname":{"type":"string","description":"Hostname that maps to this vendor, e.g. auth.vendor.com or localhost:5173"}},"required":["clientId","authHostname"]}}}},"responses":{"200":{"description":"Updated token handler settings","content":{"application/json":{"schema":{"type":"object","properties":{"clientId":{"type":"string"},"authHostname":{"type":"string"}},"required":["clientId","authHostname"]}}}},"502":{"description":"Failed to fetch existing settings from upstream"}}}},"/management/bills":{"get":{"tags":["Bills"],"security":[{"OpenID":["bills:read"]}],"parameters":[{"schema":{"type":"string"},"required":false,"name":"q","in":"query"},{"schema":{"type":"string"},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"from","in":"query"},{"schema":{"type":"string","enum":["DRAFT","PENDING","PAID","RETRYING","OVERDUE","CANCELED","EXPIRED","DELETED","VOIDED"]},"required":false,"name":"status","in":"query"},{"schema":{"type":"string"},"required":false,"name":"contractId","in":"query"}],"responses":{"200":{"description":"Retrieve the users bills","headers":{"cache-control":{"schema":{"type":"string"},"required":false},"vary":{"schema":{"type":"string"},"required":false},"Last-Modified":{"schema":{"type":"string"},"required":false},"X-Request-Id":{"schema":{"type":"string"},"required":false}},"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Bill"}}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Unauthorized"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Forbidden"}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Not Found"}}}},"503":{"description":"Service Unavailable - Failed to connect to upstream service"}}}},"/management/bills/{id}":{"get":{"tags":["Bills"],"security":[{"OpenID":["bills:read"]}],"parameters":[{"schema":{"type":"string","example":"1d78271264b9c76d5842911dd70b4353"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Retrieve the users bills","headers":{"cache-control":{"schema":{"type":"string"},"required":false},"vary":{"schema":{"type":"string"},"required":false},"Last-Modified":{"schema":{"type":"string"},"required":false},"X-Request-Id":{"schema":{"type":"string"},"required":false}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Bill"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Unauthorized"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Forbidden"}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Not Found"}}}},"503":{"description":"Service Unavailable - Failed to connect to upstream service"}}}},"/management/contracts":{"get":{"tags":["Contracts"],"security":[{"OpenID":["contracts:read"]}],"parameters":[{"schema":{"type":"string"},"required":false,"name":"q","in":"query"},{"schema":{"type":"string"},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"from","in":"query"},{"schema":{"type":"string"},"required":false,"name":"userId","in":"query"}],"responses":{"200":{"description":"Retrieve the users contracts","headers":{"cache-control":{"schema":{"type":"string"},"required":false},"vary":{"schema":{"type":"string"},"required":false},"Last-Modified":{"schema":{"type":"string"},"required":false},"X-Request-Id":{"schema":{"type":"string"},"required":false}},"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Contract"}}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Unauthorized"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Forbidden"}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Not Found"}}}},"503":{"description":"Service Unavailable - Failed to connect to upstream service"}}}},"/management/contracts/{id}":{"get":{"tags":["Contracts"],"security":[{"OpenID":["contracts:read"]}],"parameters":[{"schema":{"type":"string","example":"1d78271264b9c76d5842911dd70b4353"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Retrieve the users contracts","headers":{"cache-control":{"schema":{"type":"string"},"required":false},"vary":{"schema":{"type":"string"},"required":false},"Last-Modified":{"schema":{"type":"string"},"required":false},"X-Request-Id":{"schema":{"type":"string"},"required":false}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Contract"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Unauthorized"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Forbidden"}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Not Found"}}}},"503":{"description":"Service Unavailable - Failed to connect to upstream service"}}}},"/management/contracts/{id}/licenses":{"get":{"tags":["Contracts"],"security":[{"OpenID":["contracts:read"]}],"parameters":[{"schema":{"type":"string","example":"1d78271264b9c76d5842911dd70b4353"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Retrieve users with license entitlements for the contract","headers":{"cache-control":{"schema":{"type":"string"},"required":false},"vary":{"schema":{"type":"string"},"required":false},"Last-Modified":{"schema":{"type":"string"},"required":false},"X-Request-Id":{"schema":{"type":"string"},"required":false}},"content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"userId":{"type":"string","description":"User ID","example":"auth0|123456"},"email":{"type":"string","description":"User email address","example":"user@example.com"},"fullName":{"type":"string","description":"User full name","example":"John Doe"},"sku":{"type":"string","description":"Product SKU","example":"premium-subscription"},"status":{"type":"string","description":"Entitlement status","example":"ACTIVE"},"entitlementId":{"type":"string","description":"Entitlement ID","example":"ent_123456"}},"required":["userId","sku","status","entitlementId"]}}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Unauthorized"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Forbidden"}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Not Found"}}}},"503":{"description":"Service Unavailable - Failed to connect to upstream service"}}}},"/management/transactions":{"get":{"tags":["Transactions"],"security":[{"OpenID":["transactions:read"]}],"parameters":[{"schema":{"type":"string"},"required":false,"name":"q","in":"query"},{"schema":{"type":"string"},"required":false,"name":"transactionId","in":"query"},{"schema":{"type":"string"},"required":false,"name":"billId","in":"query"},{"schema":{"type":"string"},"required":false,"name":"contractId","in":"query"},{"schema":{"type":"string"},"required":false,"name":"userId","in":"query"},{"schema":{"type":"string"},"required":false,"name":"dateFrom","in":"query"},{"schema":{"type":"string"},"required":false,"name":"dateTo","in":"query"},{"schema":{"type":"string"},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"from","in":"query"}],"responses":{"200":{"description":"A list of transactions","headers":{"cache-control":{"schema":{"type":"string"},"required":false},"vary":{"schema":{"type":"string"},"required":false},"Last-Modified":{"schema":{"type":"string"},"required":false},"X-Request-Id":{"schema":{"type":"string"},"required":false}},"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Transaction"}}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Unauthorized"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Forbidden"}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Not Found"}}}},"503":{"description":"Service Unavailable - Failed to connect to upstream service"}}}},"/management/products":{"get":{"tags":["Products"],"security":[{"OpenID":["products:read"]}],"parameters":[{"schema":{"type":"string"},"required":false,"name":"q","in":"query"}],"responses":{"200":{"description":"Retrieve a list of products","headers":{"cache-control":{"schema":{"type":"string"},"required":false},"vary":{"schema":{"type":"string"},"required":false},"Last-Modified":{"schema":{"type":"string"},"required":false},"X-Request-Id":{"schema":{"type":"string"},"required":false}},"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Product"}}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Unauthorized"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Forbidden"}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Not Found"}}}},"503":{"description":"Service Unavailable - Failed to connect to upstream service"}}},"post":{"tags":["Products"],"security":[{"OpenID":["products:write"]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string","enum":["podcast"]},"url":{"type":"string"},"spotifyId":{"type":"string"}},"required":["type","url"]}}}},"responses":{"200":{"description":"A created product","headers":{"cache-control":{"schema":{"type":"string"},"required":false},"vary":{"schema":{"type":"string"},"required":false},"Last-Modified":{"schema":{"type":"string"},"required":false},"X-Request-Id":{"schema":{"type":"string"},"required":false}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Product"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Unauthorized"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Forbidden"}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Not Found"}}}},"503":{"description":"Service Unavailable - Failed to connect to upstream service"}}}},"/management/products/{sku}":{"get":{"tags":["Products"],"security":[{"OpenID":["products:read"]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"sku","in":"path"}],"responses":{"200":{"description":"Retrieve a a product by SKU","headers":{"cache-control":{"schema":{"type":"string"},"required":false},"vary":{"schema":{"type":"string"},"required":false},"Last-Modified":{"schema":{"type":"string"},"required":false},"X-Request-Id":{"schema":{"type":"string"},"required":false}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Product"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Unauthorized"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Forbidden"}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Not Found"}}}},"503":{"description":"Service Unavailable - Failed to connect to upstream service"}}},"patch":{"tags":["Products"],"security":[{"OpenID":["products:write"]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"sku","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"externalIds":{"type":"object","properties":{"spotifyId":{"type":"string"}}},"language":{"type":"string","nullable":true}}}}}},"responses":{"200":{"description":"A created product","headers":{"cache-control":{"schema":{"type":"string"},"required":false},"vary":{"schema":{"type":"string"},"required":false},"Last-Modified":{"schema":{"type":"string"},"required":false},"X-Request-Id":{"schema":{"type":"string"},"required":false}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Unauthorized"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Forbidden"}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Not Found"}}}},"503":{"description":"Service Unavailable - Failed to connect to upstream service"}}}},"/management/products/{sku}/fulfillments":{"get":{"tags":["Products"],"security":[{"OpenID":["products:read"]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"sku","in":"path"}],"responses":{"200":{"description":"Retrieve a a product by SKU","headers":{"cache-control":{"schema":{"type":"string"},"required":false},"vary":{"schema":{"type":"string"},"required":false},"Last-Modified":{"schema":{"type":"string"},"required":false},"X-Request-Id":{"schema":{"type":"string"},"required":false}},"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Fulfillment"}}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Unauthorized"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Forbidden"}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Not Found"}}}},"503":{"description":"Service Unavailable - Failed to connect to upstream service"}}}},"/management/users":{"get":{"tags":["Users"],"summary":"List users","description":"Returns a list of users with optional filtering.","security":[{"OpenID":["users:read"]}],"parameters":[{"schema":{"type":"string","description":"Search query","example":"john"},"required":false,"name":"q","in":"query"},{"schema":{"type":"string","description":"Number of results to return","example":"10"},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","description":"Offset for pagination","example":"0"},"required":false,"name":"from","in":"query"}],"responses":{"200":{"description":"A list of users matching the query parameters","headers":{"cache-control":{"schema":{"type":"string"},"required":false},"vary":{"schema":{"type":"string"},"required":false},"Last-Modified":{"schema":{"type":"string"},"required":false},"X-Request-Id":{"schema":{"type":"string"},"required":false}},"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Profile"}},"example":[{"userId":"user123","email":"john.doe@example.com","picture":"https://example.com/profile.jpg","name":"John Doe","mobilePhone":"+1234567890","billingAddress":{"country":"SE","zip":"12345","city":"Stockholm","street":"Main Street 123","firstName":"John","lastName":"Doe"},"deliveryAddress":{"country":"SE","zip":"12345","city":"Stockholm","street":"Main Street 123","firstName":"John","lastName":"Doe"},"createdAt":"2023-01-01T12:00:00Z","updatedAt":"2023-03-15T09:30:00Z"}]}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Unauthorized"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Forbidden"}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Not Found"}}}},"503":{"description":"Service Unavailable - Failed to connect to upstream service"}}},"post":{"tags":["Users"],"summary":"Create a user","description":"Creates a new user with the specified email and optional name.","security":[{"OpenID":["users:write"]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","description":"Email address of the user","example":"new.user@example.com"},"firstName":{"type":"string","description":"First name of the user","example":"New"},"lastName":{"type":"string","description":"Last name of the user","example":"User"}},"required":["email"]},"example":{"email":"new.user@example.com","firstName":"New","lastName":"User"}}}},"responses":{"201":{"description":"User created successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]},"example":{"success":true}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Unauthorized"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Forbidden"}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Not Found"}}}},"503":{"description":"Service Unavailable - Failed to connect to upstream service"}}}},"/management/users/{user_id}":{"get":{"tags":["Users"],"summary":"Get a user by ID","description":"Retrieves a specific user's profile by their ID.","security":[{"OpenID":["users:read"]}],"parameters":[{"schema":{"type":"string","example":"user123"},"required":true,"description":"The unique identifier of the user","name":"user_id","in":"path"}],"responses":{"200":{"description":"The requested user profile","headers":{"cache-control":{"schema":{"type":"string"},"required":false},"vary":{"schema":{"type":"string"},"required":false},"Last-Modified":{"schema":{"type":"string"},"required":false},"X-Request-Id":{"schema":{"type":"string"},"required":false}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Profile"},"example":{"userId":"user123","email":"john.doe@example.com","picture":"https://example.com/profile.jpg","name":"John Doe","mobilePhone":"+1234567890","billingAddress":{"country":"SE","zip":"12345","city":"Stockholm","street":"Main Street 123","firstName":"John","lastName":"Doe"},"deliveryAddress":{"country":"SE","zip":"12345","city":"Stockholm","street":"Main Street 123","firstName":"John","lastName":"Doe"},"createdAt":"2023-01-01T12:00:00Z","updatedAt":"2023-03-15T09:30:00Z"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Unauthorized"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Forbidden"}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Not Found"}}}},"503":{"description":"Service Unavailable - Failed to connect to upstream service"}}},"patch":{"tags":["Users"],"summary":"Update a user","description":"Updates a specific user's profile with the provided data.","security":[{"OpenID":["users:write"]}],"parameters":[{"schema":{"type":"string","example":"user123"},"required":true,"description":"The unique identifier of the user","name":"user_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"firstName":{"type":"string","nullable":true,"description":"First name of the user","example":"John"},"lastName":{"type":"string","nullable":true,"description":"Last name of the user","example":"Doe"},"nickname":{"type":"string","nullable":true,"description":"Nickname of the user","example":"Johnny"},"mobilePhone":{"type":"string","nullable":true,"description":"Mobile phone number","example":"+1234567890"},"workPhone":{"type":"string","nullable":true,"description":"Work phone number","example":"+1234567891"},"homePhone":{"type":"string","nullable":true,"description":"Home phone number","example":"+1234567892"},"billingAddress":{"type":"object","nullable":true,"properties":{"country":{"type":"string","minLength":2,"maxLength":2},"zip":{"type":"string"},"city":{"type":"string"},"street":{"type":"string"},"co":{"type":"string"},"lastName":{"type":"string"},"firstName":{"type":"string"}},"description":"Billing address information"},"deliveryAddress":{"type":"object","nullable":true,"properties":{"country":{"type":"string","minLength":2,"maxLength":2},"zip":{"type":"string"},"city":{"type":"string"},"street":{"type":"string"},"co":{"type":"string"},"lastName":{"type":"string"},"firstName":{"type":"string"}},"description":"Delivery address information"},"user_metadata":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"nullable":true},{"nullable":true}]},"description":"User metadata key-value pairs. Set a value to null to delete that key."},"given_name":{"type":"string","description":"Deprecated: Use firstName instead","deprecated":true},"family_name":{"type":"string","description":"Deprecated: Use lastName instead","deprecated":true},"phone_number":{"type":"string","nullable":true,"description":"Deprecated: Use mobilePhone instead","deprecated":true}}},"example":{"firstName":"Jane","lastName":"Smith","nickname":"Janie","mobilePhone":"+9876543210","billingAddress":{"country":"NO","zip":"0150","city":"Oslo","street":"New Street 456"}}}}},"responses":{"200":{"description":"The updated user profile","headers":{"cache-control":{"schema":{"type":"string"},"required":false},"vary":{"schema":{"type":"string"},"required":false},"Last-Modified":{"schema":{"type":"string"},"required":false},"X-Request-Id":{"schema":{"type":"string"},"required":false}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Profile"},"example":{"userId":"user123","email":"john.doe@example.com","picture":"https://example.com/profile.jpg","name":"John Doe","mobilePhone":"+1234567890","billingAddress":{"country":"SE","zip":"12345","city":"Stockholm","street":"Main Street 123","firstName":"John","lastName":"Doe"},"deliveryAddress":{"country":"SE","zip":"12345","city":"Stockholm","street":"Main Street 123","firstName":"John","lastName":"Doe"},"createdAt":"2023-01-01T12:00:00Z","updatedAt":"2023-03-15T09:30:00Z"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Unauthorized"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Forbidden"}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Not Found"}}}},"503":{"description":"Service Unavailable - Failed to connect to upstream service"}}},"delete":{"tags":["Users"],"summary":"Delete a user","description":"Deletes a user from the auth server. This action is irreversible.","security":[{"OpenID":["users:write"]}],"parameters":[{"schema":{"type":"string","example":"user123"},"required":true,"description":"The unique identifier of the user","name":"user_id","in":"path"}],"responses":{"200":{"description":"User deleted successfully","headers":{"cache-control":{"schema":{"type":"string"},"required":false},"vary":{"schema":{"type":"string"},"required":false},"Last-Modified":{"schema":{"type":"string"},"required":false},"X-Request-Id":{"schema":{"type":"string"},"required":false}},"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]},"example":{"success":true}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Unauthorized"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Forbidden"}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Not Found"}}}},"409":{"description":"Conflict - User has active entitlements","headers":{"cache-control":{"schema":{"type":"string"},"required":false},"vary":{"schema":{"type":"string"},"required":false},"Last-Modified":{"schema":{"type":"string"},"required":false},"X-Request-Id":{"schema":{"type":"string"},"required":false}},"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Cannot delete user with active entitlements"}}}},"503":{"description":"Service Unavailable - Failed to connect to upstream service"}}}},"/management/users/{user_id}/change-login-identifier":{"post":{"tags":["Users"],"summary":"Change user login identifier","description":"Changes the email address that a user uses to log in.","security":[{"OpenID":["users:write"]}],"parameters":[{"schema":{"type":"string","example":"user123"},"required":true,"description":"The unique identifier of the user","name":"user_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","description":"The new email address to use for login","example":"new.email@example.com"}},"required":["email"]},"example":{"email":"new.email@example.com"}}}},"responses":{"200":{"description":"Login identifier changed successfully","headers":{"cache-control":{"schema":{"type":"string"},"required":false},"vary":{"schema":{"type":"string"},"required":false},"Last-Modified":{"schema":{"type":"string"},"required":false},"X-Request-Id":{"schema":{"type":"string"},"required":false}},"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]},"example":{"success":true}}}},"400":{"description":"Bad request - Email already in use or invalid format","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Email address is already in use"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Unauthorized"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Forbidden"}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Not Found"}}}},"503":{"description":"Service Unavailable - Failed to connect to upstream service"}}}},"/management/users/{user_id}/user_metadata/{key}":{"put":{"tags":["Users"],"summary":"Set user metadata value","description":"Sets a metadata value for a specific user with the specified key.","security":[{"OpenID":["users:write"]}],"parameters":[{"schema":{"type":"string","example":"user123"},"required":true,"description":"The unique identifier of the user","name":"user_id","in":"path"},{"schema":{"type":"string","example":"preferences"},"required":true,"description":"The key of the metadata entry","name":"key","in":"path"}],"requestBody":{"content":{"text/plain":{"schema":{"$ref":"#/components/schemas/UserMetadata"},"example":"premium-user"}}},"responses":{"200":{"description":"Metadata value set successfully","headers":{"cache-control":{"schema":{"type":"string"},"required":false},"vary":{"schema":{"type":"string"},"required":false},"Last-Modified":{"schema":{"type":"string"},"required":false},"X-Request-Id":{"schema":{"type":"string"},"required":false}},"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]},"example":{"success":true}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Unauthorized"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Forbidden"}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Not Found"}}}},"503":{"description":"Service Unavailable - Failed to connect to upstream service"}}},"delete":{"tags":["Users"],"summary":"Delete user metadata value","description":"Deletes a metadata value for a specific user with the specified key.","security":[{"OpenID":["users:write"]}],"parameters":[{"schema":{"type":"string","example":"user123"},"required":true,"description":"The unique identifier of the user","name":"user_id","in":"path"},{"schema":{"type":"string","example":"preferences"},"required":true,"description":"The key of the metadata entry","name":"key","in":"path"}],"responses":{"200":{"description":"Metadata value deleted successfully","headers":{"cache-control":{"schema":{"type":"string"},"required":false},"vary":{"schema":{"type":"string"},"required":false},"Last-Modified":{"schema":{"type":"string"},"required":false},"X-Request-Id":{"schema":{"type":"string"},"required":false}},"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]},"example":{"success":true}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Unauthorized"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Forbidden"}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Not Found"}}}},"503":{"description":"Service Unavailable - Failed to connect to upstream service"}}}},"/management/users/{user_id}/set-password":{"post":{"tags":["Users"],"summary":"Set user password","description":"Sets or updates the password for a user. Creates a password authentication method if one does not exist.","security":[{"OpenID":["users:write"]}],"parameters":[{"schema":{"type":"string","example":"user123"},"required":true,"description":"The unique identifier of the user","name":"user_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"password":{"type":"string","minLength":6,"description":"The new password for the user","example":"SecurePassword123!"}},"required":["password"]},"example":{"password":"SecurePassword123!"}}}},"responses":{"200":{"description":"Password set successfully","headers":{"cache-control":{"schema":{"type":"string"},"required":false},"vary":{"schema":{"type":"string"},"required":false},"Last-Modified":{"schema":{"type":"string"},"required":false},"X-Request-Id":{"schema":{"type":"string"},"required":false}},"content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}},"required":["success"]},"example":{"success":true}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Unauthorized"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Forbidden"}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Not Found"}}}},"503":{"description":"Service Unavailable - Failed to connect to upstream service"}}}},"/management/mc/customers/{customerId}":{"get":{"tags":["Compatibility"],"summary":"Get customer information","description":"Returns customer information in XML format for Mediaconnect compatibility.","security":[{"OpenID":["users:read","user:read"],"Basic":["users:read","user:read"]}],"parameters":[{"schema":{"type":"string","example":"958280"},"required":true,"description":"The unique identifier of the customer","name":"customerId","in":"path"}],"responses":{"200":{"description":"Customer information in XML format","headers":{"cache-control":{"schema":{"type":"string"},"required":false},"vary":{"schema":{"type":"string"},"required":false},"Last-Modified":{"schema":{"type":"string"},"required":false},"X-Request-Id":{"schema":{"type":"string"},"required":false}},"content":{"application/xml":{"schema":{"type":"string","description":"Customer information in XML format","example":"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<customer>\n  <customerNumber>958280</customerNumber>\n  <firstName>TEST</firstName>\n  <middleName>TEST</middleName>\n  <lastName>TEST</lastName>\n  <street>GRUBBEGATA</street>\n  <streetNumber>4</streetNumber>\n  <postalCode>0871</postalCode>\n  <postalPlace>OSLO</postalPlace>\n  <postalAddressPostalCode>0871</postalAddressPostalCode>\n  <postalAddressPostalPlace>OSLO</postalAddressPostalPlace>\n  <countryCode>NO</countryCode>\n  <phoneNumbers>\n    <phoneNumber type=\"private\">+4794326445</phoneNumber>\n  </phoneNumbers>\n  <recurringProducts>\n    <recurringProduct>\n      <productCode>KONDIS</productCode>\n      <status>passive</status>\n    </recurringProduct>\n  </recurringProducts>\n</customer>"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Unauthorized"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Forbidden"}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Not Found"}}}},"503":{"description":"Service Unavailable - Failed to connect to upstream service"}}}},"/management/entitlements":{"get":{"tags":["Entitlements"],"security":[{"OpenID":["entitlements:read"]}],"parameters":[{"schema":{"type":"string","description":"Search query for entitlements","example":"premium article"},"required":false,"name":"q","in":"query"},{"schema":{"type":"string","description":"Maximum number of results to return","example":"20"},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","description":"Pagination cursor for fetching next page","example":"cursor123"},"required":false,"name":"from","in":"query"},{"schema":{"type":"string","description":"Filter entitlements by user ID","example":"user123"},"required":true,"name":"userId","in":"query"},{"schema":{"allOf":[{"$ref":"#/components/schemas/EntitlementType"},{"description":"Filter by entitlement type","example":"article"}]},"required":false,"name":"type","in":"query"},{"schema":{"type":"string","description":"Filter by product SKU","example":"premium-article-123"},"required":false,"name":"sku","in":"query"}],"responses":{"200":{"description":"List of entitlements","headers":{"cache-control":{"schema":{"type":"string"},"required":false},"vary":{"schema":{"type":"string"},"required":false},"Last-Modified":{"schema":{"type":"string"},"required":false},"X-Request-Id":{"schema":{"type":"string"},"required":false}},"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Entitlement"}}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Unauthorized"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Forbidden"}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Not Found"}}}},"503":{"description":"Service Unavailable - Failed to connect to upstream service"}}}},"/management/paywalls/{paywallId}":{"get":{"tags":["Paywalls"],"summary":"Get paywall by ID","description":"Retrieves the paywall configuration and settings for the specified paywall ID.","security":[{"OpenID":[]}],"headers":{"_def":{"unknownKeys":"strip","catchall":{"_def":{"typeName":"ZodNever"},"~standard":{"version":1,"vendor":"zod"}},"typeName":"ZodObject"},"~standard":{"version":1,"vendor":"zod"},"_cached":null},"parameters":[{"schema":{"type":"string","description":"Unique identifier of the paywall","example":"pw123456"},"required":true,"name":"paywallId","in":"path"}],"responses":{"200":{"description":"The paywall information and configuration","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Paywall"},"example":{"currency":"USD","settings":{"useDefaultLogo":true,"useDefaultCurrency":true,"useDefaultColor":true},"subscriptions":[{"discountCode":"","price":9.99,"periodText":"Monthly","description":"Monthly access","tag":"","id":"sub123","sku":"premium-monthly","title":"Premium Monthly","poId":"po123","selected":true}],"showLoginButton":true,"vendorId":"vendor123","features":["Feature 1","Feature 2"],"mainColor":"#FF0000","headline":"Premium Content Access","singlePurchase":{"description":"One-time purchase","title":"Buy Now","discountCode":"","enabled":true},"footerPaymentMethods":["visa","mastercard"],"version":1,"logoUrl":"https://example.com/logo.png"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Unauthorized"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Forbidden"}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Not Found"}}}},"503":{"description":"Service Unavailable - Failed to connect to upstream service"}}}},"/management/access-lists":{"get":{"tags":["Access-Lists"],"security":[{"OpenID":["access-lists:read"]}],"responses":{"200":{"description":"Retrieve a list of access lists","headers":{"cache-control":{"schema":{"type":"string"},"required":false},"vary":{"schema":{"type":"string"},"required":false},"Last-Modified":{"schema":{"type":"string"},"required":false},"X-Request-Id":{"schema":{"type":"string"},"required":false}},"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AccessList"}}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Unauthorized"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Forbidden"}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Not Found"}}}},"503":{"description":"Service Unavailable - Failed to connect to upstream service"}}},"post":{"tags":["Access-Lists"],"security":[{"OpenID":["access-lists:write"]}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAccessList"}}}},"responses":{"201":{"description":"Access list created successfully","headers":{"cache-control":{"schema":{"type":"string"},"required":false},"vary":{"schema":{"type":"string"},"required":false},"Last-Modified":{"schema":{"type":"string"},"required":false},"X-Request-Id":{"schema":{"type":"string"},"required":false}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccessList"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Unauthorized"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Forbidden"}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Not Found"}}}},"503":{"description":"Service Unavailable - Failed to connect to upstream service"}}}},"/management/access-lists/{id}":{"get":{"tags":["Access-Lists"],"security":[{"OpenID":["access-lists:read"]}],"parameters":[{"schema":{"type":"string","description":"Access list ID","example":"src_123abc"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Retrieve an access list by ID","headers":{"cache-control":{"schema":{"type":"string"},"required":false},"vary":{"schema":{"type":"string"},"required":false},"Last-Modified":{"schema":{"type":"string"},"required":false},"X-Request-Id":{"schema":{"type":"string"},"required":false}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccessList"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Unauthorized"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Forbidden"}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Not Found"}}}},"503":{"description":"Service Unavailable - Failed to connect to upstream service"}}},"put":{"tags":["Access-Lists"],"security":[{"OpenID":["access-lists:write"]}],"parameters":[{"schema":{"type":"string","description":"Access list ID","example":"src_123abc"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateAccessList"}}}},"responses":{"200":{"description":"Access list updated successfully","headers":{"cache-control":{"schema":{"type":"string"},"required":false},"vary":{"schema":{"type":"string"},"required":false},"Last-Modified":{"schema":{"type":"string"},"required":false},"X-Request-Id":{"schema":{"type":"string"},"required":false}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccessList"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Unauthorized"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Forbidden"}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Not Found"}}}},"503":{"description":"Service Unavailable - Failed to connect to upstream service"}}},"patch":{"tags":["Access-Lists"],"security":[{"OpenID":["access-lists:write"]}],"parameters":[{"schema":{"type":"string","description":"Access list ID","example":"src_123abc"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateAccessList"}}}},"responses":{"200":{"description":"Access list patched successfully","headers":{"cache-control":{"schema":{"type":"string"},"required":false},"vary":{"schema":{"type":"string"},"required":false},"Last-Modified":{"schema":{"type":"string"},"required":false},"X-Request-Id":{"schema":{"type":"string"},"required":false}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccessList"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Unauthorized"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Forbidden"}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Not Found"}}}},"503":{"description":"Service Unavailable - Failed to connect to upstream service"}}}},"/management/access-lists/{id}/grants":{"get":{"tags":["Grants"],"security":[{"OpenID":["access-lists:read"]}],"parameters":[{"schema":{"type":"string","description":"Access list ID","example":"src_123abc"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Retrieve a list of grants for an access list","headers":{"cache-control":{"schema":{"type":"string"},"required":false},"vary":{"schema":{"type":"string"},"required":false},"Last-Modified":{"schema":{"type":"string"},"required":false},"X-Request-Id":{"schema":{"type":"string"},"required":false}},"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Grant"}}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Unauthorized"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Forbidden"}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Not Found"}}}},"503":{"description":"Service Unavailable - Failed to connect to upstream service"}}},"post":{"tags":["Grants"],"security":[{"OpenID":["access-lists:write"]}],"parameters":[{"schema":{"type":"string","description":"Access list ID","example":"src_123abc"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateGrant"}}}},"responses":{"201":{"description":"Grant created successfully","headers":{"cache-control":{"schema":{"type":"string"},"required":false},"vary":{"schema":{"type":"string"},"required":false},"Last-Modified":{"schema":{"type":"string"},"required":false},"X-Request-Id":{"schema":{"type":"string"},"required":false}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Grant"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Unauthorized"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Forbidden"}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Not Found"}}}},"503":{"description":"Service Unavailable - Failed to connect to upstream service"}}}},"/management/access-lists/{id}/grants/{grantId}":{"get":{"tags":["Grants"],"security":[{"OpenID":["access-lists:read"]}],"parameters":[{"schema":{"type":"string","description":"Access list ID","example":"src_123abc"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","description":"Grant (purchase) ID","example":"purchase_123abc"},"required":true,"name":"grantId","in":"path"}],"responses":{"200":{"description":"Retrieve a grant by ID","headers":{"cache-control":{"schema":{"type":"string"},"required":false},"vary":{"schema":{"type":"string"},"required":false},"Last-Modified":{"schema":{"type":"string"},"required":false},"X-Request-Id":{"schema":{"type":"string"},"required":false}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Grant"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Unauthorized"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Forbidden"}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Not Found"}}}},"503":{"description":"Service Unavailable - Failed to connect to upstream service"}}},"put":{"tags":["Grants"],"security":[{"OpenID":["access-lists:write"]}],"parameters":[{"schema":{"type":"string","description":"Access list ID","example":"src_123abc"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","description":"Grant (purchase) ID","example":"purchase_123abc"},"required":true,"name":"grantId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateGrant"}}}},"responses":{"200":{"description":"Grant updated successfully","headers":{"cache-control":{"schema":{"type":"string"},"required":false},"vary":{"schema":{"type":"string"},"required":false},"Last-Modified":{"schema":{"type":"string"},"required":false},"X-Request-Id":{"schema":{"type":"string"},"required":false}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Grant"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Unauthorized"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Forbidden"}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Not Found"}}}},"503":{"description":"Service Unavailable - Failed to connect to upstream service"}}},"delete":{"tags":["Grants"],"security":[{"OpenID":["access-lists:write"]}],"parameters":[{"schema":{"type":"string","description":"Access list ID","example":"src_123abc"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","description":"Grant (purchase) ID","example":"purchase_123abc"},"required":true,"name":"grantId","in":"path"}],"responses":{"204":{"description":"Grant deleted successfully"},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Unauthorized"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Forbidden"}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Not Found"}}}},"503":{"description":"Service Unavailable - Failed to connect to upstream service"}}}},"/management/diagnostics/:identifier":{"get":{"tags":["diagnostics"],"summary":"Get user diagnostics","description":"Retrieve diagnostics entries for a user by their user ID or fallback ID. Returns the most recent entries.","security":[{"OpenID":[]}],"parameters":[{"schema":{"type":"string","description":"The user ID or fallback ID to fetch diagnostics for","example":"user_123"},"required":true,"name":"identifier","in":"path"},{"schema":{"type":"string","description":"Maximum number of entries to return (default: 10)","example":"10"},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"List of diagnostics entries","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"userId":{"type":"string","description":"The authenticated user ID (sub)"},"fallbackId":{"type":"string","description":"A fallback identifier for unauthenticated users"},"timestamp":{"type":"string","description":"ISO 8601 timestamp when diagnostics were collected"},"pageUrl":{"type":"string","description":"The page URL where diagnostics were collected"},"pageTitle":{"type":"string","description":"The page title where diagnostics were collected"},"profile":{"type":"object","additionalProperties":{"nullable":true},"description":"User profile data"},"entitlements":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"description":"User entitlements"},"contracts":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"description":"User contracts"},"tags":{"type":"array","items":{"type":"string"},"description":"User tags"},"tallies":{"type":"object","additionalProperties":{"nullable":true},"description":"User tallies"},"browser":{"type":"object","properties":{"userAgent":{"type":"string"},"platform":{"type":"string"},"language":{"type":"string"},"languages":{"type":"array","items":{"type":"string"}},"cookiesEnabled":{"type":"boolean"},"onLine":{"type":"boolean"},"hardwareConcurrency":{"type":"number"},"deviceMemory":{"type":"number"},"maxTouchPoints":{"type":"number"},"vendor":{"type":"string"},"viewportWidth":{"type":"number"},"viewportHeight":{"type":"number"},"screenWidth":{"type":"number"},"screenHeight":{"type":"number"},"pixelRatio":{"type":"number"},"colorDepth":{"type":"number"},"timezone":{"type":"string"},"timezoneOffset":{"type":"number"}},"description":"Browser and device information"},"detection":{"type":"object","properties":{"adBlockEnabled":{"type":"boolean"},"incognitoMode":{"type":"boolean"},"inAppBrowser":{"type":"boolean"}},"description":"Detection results (adblock, incognito, etc.)"},"localStorage":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"value":{"type":"string"},"redacted":{"type":"boolean"}},"required":["key","value"]},"description":"Sesamy-related localStorage entries"},"sessionStorage":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"value":{"type":"string"},"redacted":{"type":"boolean"}},"required":["key","value"]},"description":"Sesamy-related sessionStorage entries"},"sdkVersion":{"type":"string","description":"Sesamy-js SDK version"},"clientId":{"type":"string","description":"The client ID / vendor ID"},"errors":{"type":"array","items":{"type":"string"},"description":"Errors encountered during diagnostics collection"},"storedAt":{"type":"string","description":"ISO 8601 timestamp when diagnostics were stored"},"requestId":{"type":"string","description":"Request ID for tracking"}},"required":["timestamp","storedAt"]}},"count":{"type":"number"}},"required":["items","count"]}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Unauthorized"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Forbidden"}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Not Found"}}}},"503":{"description":"Service Unavailable - Failed to connect to upstream service"}}},"delete":{"tags":["diagnostics"],"summary":"Delete user diagnostics","description":"Delete all diagnostics entries for a user by their user ID or fallback ID.","security":[{"OpenID":[]}],"parameters":[{"schema":{"type":"string","description":"The user ID or fallback ID to delete diagnostics for","example":"user_123"},"required":true,"name":"identifier","in":"path"}],"responses":{"200":{"description":"Diagnostics deleted successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"deletedCount":{"type":"number"}},"required":["success","deletedCount"]}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Unauthorized"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Forbidden"}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Not Found"}}}},"503":{"description":"Service Unavailable - Failed to connect to upstream service"}}}},"/management/create-signed-link":{"post":{"tags":["Links"],"summary":"Create a signed link for content access","description":"Creates a signed token that grants access to encrypted content. Optionally appends it to a URL. Use for share links, email campaigns, gift access, or temporary tier access.","security":[{"OpenID":["links:create"]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","description":"The URL to sign. If provided, token will be appended as query parameter.","example":"https://example.com/article/123"},"sku":{"type":"string","description":"The product SKU that grants access to this content","example":"premium-subscription"},"purchaseOption":{"type":"string","description":"Optional purchase option variant","example":"monthly"},"publisherContentId":{"type":"string","description":"Publisher's content identifier","example":"article-2024-01-15-news"},"userId":{"type":"string","description":"User/purchaser ID for attribution","example":"user-456"},"maxUses":{"type":"number","description":"Maximum number of uses (undefined = unlimited)","example":1000},"expiresIn":{"anyOf":[{"type":"string"},{"type":"number"}],"description":"Token validity duration (e.g., \"1h\", \"24h\", \"7d\", \"30d\" or seconds)","example":"7d"},"meta":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},"description":"Optional custom metadata","example":{"campaign":"twitter","source":"share-button"}}},"required":["expiresIn"]}}}},"responses":{"200":{"description":"The signed link/token","headers":{"cache-control":{"schema":{"type":"string"},"required":false},"vary":{"schema":{"type":"string"},"required":false},"Last-Modified":{"schema":{"type":"string"},"required":false},"X-Request-Id":{"schema":{"type":"string"},"required":false}},"content":{"application/json":{"schema":{"type":"object","properties":{"signedUrl":{"type":"string","description":"The URL with token appended (only if url was provided in request)"},"token":{"type":"string","description":"The signed token"},"tokenId":{"type":"string","description":"Unique token ID for tracking/revocation"},"expiresAt":{"type":"string","description":"Token expiration time (ISO 8601)"},"sku":{"type":"string","description":"The SKU this token grants access for (if specified)"},"publisherContentId":{"type":"string","description":"The content ID this token unlocks (if specific content)"}},"required":["token","tokenId","expiresAt"]},"example":{"signedUrl":"https://example.com/article/123?sesamy_token=eyJhbGciOiJFZERTQSJ9...","token":"eyJhbGciOiJFZERTQSJ9...","tokenId":"tok_abc123","expiresAt":"2026-02-20T12:00:00.000Z","sku":"premium-subscription","publisherContentId":"article-2024-01-15-news"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Unauthorized"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Forbidden"}}}},"404":{"description":"Not Found - The requested resource does not exist","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]},"example":{"message":"Not Found"}}}},"503":{"description":"Service Unavailable - Failed to connect to upstream service"}}}}}}