swagger: '2.0'
info:
  version: 2.0.0
  title: Citrix App Personalization Service APIs
  description: 'These are Citrix App Personalization Service APIs. For more information about Citrix App Personalization Service, see [https://info.citrite.net/display/xenmobile/Personalisation+Service+Architecture](https://info.citrite.net/display/xenmobile/Personalisation+Service+Architecture).'
  contact:
    email: Brand_Personalization@citrix.com
    name: App Personalization Team
host: personalization.cloud.com
schemes:
  - https
consumes:
  - application/json
produces:
  - application/json
paths:
  /personalizations:
    post:
      description: Post operation to add personalization
      summary: PersonalizationsPost
      tags:
        - personalizations
      operationId: PersonalizationsPost
      deprecated: false
      produces:
        - application/json
      consumes:
        - application/json
      parameters:
        - name: Citrix-CustomerId
          in: header
          required: true
          type: string
          description: Citrix cloud customer ID
        - name: Authorization
          in: header
          required: true
          type: string
          description: Bearer or service key token
        - name: Citrix-TransactionId
          in: header
          required: false
          type: string
          description: Transaction ID
        - name: Accept
          in: header
          required: false
          type: string
          description: application/json
        - name: body
          in: body
          required: true
          description: personalization object
          schema:
            $ref: '#/definitions/Personalization'
      responses:
        '201':
          description: Created
          headers:
            Location:
              type: string
            X-Content-Type-Options:
              type: string
            Citrix-TransactionId:
              type: string
        '400':
          description: Invalid Parameters
          schema:
            $ref: '#/definitions/ErrorModel'
        '401':
          description: Authentication failed
          schema:
            $ref: '#/definitions/ErrorModel'
        '403':
          description: Authorization failed
          schema:
            $ref: '#/definitions/ErrorModel'
        '404':
          description: Not Found
          schema:
            $ref: '#/definitions/ErrorModel'
        '406':
          description: Not Acceptable
          schema:
            $ref: '#/definitions/ErrorModel'
        '409':
          description: Optimistic Concurrency
          schema:
            $ref: '#/definitions/ErrorModel'
        '415':
          description: Unsupported Media Type
          schema:
            $ref: '#/definitions/ErrorModel'
        '429':
          description: Rate Limited Exceeded
          schema:
            $ref: '#/definitions/ErrorModel'
        '501':
          description: Not Implemented
          schema:
            $ref: '#/definitions/ErrorModel'
        '503':
          description: Service Unavailable
          schema:
            $ref: '#/definitions/ErrorModel'
    get:
      description: Get operation to fetch personalizations
      summary: PersonalizationGet
      tags:
        - personalizations
      operationId: PersonalizationGet
      deprecated: false
      produces:
        - application/json
      parameters:
        - name: Citrix-CustomerId
          in: header
          required: true
          type: string
          description: Citrix cloud customer ID
        - name: Authorization
          in: header
          required: true
          type: string
          description: Bearer or service key token
        - name: Citrix-TransactionId
          in: header
          required: false
          type: string
          description: Transaction ID
        - name: Accept
          in: header
          required: false
          type: string
          description: application/json
      responses:
        '200':
          description: OK
          schema:
            $ref: '#/definitions/PersonalizationsResponse'
          headers:
            Citrix-TransactionId:
              type: string
            X-Content-Type-Options:
              type: string
        '401':
          description: Authentication failed
          schema:
            $ref: '#/definitions/ErrorModel'
        '403':
          description: Authorization failed
          schema:
            $ref: '#/definitions/ErrorModel'
        '404':
          description: Not Found
          schema:
            $ref: '#/definitions/ErrorModel'
        '406':
          description: Not Acceptable
          schema:
            $ref: '#/definitions/ErrorModel'
  '/personalizations/{id}':
    put:
      description: Put operation to update personalization
      summary: PersonalizationsPut
      tags:
        - personalizations
      operationId: PersonalizationsPut
      deprecated: false
      produces:
        - application/json
      consumes:
        - application/json
      parameters:
        - name: Citrix-CustomerId
          in: header
          required: true
          type: string
          description: Citrix cloud customer ID
        - name: Authorization
          in: header
          required: true
          type: string
          description: Bearer or service key token
        - name: id
          in: path
          required: true
          type: string
          description: personalization id
        - name: Citrix-TransactionId
          in: header
          required: false
          type: string
          description: Transaction ID
        - name: Accept
          in: header
          required: false
          type: string
          description: application/json
        - name: body
          in: body
          required: true
          description: personalization object
          schema:
            $ref: '#/definitions/Personalization'
      responses:
        '204':
          description: No-Content
          headers:
            Citrix-TransactionId:
              type: string
            X-Content-Type-Options:
              type: string
        '400':
          description: Invalid Parameters
          schema:
            $ref: '#/definitions/ErrorModel'
        '401':
          description: Authentication failed
          schema:
            $ref: '#/definitions/ErrorModel'
        '403':
          description: Authorization failed
          schema:
            $ref: '#/definitions/ErrorModel'
        '404':
          description: Not Found
          schema:
            $ref: '#/definitions/ErrorModel'
        '406':
          description: Not Acceptable
          schema:
            $ref: '#/definitions/ErrorModel'
        '409':
          description: Optimistic Concurrency
          schema:
            $ref: '#/definitions/ErrorModel'
        '415':
          description: Unsupported Media Type
          schema:
            $ref: '#/definitions/ErrorModel'
        '429':
          description: Rate Limited Exceeded
          schema:
            $ref: '#/definitions/ErrorModel'
        '501':
          description: Not Implemented
          schema:
            $ref: '#/definitions/ErrorModel'
        '503':
          description: Service Unavailable
          schema:
            $ref: '#/definitions/ErrorModel'
    get:
      description: Get operation to fetch personalizations by id
      summary: PersonalizationIdGet
      tags:
        - personalizations
      operationId: PersonalizationIdGet
      deprecated: false
      produces:
        - application/json
      parameters:
        - name: Citrix-CustomerId
          in: header
          required: true
          type: string
          description: Citrix cloud customer ID
        - name: Authorization
          in: header
          required: true
          type: string
          description: Bearer or service key token
        - name: id
          in: path
          required: true
          type: string
          description: personalization id
        - name: Citrix-TransactionId
          in: header
          required: false
          type: string
          description: Transaction ID
        - name: Accept
          in: header
          required: false
          type: string
          description: application/json
      responses:
        '200':
          description: OK
          schema:
            $ref: '#/definitions/Personalization'
          headers:
            Citrix-TransactionId:
              type: string
            X-Content-Type-Options:
              type: string
        '401':
          description: Authentication failed
          schema:
            $ref: '#/definitions/ErrorModel'
        '403':
          description: Authorization failed
          schema:
            $ref: '#/definitions/ErrorModel'
        '404':
          description: Not Found
          schema:
            $ref: '#/definitions/ErrorModel'
        '406':
          description: Not Acceptable
          schema:
            $ref: '#/definitions/ErrorModel'
  '/personalizations/{id}/builds':
    post:
      description: Post operation to create a build
      summary: PersonalizationsBuildPost
      tags:
        - personalizations
      operationId: PersonalizationsBuildPost
      deprecated: false
      produces:
        - application/json
      consumes:
        - application/json
      parameters:
        - name: async
          in: query
          required: true
          type: string
          description: Tells whether the API supports aynchronous calls
        - name: Citrix-CustomerId
          in: header
          required: true
          type: string
          description: Citrix cloud customer ID
        - name: Authorization
          in: header
          required: true
          type: string
          description: Bearer or service key token
        - name: Citrix-TransactionId
          in: header
          required: false
          type: string
          description: Transaction ID
        - name: id
          in: path
          required: true
          type: string
          description: personalization id
        - name: Accept
          in: header
          required: false
          type: string
          description: application/json
        - name: body
          in: body
          required: true
          description: build object
          schema:
            $ref: '#/definitions/Build'
      responses:
        '202':
          description: Build accepted
          headers:
            Location:
              type: string
            X-Content-Type-Options:
              type: string
            Citrix-TransactionId:
              type: string
        '400':
          description: Invalid Parameters
          schema:
            $ref: '#/definitions/ErrorModel'
        '401':
          description: Authentication failed
          schema:
            $ref: '#/definitions/ErrorModel'
        '403':
          description: Authorization failed
          schema:
            $ref: '#/definitions/ErrorModel'
        '404':
          description: Not Found
          schema:
            $ref: '#/definitions/ErrorModel'
        '406':
          description: Not Acceptable
          schema:
            $ref: '#/definitions/ErrorModel'
        '409':
          description: Optimistic Concurrency
          schema:
            $ref: '#/definitions/ErrorModel'
        '415':
          description: Unsupported Media Type
          schema:
            $ref: '#/definitions/ErrorModel'
        '429':
          description: Rate Limited Exceeded
          schema:
            $ref: '#/definitions/ErrorModel'
        '501':
          description: Not Implemented
          schema:
            $ref: '#/definitions/ErrorModel'
        '503':
          description: Service Unavailable
          schema:
            $ref: '#/definitions/ErrorModel'
    get:
      description: Get operation to fetch builds by personalization Id
      summary: PersonalizationBuildGet
      tags:
        - personalizations
      operationId: PersonalizationBuildGet
      deprecated: false
      produces:
        - application/json
      parameters:
        - name: Citrix-CustomerId
          in: header
          required: true
          type: string
          description: Citrix cloud customer ID
        - name: Authorization
          in: header
          required: true
          type: string
          description: Bearer or service key token
        - name: id
          in: path
          required: true
          type: string
          description: personalization id
        - name: Citrix-TransactionId
          in: header
          required: false
          type: string
          description: Transaction ID
        - name: Accept
          in: header
          required: false
          type: string
          description: application/json
      responses:
        '200':
          description: OK
          schema:
            $ref: '#/definitions/PersonalizationsBuildsResponse'
          headers:
            Citrix-TransactionId:
              type: string
            X-Content-Type-Options:
              type: string
        '401':
          description: Authentication failed
          schema:
            $ref: '#/definitions/ErrorModel'
        '403':
          description: Authorization failed
          schema:
            $ref: '#/definitions/ErrorModel'
        '404':
          description: Not Found
          schema:
            $ref: '#/definitions/ErrorModel'
        '406':
          description: Not Acceptable
          schema:
            $ref: '#/definitions/ErrorModel'
  '/personalizations/{id}/builds/{buildId}':
    get:
      description: Get operation to fetch build by personalization Id and build Id
      summary: PersonalizationBuildIdGet
      tags:
        - personalizations
      operationId: PersonalizationBuildIdGet
      deprecated: false
      produces:
        - application/json
      parameters:
        - name: Citrix-CustomerId
          in: header
          required: true
          type: string
          description: Citrix cloud customer ID
        - name: Authorization
          in: header
          required: true
          type: string
          description: Bearer or service key token
        - name: id
          in: path
          required: true
          type: string
          description: personalization id
        - name: buildId
          in: path
          required: true
          type: string
          description: build id
        - name: Citrix-TransactionId
          in: header
          required: false
          type: string
          description: Transaction ID
        - name: Accept
          in: header
          required: false
          type: string
          description: application/json
      responses:
        '200':
          description: OK
          schema:
            $ref: '#/definitions/BuildParameters'
          headers:
            Citrix-TransactionId:
              type: string
            X-Content-Type-Options:
              type: string
        '401':
          description: Authentication failed
          schema:
            $ref: '#/definitions/ErrorModel'
        '403':
          description: Authorization failed
          schema:
            $ref: '#/definitions/ErrorModel'
        '404':
          description: Not Found
          schema:
            $ref: '#/definitions/ErrorModel'
        '406':
          description: Not Acceptable
          schema:
            $ref: '#/definitions/ErrorModel'
  '/personalizations/{id}/$promote':
    post:
      description: Post operation to trigger production deployment
      summary: PersonalizationsIdPromote
      tags:
        - personalizations
      operationId: PersonalizationsIdPromote
      deprecated: false
      produces:
        - application/json
      consumes:
        - application/json
      parameters:
        - name: Citrix-CustomerId
          in: header
          required: true
          type: string
          description: Citrix cloud customer ID
        - name: Authorization
          in: header
          required: true
          type: string
          description: Bearer or service key token
        - name: id
          in: path
          required: true
          type: string
          description: personalization id
        - name: Citrix-TransactionId
          in: header
          required: false
          type: string
          description: Transaction ID
        - name: Accept
          in: header
          required: false
          type: string
          description: application/json
        - name: body
          in: body
          required: false
          description: empty object
          schema:
            type: object
      responses:
        '201':
          description: Created
          headers:
            Location:
              type: string
            X-Content-Type-Options:
              type: string
            Citrix-TransactionId:
              type: string
        '400':
          description: Invalid Parameters
          schema:
            $ref: '#/definitions/ErrorModel'
        '401':
          description: Authentication failed
          schema:
            $ref: '#/definitions/ErrorModel'
        '403':
          description: Authorization failed
          schema:
            $ref: '#/definitions/ErrorModel'
        '404':
          description: Not Found
          schema:
            $ref: '#/definitions/ErrorModel'
        '406':
          description: Not Acceptable
          schema:
            $ref: '#/definitions/ErrorModel'
        '409':
          description: Optimistic Concurrency
          schema:
            $ref: '#/definitions/ErrorModel'
        '415':
          description: Unsupported Media Type
          schema:
            $ref: '#/definitions/ErrorModel'
        '429':
          description: Rate Limited Exceeded
          schema:
            $ref: '#/definitions/ErrorModel'
        '501':
          description: Not Implemented
          schema:
            $ref: '#/definitions/ErrorModel'
        '503':
          description: Service Unavailable
          schema:
            $ref: '#/definitions/ErrorModel'
  '/personalizations/{product}/{platform}/builds':
    get:
      description: Get operation to fetch available Citrix Workspace app versions for Windows and Mac
      summary: PersonalizationVersionGet
      tags:
        - personalizations
      operationId: PersonalizationVersionGet
      deprecated: false
      produces:
        - application/json
      parameters:
        - name: Citrix-CustomerId
          in: header
          required: true
          type: string
          description: Citrix cloud customer ID
        - name: Authorization
          in: header
          required: true
          type: string
          description: Bearer or service key token
        - name: product
          in: path
          required: true
          type: string
          description: Name of the product
          example: 'Citrix Workspace app'
        - name: platform
          in: path
          required: true
          type: string
          description: Name of the platform
          example: "'Windows' or 'Mac'"
        - name: Citrix-TransactionId
          in: header
          required: false
          type: string
          description: Transaction ID
        - name: Accept
          in: header
          required: false
          type: string
          description: application/json
      responses:
        '200':
          description: OK
          schema:
            $ref: '#/definitions/PersonalizationsVersion'
          headers:
            Citrix-TransactionId:
              type: string
            X-Content-Type-Options:
              type: string
        '401':
          description: Authentication failed
          schema:
            $ref: '#/definitions/ErrorModel'
        '403':
          description: Authorization failed
          schema:
            $ref: '#/definitions/ErrorModel'
        '404':
          description: Not found
          schema:
            $ref: '#/definitions/ErrorModel'
        '406':
          description: Not acceptable
          schema:
            $ref: '#/definitions/ErrorModel'          
