openapi: 3.1.0
info:
  title: ows-preference-center
  description: Preference Center
  version: 1.0.0
servers:
- url: https://qa-ows-preference-center.theorchard.io
paths:
  /settings:
    get:
      tags:
      - settings
      summary: Get Settings
      description: Get settings
      operationId: getSettings
      parameters:
      - name: X-IPCountry
        in: header
        required: true
        schema:
          type: string
          title: X-Ipcountry
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Settings'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /profile/{token}:
    get:
      tags:
      - profile
      summary: Get Profile
      description: Get a profile
      operationId: getProfile
      parameters:
      - name: token
        in: path
        required: true
        schema:
          type: string
          description: Profile token
          title: Token
        description: Profile token
      - name: X-IPCountry
        in: header
        required: true
        schema:
          type: string
          title: X-Ipcountry
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Profile'
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProfileNotFoundError'
          description: Not Found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    patch:
      tags:
      - profile
      summary: Update Profile
      description: Update a profile
      operationId: updateProfile
      parameters:
      - name: token
        in: path
        required: true
        schema:
          type: string
          description: Profile token
          title: Token
        description: Profile token
      - name: X-IPCountry
        in: header
        required: true
        schema:
          type: string
          title: X-Ipcountry
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateProfileInput'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Profile'
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProfileNotFoundError'
          description: Not Found
        '400':
          content:
            application/json:
              schema:
                anyOf:
                - $ref: '#/components/schemas/ProfileBirthdayUpdateNotAllowedError'
                - $ref: '#/components/schemas/ProfileDateOfBirthUpdateNotAllowedError'
                title: Response 400 Updateprofile
          description: Bad Request
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    delete:
      tags:
      - profile
      summary: Delete Profile
      description: Delete a profile
      operationId: deleteProfile
      parameters:
      - name: token
        in: path
        required: true
        schema:
          type: string
          description: Profile token
          title: Token
        description: Profile token
      responses:
        '204':
          description: Successful Response
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProfileNotFoundError'
          description: Not Found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /profile/{token}/subscriptions:
    get:
      tags:
      - subscriptions
      summary: Get Subscriptions
      description: Get a profile subscriptions
      operationId: getSubscriptions
      parameters:
      - name: token
        in: path
        required: true
        schema:
          type: string
          description: Profile token
          title: Token
        description: Profile token
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Subscription'
                title: Response Getsubscriptions
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProfileNotFoundError'
          description: Not Found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    put:
      tags:
      - subscriptions
      summary: Update Subscriptions
      description: Update a profile subscriptions
      operationId: updateSubscriptions
      parameters:
      - name: token
        in: path
        required: true
        schema:
          type: string
          description: Profile token
          title: Token
        description: Profile token
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateSubscriptionsInput'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Subscription'
                title: Response Updatesubscriptions
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProfileNotFoundError'
          description: Not Found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    delete:
      tags:
      - subscriptions
      summary: Unsubscribe All
      description: Unsubscribe all subscriptions
      operationId: unsubscribeAll
      parameters:
      - name: token
        in: path
        required: true
        schema:
          type: string
          description: Profile token
          title: Token
        description: Profile token
      responses:
        '204':
          description: Successful Response
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProfileNotFoundError'
          description: Not Found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /subscriptions/unsubscribe-all:
    post:
      tags:
      - subscriptions
      summary: Unsubscribe All By Email
      description: Unsubscribe all subscriptions by email
      operationId: unsubscribeAllByEmail
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UnsubscribeAllByEmailInput'
        required: true
      responses:
        '204':
          description: Successful Response
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProfileNotFoundError'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /songwhip/encrypt-fan-consent-id:
    post:
      tags:
      - songwhip
      summary: Encrypt Songwhip Fan Consent Id
      operationId: encrypt_songwhip_fan_consent_id_songwhip_encrypt_fan_consent_id_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EncryptSongwhipFanConsentIdInput'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EncryptSongwhipFanConsentIdOutput'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /songwhip/fan-double-opt-in-consent-confirm:
    post:
      tags:
      - songwhip
      summary: Songwhip Fan Double Opt In Consent Confirm
      operationId: songwhip_fan_double_opt_in_consent_confirm_songwhip_fan_double_opt_in_consent_confirm_post
      parameters:
      - name: fanConsentId
        in: query
        required: true
        schema:
          type: string
          title: Fanconsentid
      - name: country
        in: query
        required: true
        schema:
          type: string
          title: Country
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SongwhipFanDoubleOptInConsentIdCheckError'
          description: Bad Request
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    EncryptSongwhipFanConsentIdInput:
      properties:
        fanConsentId:
          type: string
          format: binary
          title: Fanconsentid
      type: object
      required:
      - fanConsentId
      title: EncryptSongwhipFanConsentIdInput
    EncryptSongwhipFanConsentIdOutput:
      properties:
        encrypted:
          type: string
          title: Encrypted
      type: object
      required:
      - encrypted
      title: EncryptSongwhipFanConsentIdOutput
    Gender:
      type: string
      enum:
      - MALE
      - FEMALE
      - PREFER_NOT_TO_ANSWER
      - NON_BINARY_OTHER
      title: Gender
    HTTPValidationError:
      title: HTTPValidationError
      type: object
      properties:
        message:
          title: Message
          type: string
        code:
          title: Error code
          type: string
        fieldErrors:
          title: Field errors
          type: object
          additionalProperties:
            $ref: '#/components/schemas/FieldError'
      required:
      - message
      - code
      - fields
      example:
        message: Invalid input
        code: invalid_input
        fieldErrors:
          name:
            message: Cannot be blank
            code: missing
          email:
            message: Not valid email
            code: invalid_email
    LegalEntity:
      properties:
        name:
          type: string
          title: Name
        address:
          type: string
          title: Address
      type: object
      required:
      - name
      - address
      title: LegalEntity
    PrivacyLink:
      properties:
        name:
          type: string
          title: Name
        url:
          type: string
          title: Url
      type: object
      required:
      - name
      - url
      title: PrivacyLink
    Profile:
      properties:
        email:
          type: string
          title: Email
        phoneNumber:
          anyOf:
          - type: string
          - type: 'null'
          title: Phonenumber
        firstName:
          anyOf:
          - type: string
          - type: 'null'
          title: Firstname
        lastName:
          anyOf:
          - type: string
          - type: 'null'
          title: Lastname
        dateOfBirth:
          anyOf:
          - type: string
            format: date
          - type: 'null'
          title: Dateofbirth
        birthday:
          anyOf:
          - type: string
          - type: 'null'
          title: Birthday
        gender:
          anyOf:
          - $ref: '#/components/schemas/Gender'
          - type: 'null'
        countryCode:
          anyOf:
          - type: string
          - type: 'null'
          title: Countrycode
        city:
          anyOf:
          - type: string
          - type: 'null'
          title: City
        address:
          anyOf:
          - type: string
          - type: 'null'
          title: Address
        zipCode:
          anyOf:
          - type: string
          - type: 'null'
          title: Zipcode
      type: object
      required:
      - email
      - phoneNumber
      - firstName
      - lastName
      - dateOfBirth
      - birthday
      - gender
      - countryCode
      - city
      - address
      - zipCode
      title: Profile
    ProfileBirthdayUpdateNotAllowedError:
      properties:
        code:
          type: string
          const: profile_birthday_update_not_allowed
          title: Code
        message:
          type: string
          title: Message
      type: object
      required:
      - code
      - message
      title: ProfileBirthdayUpdateNotAllowedError
    ProfileDateOfBirthUpdateNotAllowedError:
      properties:
        code:
          type: string
          const: profile_date_of_birth_update_not_allowed
          title: Code
        message:
          type: string
          title: Message
      type: object
      required:
      - code
      - message
      title: ProfileDateOfBirthUpdateNotAllowedError
    ProfileNotFoundError:
      properties:
        code:
          type: string
          const: profile_not_found
          title: Code
        message:
          type: string
          title: Message
      type: object
      required:
      - code
      - message
      title: ProfileNotFoundError
    Settings:
      properties:
        isDateOfBirthAllowed:
          type: boolean
          title: Isdateofbirthallowed
        privacyLinks:
          additionalProperties:
            items:
              $ref: '#/components/schemas/PrivacyLink'
            type: array
          type: object
          title: Privacylinks
        legalEntity:
          $ref: '#/components/schemas/LegalEntity'
      type: object
      required:
      - isDateOfBirthAllowed
      - privacyLinks
      - legalEntity
      title: Settings
    SongwhipFanDoubleOptInConsentIdCheckError:
      properties:
        code:
          type: string
          const: fan_consent_id_check_error
          title: Code
        message:
          type: string
          title: Message
      type: object
      required:
      - code
      - message
      title: SongwhipFanDoubleOptInConsentIdCheckError
    Subscription:
      properties:
        id:
          type: string
          title: Id
        name:
          type: string
          title: Name
        isActive:
          type: boolean
          title: Isactive
      type: object
      required:
      - id
      - name
      - isActive
      title: Subscription
    SubscriptionChange:
      properties:
        id:
          type: string
          title: Id
        isActive:
          type: boolean
          title: Isactive
      type: object
      required:
      - id
      - isActive
      title: SubscriptionChange
    UnsubscribeAllByEmailInput:
      properties:
        email:
          type: string
          format: email
          title: Email
        emailCampaignId:
          anyOf:
          - type: string
          - type: 'null'
          title: Emailcampaignid
        originId:
          anyOf:
          - type: string
          - type: 'null'
          title: Originid
        originType:
          anyOf:
          - type: string
          - type: 'null'
          title: Origintype
        automatedEmailTriggerId:
          anyOf:
          - type: string
          - type: 'null'
          title: Automatedemailtriggerid
      type: object
      required:
      - email
      title: UnsubscribeAllByEmailInput
    UpdateProfileInput:
      properties:
        email:
          anyOf:
          - type: string
            format: email
          - type: 'null'
          title: Email
        phoneNumber:
          anyOf:
          - type: string
            format: phone
          - type: 'null'
          title: Phonenumber
        firstName:
          anyOf:
          - type: string
            maxLength: 110
          - type: 'null'
          title: Firstname
        lastName:
          anyOf:
          - type: string
            maxLength: 110
          - type: 'null'
          title: Lastname
        dateOfBirth:
          anyOf:
          - type: string
            format: date
          - type: 'null'
          title: Dateofbirth
        birthday:
          anyOf:
          - type: string
            format: birthday
          - type: 'null'
          title: Birthday
        gender:
          anyOf:
          - $ref: '#/components/schemas/Gender'
          - type: 'null'
        countryCode:
          anyOf:
          - type: string
          - type: 'null'
          title: Countrycode
        city:
          anyOf:
          - type: string
            maxLength: 75
          - type: 'null'
          title: City
        address:
          anyOf:
          - type: string
            maxLength: 255
          - type: 'null'
          title: Address
        zipCode:
          anyOf:
          - type: string
            maxLength: 20
          - type: 'null'
          title: Zipcode
      type: object
      title: UpdateProfileInput
    UpdateSubscriptionsInput:
      properties:
        data:
          items:
            $ref: '#/components/schemas/SubscriptionChange'
          type: array
          uniqueItems: true
          title: Data
      type: object
      required:
      - data
      title: UpdateSubscriptionsInput
    FieldError:
      title: FieldError
      type: object
      properties:
        message:
          title: Message
          type: string
        code:
          title: Error code
          type: string
      required:
      - message
      - code