definitions:
  Build:
    title: Build
    type: object
    properties:
      version:
        type: string
      email:
        type: string
    required:
      - version
  Personalization:
    title: Personalization
    type: object
    properties:
      appName:
        description: Name of the application
        example: Demo Workspace
        type: string
      platform:
        $ref: '#/definitions/Platform'
      product:
        $ref: '#/definitions/Product'
      storeURL:
        description: Store URL to be used in Citrix Workspace app
        example: https://testserver.net/Citrix/MyStore/discovery
        type: string  
      abmDetails:
          type: object
          required:
            - abmId
            - orgDetails
          properties:
            abmId:
              type: array
              items: 
                type: string
                example: 'example@citrix.com'
                description: Apple Business Manager Email ID
            orgDetails:
              type: array
              items: 
                type: object
                required:
                  - orgId
                  - orgName
                properties:
                  orgId:
                    type: string
                    example: '123456'
                    description: Apple Business Organisation ID
                  orgName:
                    type: string
                    example: 'example'
                    description: Apple Business Organisation Name
      appIconDataURI:
        description: Image to be used for the application. This shoud be a image of 512 X 512 resolution
        example: 'data:image/jpeg;base64,/9j/2wBDAAMCAgICAgMCAgIDAwMDBAYEBAQEBAgGBgUGCQgKCgkICQkKDA8MCgsOCwkJDRENDg8QEBEQCgwSExIQEw8QEBD/yQALCAABAAEBAREA/8wABgAQEAX/2gAIAQEAAD8A0s8g/9k='
        type: string
      secondaryDataURI:
        description: This is required for Citrix Workspace app Product. Image to be used for the application task bar for Mac and Windows should have a resolution of 512 X 512. Image to be used as a welcome screen logo for Android and iOS should have a resolution of 1024 X 500.
        example: 'data:image/jpeg;base64,/9j/2wBDAAMCAgICAgMCAgIDAwMDBAYEBAQEBAgGBgUGCQgKCgkICQkKDA8MCgsOCwkJDRENDg8QEBEQCgwSExIQEw8QEBD/yQALCAABAAEBAREA/8wABgAQEAX/2gAIAQEAAD8A0s8g/9k='
        type: string
    required:
      - appName
      - platform
      - product
      - appIconDataURI
  PersonalizationConfig:
    title: PersonalizationConfig
    type: object
    properties:
      appName:
        description: Name of the application
        example: Demo Workspace
        type: string
      appIconDataURI:
        description: Image to be used for the application
        example: 'data:image/jpeg;base64,/9j/2wBDAAMCAgICAgMCAgIDAwMDBAYEBAQEBAgGBgUGCQgKCgkICQkKDA8MCgsOCwkJDRENDg8QEBEQCgwSExIQEw8QEBD/yQALCAABAAEBAREA/8wABgAQEAX/2gAIAQEAAD8A0s8g/9k='
        type: string
      secondaryDataURI:
        description: Image to be used for the application task bar
        example: 'data:image/jpeg;base64,/9j/2wBDAAMCAgICAgMCAgIDAwMDBAYEBAQEBAgGBgUGCQgKCgkICQkKDA8MCgsOCwkJDRENDg8QEBEQCgwSExIQEw8QEBD/yQALCAABAAEBAREA/8wABgAQEAX/2gAIAQEAAD8A0s8g/9k='
        type: string
    required:
      - appName
  PersonalizationConfigItem:
    title: PersonalizationConfigItem
    type: object
    properties:
      appName:
        description: Name of the application
        example: Demo Workspace
        type: string
    required:
      - appName
  BuildParameters:
    title: BuildParameters
    type: object
    properties:
      id:
        description: The build id
        example: '1234'
        type: string
      type:
        description: Tells the type of the task
        example: build
        type: string
      overallProgressPercent:
        description: Tells the overall progress of the build
        example: 100
        type: number
        format: double
      isCancellable:
        description: Tells whether the job is cancellable
        example: false
        type: boolean
      status:
        $ref: '#/definitions/Status'
      resultLocation:
        $ref: '#/definitions/ResultLocation'
      createdAt:
        description: Tells when the task was created
        example: '2020-05-28T14:05:17Z'
        type: string
      createdBy:
        description: The user who has started the build
        example: 5435763ttt33
        type: string
      startedAt:
        description: Tells when the task was started
        example: '2020-05-28T14:07:17Z'
        type: string
      endedAt:
        description: Tells when the task was completed
        example: '2020-05-28T15:07:17Z'
        type: string
      version:
        description: Version of the application being personalized
        type: string
      personalizationConfig:
        $ref: '#/definitions/PersonalizationConfig'
      error:
        $ref: '#/definitions/ErrorModel'
    required:
      - id
      - type
      - overallProgressPercent
      - isCancellable
      - status
      - resultLocation
      - createdAt
      - createdBy
      - startedAt
      - endedAt
      - version
      - personalizationConfig
  BuildItemsParameters:
    title: BuildItemsParameters
    type: object
    properties:
      id:
        description: The build id
        example: '1234'
        type: string
      type:
        description: Tells the type of the task
        example: build
        type: string
      overallProgressPercent:
        description: Tells the overall progress of the build
        example: 100
        type: number
        format: double
      isCancellable:
        description: Tells whether the job is cancellable
        example: false
        type: boolean
      status:
        $ref: '#/definitions/Status'
      createdAt:
        description: Tells when the task was created
        example: '2020-05-28T14:05:17Z'
        type: string
      createdBy:
        description: The user who has started the build
        example: 5435763ttt33
        type: string
      startedAt:
        description: Tells when the task was started
        example: '2020-05-28T14:07:17Z'
        type: string
      endedAt:
        description: Tells when the task was completed
        example: '2020-05-28T15:07:17Z'
        type: string
      version:
        description: Version of the application being personalized
        type: string
      personalizationConfig:
        $ref: '#/definitions/PersonalizationConfigItem'
      error:
        $ref: '#/definitions/ErrorModel'
    required:
      - id
      - type
      - overallProgressPercent
      - isCancellable
      - status
      - createdAt
      - createdBy
      - version
      - personalizationConfig
  ErrorParameters:
    title: ErrorParameters
    type: object
    properties:
      name:
        type: string
      value:
        type: string
    required:
      - name
      - value
  ErrorModel:
    title: ErrorModel
    type: object
    properties:
      type:
        description: The type of error
        example: 'https://errors-api.cloud.com/branding/{errordetails}'
        type: string
      detail:
        description: The description of the error
        example: describe the error scenario
        type: string
      parameters:
        type: array
        items:
          $ref: '#/definitions/ErrorParameters'
    required:
      - type
      - detail
  PersonalizationsBuildsResponse:
    title: PersonalizationsBuildsResponse
    type: object
    properties:
      items:
        type: array
        items:
          $ref: '#/definitions/BuildItemsParameters'
  PersonalizationsResponse:
    title: PersonalizationsResponse
    type: object
    properties:
      items:
        type: array
        items:
          $ref: '#/definitions/Personalization'
  PersonalizationsVersion:
    title: PersonalizationsVersion
    type: object
    properties:
      items:
        type: array
        items:
          type: string
          example: '2008'
          description: Citrix Workspace app version
  Platform:
    title: Platform
    description: Platforms supported
    type: string
    enum:
      - Android
      - iOS
      - Windows
      - Mac
  Product:
    title: Product
    description: Products supported
    type: string
    enum:
      - Citrix Files
      - Citrix Workspace app
      - Secure Mail
      - Secure Web
  ResultLocation:
    title: ResultLocation
    type: object
    properties:
      downloadURL:
        example: 'https://testblobcheck.blob.core.windows.net/apppersonal/0440d3bd19e75b768b9aa67877ab2d70a.zip'
        type: string
      message:
        description: 'downloadURL will expire on YYYY-MM-DDThh:mm:ssZ'
        example: 'downloadURL will expire on 2017-06-21T14:07:17Z'
        type: string
  Status:
    title: Status
    description: Build status values
    type: string
    enum:
      - notStarted
      - inProgress
      - complete
      - failed
tags:
  - name: personalizations
    description: Everything about your App Personalization