---
openapi: 3.0.1
info:
  title: Spa.Admin
  version: '1.0'
servers:
  - url: https://{host}:{port}/accessSecurity
    variables:
      host:
        default: ''
      port:
        default: ''
paths:
  /accessPolicy:
    get:
      tags:
        - accessPolicy
      summary: Returns all access policies, ordered according to caller's request. Pagination is supported.
      operationId: getAccessPolicyCollection
      parameters:
        - name: name
          in: query
          description: The access policy name
          schema:
            type: string
        - name: offset
          in: query
          description: The index of the first item to include in the returned collection
          schema:
            maximum: 2147483647
            minimum: 0
            type: integer
            format: int32
            default: 0
        - name: limit
          in: query
          description: The index of the first item to exclude from the returned collection
          schema:
            maximum: 2147483647
            minimum: 0
            type: integer
            format: int32
            default: 1000
        - name: orderby
          in: query
          description: Sort order
          schema:
            type: string
            default: priority
        - name: Citrix-TransactionId
          in: header
          description: Transaction id
          schema:
            type: string
      responses:
        '200':
          description: List of policies
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PoliciesModel'
        '401':
          description: Authentication Error
        '406':
          description: Not Acceptable
    post:
      tags:
        - accessPolicy
      summary: Creates a new access policy.
      operationId: postAccessPolicyItem
      parameters:
        - name: Citrix-TransactionId
          in: header
          description: Transaction id
          schema:
            type: string
      requestBody:
        description: The access policy to create.
        content:
          application/json; charset=utf-8:
            schema:
              $ref: '#/components/schemas/PolicyModel'
      responses:
        '201':
          description: Created
          content:
            application/json: {}
        '400':
          description: Request error
        '401':
          description: Authentication Error
        '406':
          description: Not Acceptable
        '409':
          description: Conflict
        '415':
          description: Unsupported Media Type
  /accessPolicy/{resourceId}:
    get:
      tags:
        - accessPolicy
      summary: Returns single access policy
      operationId: getAccessPolicyItem
      parameters:
        - name: resourceId
          in: path
          description: The resource id of the requested access policy
          required: true
          schema:
            type: string
        - name: Citrix-TransactionId
          in: header
          description: Transaction id
          schema:
            type: string
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PolicyModel'
        '401':
          description: Authentication Error
        '404':
          description: Policy not found
        '406':
          description: Not Acceptable
    put:
      tags:
        - accessPolicy
      summary: Updates an access policy.
      operationId: putAccessPolicyItem
      parameters:
        - name: resourceId
          in: path
          description: The resource id of the access policy to be updated.
          required: true
          schema:
            type: string
        - name: Citrix-TransactionId
          in: header
          description: Transaction id
          schema:
            type: string
      requestBody:
        description: The updated policy.
        content:
          application/json; charset=utf-8:
            schema:
              $ref: '#/components/schemas/PolicyModel'
      responses:
        '204':
          description: Policy updated
          content:
            application/json: {}
        '400':
          description: Request error
        '401':
          description: Authentication Error
        '404':
          description: Policy not found
        '406':
          description: Not Acceptable
        '415':
          description: Unsupported Media Type
    delete:
      tags:
        - accessPolicy
      summary: Deletes an access policy.
      operationId: deleteAccessPolicyItem
      parameters:
        - name: resourceId
          in: path
          description: The resource id of the access policy to be deleted
          required: true
          schema:
            type: string
        - name: Citrix-TransactionId
          in: header
          description: Transaction id
          schema:
            type: string
      responses:
        '204':
          description: Policy deleted
          content:
            application/json: {}
        '401':
          description: Authentication Error
        '404':
          description: Policy not found
        '406':
          description: Not Acceptable
  /applications:
    get:
      tags:
        - applications
      summary: Returns all applications that match filter conditions, ordered according to caller's request. Pagination is supported.
      operationId: getApplicationCollection
      parameters:
        - name: name
          in: query
          description: The application name
          schema:
            type: string
        - name: type
          in: query
          description: The application type
          schema:
            type: string
        - name: offset
          in: query
          description: The index of the first item to include in the returned collection
          schema:
            maximum: 2147483647
            minimum: 0
            type: integer
            format: int32
            default: 0
        - name: limit
          in: query
          description: The index of the first item to exclude from the returned collection
          schema:
            maximum: 2147483647
            minimum: 0
            type: integer
            format: int32
            default: 1000
        - name: orderby
          in: query
          description: Sort order
          schema:
            type: string
            default: name
        - name: Citrix-TransactionId
          in: header
          description: Transaction id
          schema:
            type: string
      responses:
        '200':
          description: List of applications
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApplicationsModel'
        '401':
          description: Authentication Error
        '406':
          description: Not Acceptable
    post:
      tags:
        - applications
      summary: Creates new application
      operationId: postApplicationItem
      parameters:
        - name: Citrix-TransactionId
          in: header
          description: Transaction id
          schema:
            type: string
      requestBody:
        description: The application to create.
        content:
          application/json; charset=utf-8:
            schema:
              $ref: '#/components/schemas/ApplicationModel'
      responses:
        '201':
          description: Application created
          content:
            application/json: {}
        '400':
          description: Request error
        '401':
          description: Authentication Error
        '406':
          description: Not Acceptable
        '415':
          description: Unsupported Media Type
  /applications/{resourceId}:
    get:
      tags:
        - applications
      summary: Returns single application
      operationId: getApplicationItem
      parameters:
        - name: resourceId
          in: path
          description: The resource id of the requested application
          required: true
          schema:
            type: string
        - name: Citrix-TransactionId
          in: header
          description: Transaction id
          schema:
            type: string
      responses:
        '200':
          description: Application with resource ID
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApplicationModel'
        '401':
          description: Authentication Error
        '404':
          description: Application not found
        '406':
          description: Not Acceptable
    put:
      tags:
        - applications
      summary: Updates an application
      description: All fields are mandatory, but can be set to null to indicate an unset state.
      operationId: putApplicationItem
      parameters:
        - name: resourceId
          in: path
          description: The resource id of the application to be updated
          required: true
          schema:
            type: string
        - name: Citrix-TransactionId
          in: header
          description: Transaction id
          schema:
            type: string
      requestBody:
        description: The application.
        content:
          application/json; charset=utf-8:
            schema:
              $ref: '#/components/schemas/ApplicationModel'
      responses:
        '204':
          description: Application updated
          content:
            application/json: {}
        '400':
          description: Request error
        '401':
          description: Authentication Error
        '404':
          description: Application not found
        '406':
          description: Not Acceptable
        '415':
          description: Unsupported Media Type
    delete:
      tags:
        - applications
      summary: Deletes an application
      operationId: deleteApplicationItem
      parameters:
        - name: resourceId
          in: path
          description: The resource id of the application to be deleted
          required: true
          schema:
            type: string
        - name: Citrix-TransactionId
          in: header
          description: Transaction id
          schema:
            type: string
      responses:
        '204':
          description: Application deleted
          content:
            application/json: {}
        '401':
          description: Authentication Error
        '404':
          description: Application not found
        '406':
          description: Not Acceptable
  /applications/{resourceId}/policies:
    get:
      tags:
        - applications
      summary: Returns policy list for an application
      operationId: getApplicationPolicies
      parameters:
        - name: resourceId
          in: path
          description: The application resource id.
          required: true
          schema:
            type: string
        - name: Citrix-TransactionId
          in: header
          description: Transaction id
          schema:
            type: string
      responses:
        '200':
          description: Policy list for the application
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ApplicationPolicyModel'
        '401':
          description: Authentication Error
        '406':
          description: Not Acceptable
  /admin/signin:
    post:
      tags:
        - login
      summary: Authenticates the user and checks that they are a valid SPA admin, then generates a valid bearer token for the user.
      operationId: postUserCredentials
      parameters:
        - name: Citrix-TransactionId
          in: header
          description: Transaction id
          schema:
            type: string
      requestBody:
        description: The user credentials.
        content:
          application/json; charset=utf-8:
            schema:
              $ref: '#/components/schemas/UserAuthenticationModel'
      responses:
        '200':
          description: Success
          content:
            application/json: {}
        '400':
          description: Request error
        '401':
          description: Authentication Error
        '406':
          description: Not Acceptable
        '415':
          description: Unsupported Media Type
  /routingDomains:
    get:
      tags:
        - routingDomains
      summary: Returns all routing domains, ordered according to caller's request. Pagination is supported.
      operationId: getRoutingDomainsCollection
      parameters:
        - name: status
          in: query
          description: Fetch status of routing domains instead of full list
          schema:
            type: boolean
            default: false
        - name: offset
          in: query
          description: The index of the first item to include in the returned collection
          schema:
            maximum: 2147483647
            minimum: 0
            type: integer
            format: int32
            default: 0
        - name: limit
          in: query
          description: The index of the first item to exclude from the returned collection
          schema:
            maximum: 2147483647
            minimum: 0
            type: integer
            format: int32
            default: 1000
        - name: orderby
          in: query
          description: Sort order
          schema:
            type: string
            default: fqdn
        - name: Citrix-TransactionId
          in: header
          description: Transaction id
          schema:
            type: string
      responses:
        '200':
          description: Routing Domains List
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RoutingEntriesModel'
        '401':
          description: Authentication Error
        '406':
          description: Not Acceptable
    post:
      tags:
        - routingDomains
      summary: Creates new routing domain
      operationId: postRoutingDomainsItem
      parameters:
        - name: Citrix-TransactionId
          in: header
          description: Transaction id
          schema:
            type: string
      requestBody:
        description: The routing domain to create.
        content:
          application/json; charset=utf-8:
            schema:
              $ref: '#/components/schemas/RoutingEntryModel'
      responses:
        '201':
          description: Route added
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RoutingEntryModel'
        '400':
          description: Request error
        '401':
          description: Authentication Error
        '406':
          description: Not Acceptable
        '409':
          description: Conflict
        '415':
          description: Unsupported Media Type
  /routingDomains/{fqdn}:
    get:
      tags:
        - routingDomains
      summary: Returns single routing domain
      operationId: getRoutingDomainsItem
      parameters:
        - name: fqdn
          in: path
          description: FQDN of the requested routing domain
          required: true
          schema:
            type: string
        - name: Citrix-TransactionId
          in: header
          description: Transaction id
          schema:
            type: string
      responses:
        '200':
          description: Routing Domain
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RoutingEntryModel'
        '401':
          description: Authentication Error
        '404':
          description: Route not found
        '406':
          description: Not Acceptable
    put:
      tags:
        - routingDomains
      summary: Updates a routing domain
      operationId: putRoutingDomainsItem
      parameters:
        - name: fqdn
          in: path
          description: FQDN of the routing domain to be updated
          required: true
          schema:
            type: string
        - name: Citrix-TransactionId
          in: header
          description: Transaction id
          schema:
            type: string
      requestBody:
        description: The routing domain.
        content:
          application/json; charset=utf-8:
            schema:
              $ref: '#/components/schemas/RoutingEntryModel'
      responses:
        '204':
          description: Route updated
          content:
            application/json: {}
        '400':
          description: Request error
        '401':
          description: Authentication Error
        '404':
          description: Route not found
        '406':
          description: Not Acceptable
        '409':
          description: Conflict
        '415':
          description: Unsupported Media Type
    delete:
      tags:
        - routingDomains
      summary: Deletes a routing domain
      operationId: deleteRoutingDomainsItem
      parameters:
        - name: fqdn
          in: path
          description: FQDN of the routing domain to be deleted
          required: true
          schema:
            type: string
        - name: Citrix-TransactionId
          in: header
          description: Transaction id
          schema:
            type: string
      responses:
        '204':
          description: Route deleted
          content:
            application/json: {}
        '400':
          description: Request error
        '401':
          description: Authentication Error
        '404':
          description: Route not found
        '406':
          description: Not Acceptable
  /routingDomains/search:
    post:
      tags:
        - routingDomains
      summary: Searches for routing domains with given FQDNs
      operationId: postRoutingDomainsSelectedList
      parameters:
        - name: Citrix-TransactionId
          in: header
          description: Transaction id
          schema:
            type: string
      requestBody:
        description: List of routing domains FQDNs
        content:
          application/json; charset=utf-8:
            schema:
              $ref: '#/components/schemas/FQDNListModel'
      responses:
        '200':
          description: Routing Domains List
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RoutingEntriesModel'
        '400':
          description: Request error
        '401':
          description: Authentication Error
        '406':
          description: Not Acceptable
        '415':
          description: Unsupported Media Type
components:
  schemas:
    AccessRuleStates:
      enum:
        - ALLOW
        - DENY
        - FAILURE
        - NO_MATCH
      type: string
    AccessRulesModel:
      required:
        - access
        - active
        - priority
        - rules
      type: object
      properties:
        name:
          maxLength: 512
          minLength: 1
          type: string
          description: Name of access rule
          nullable: true
        id:
          type: string
          description: Gets or Sets Id
          nullable: true
        description:
          maxLength: 512
          type: string
          description: Gets or Sets Description
          nullable: true
        priority:
          type: integer
          description: Gets or Sets Priority
          format: int32
        active:
          type: boolean
          description: Gets or Sets Active
        access:
          $ref: '#/components/schemas/AccessRuleStates'
        accessNative:
          $ref: '#/components/schemas/AccessRuleStates'
        restrictions:
          $ref: '#/components/schemas/SecurityControlModel'
        rules:
          type: array
          items:
            $ref: '#/components/schemas/RulesModel'
          description: Gets or Sets Rules
        conditions:
          type: array
          items:
            $ref: '#/components/schemas/ConditionsModel'
          description: Gets or Sets Conditions
          nullable: true
      additionalProperties: false
      description: ''
    ApplicationModel:
      required:
        - name
        - type
      type: object
      properties:
        id:
          type: string
          description: Application identifier (unique)
          nullable: true
        name:
          maxLength: 512
          minLength: 1
          type: string
          description: Name of this application
        type:
          $ref: '#/components/schemas/ApplicationTypes'
        description:
          maxLength: 2048
          minLength: 1
          type: string
          description: Description of this application
          nullable: true
        category:
          maxLength: 2048
          minLength: 1
          type: string
          description: category of this application
          nullable: true
        keywords:
          type: array
          items:
            type: string
          description: keywords of this application
          nullable: true
        url:
          type: string
          description: Application URL
          nullable: true
        policies:
          type: array
          items:
            $ref: '#/components/schemas/PolicyModel'
          description: Gets or Sets Policies
          nullable: true
        hidden:
          type: boolean
          description: Whether to hide the App
        destination:
          type: array
          items:
            $ref: '#/components/schemas/DestinationModel'
          description: Gets or Sets Destination
          nullable: true
        state:
          $ref: '#/components/schemas/ApplicationStates'
        relatedURLs:
          type: array
          items:
            type: string
          description: Gets or Sets RelatedUrls
          nullable: true
        icon:
          maxLength: 787246
          minLength: 1
          type: string
          description: Base64 encoded icon data
          nullable: true
        policyCount:
          type: integer
          description: Contextual Policy count associated with application
          format: int32
          nullable: true
        custom_properties:
          $ref: '#/components/schemas/CustomPropertiesModel'
        createdTime:
          type: string
          description: Application Created Time
          nullable: true
        templateName:
          type: string
          description: Application Template Name
          nullable: true
        usingTemplate:
          type: boolean
          description: Application uses template
          nullable: true
        sbsOnlyLaunch:
          type: boolean
          description: SBS Only Launch
          nullable: true
        mobileSecurity:
          type: boolean
          description: Mobile Security
          nullable: true
        customerDomainFields:
          description: Customer Domain Fields
          nullable: true
        sso:
          description: sso
          nullable: true
      additionalProperties: false
      description: Application Api Model
    ApplicationPolicyModel:
      type: object
      properties:
        policyResourceId:
          type: array
          items:
            type: string
          nullable: true
        policyName:
          type: array
          items:
            type: string
          nullable: true
      additionalProperties: false
    ApplicationStates:
      enum:
        - COMPLETE
        - INCOMPLETE
      type: string
    ApplicationTypes:
      enum:
        - WEB
        - SAAS
        - ZTNA
        - SIC
        - EMPTY
      type: string
    ApplicationsModel:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/ApplicationModel'
          nullable: true
        totalNum:
          type: integer
          description: Gets or Sets Number of Applications
          format: int64
      additionalProperties: false
      description: ''
    ConditionsModel:
      type: object
      properties:
        platformFilter:
          $ref: '#/components/schemas/PlatformTypes'
      additionalProperties: false
      description: Conditions model will be mainly for the platform rule.
    CustomPropertiesModel:
      type: object
      properties:
        sic_app_details:
          $ref: '#/components/schemas/SicAppDetailsModel'
      additionalProperties: false
      description: CustomPropertiesModel Api Model
    DestinationModel:
      required:
        - destination
        - port
        - protocol
        - subType
      type: object
      properties:
        id:
          type: string
          description: Destination identifier (unique)
          nullable: true
        destination:
          maxLength: 512
          minLength: 1
          type: string
          description: Destination value
        port:
          maxLength: 512
          minLength: 1
          type: string
          description: Destination port
        protocol:
          $ref: '#/components/schemas/ProtocolTypes'
        subType:
          $ref: '#/components/schemas/DestinationSubTypes'
        routingType:
          $ref: '#/components/schemas/RoutingTypes'
      additionalProperties: false
      description: Destination Api Model
    DestinationSubTypes:
      enum:
        - HOSTNAME
        - IP_RANGE
        - IP_AND_CIDR
        - UNSPECIFIED
      type: string
    FQDNListModel:
      required:
        - fqdnList
      type: object
      properties:
        fqdnList:
          type: array
          items:
            type: string
          description: Gets or Sets _FqdnList
      additionalProperties: false
      description: ''
    JToken:
      type: array
      items:
        $ref: '#/components/schemas/JToken'
    PlatformTypes:
      enum:
        - MOBILE
        - PC
        - ANY
      type: string
    PoliciesModel:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/PolicyModel'
          description: Gets or Sets Policies
          nullable: true
        totalNum:
          type: integer
          description: Gets or Sets Number of Policies
          format: int64
      additionalProperties: false
      description: ''
    PolicyModel:
      required:
        - accessRules
        - active
        - apps
        - name
        - priority
      type: object
      properties:
        id:
          type: string
          description: Policy identifier (unique)
          nullable: true
        apps:
          type: array
          items:
            type: string
          description: Gets or Sets Apps
        name:
          maxLength: 512
          minLength: 1
          type: string
          description: Name of this Policy
        description:
          maxLength: 512
          type: string
          description: Gets or Sets Description
          nullable: true
        priority:
          type: integer
          description: Gets or Sets Priority
          format: int32
        active:
          type: boolean
          description: Gets or Sets Active
        accessRules:
          type: array
          items:
            $ref: '#/components/schemas/AccessRulesModel'
          description: Gets or Sets AccessRules
        modified:
          type: string
          description: Policy modified date - epoch time
          nullable: true
      additionalProperties: false
      description: ''
    ProtocolTypes:
      enum:
        - TCP
        - UDP
        - UNSPECIFIED
      type: string
    RoutingEntriesModel:
      type: object
      properties:
        id:
          type: string
          nullable: true
        status:
          $ref: '#/components/schemas/StatusModel'
        items:
          type: array
          items:
            $ref: '#/components/schemas/RoutingEntryModel'
          nullable: true
        totalNum:
          type: integer
          format: int64
      additionalProperties: false
      description: ''
    RoutingEntryModel:
      required:
        - fqdn
        - type
      type: object
      properties:
        id:
          type: string
          description: RoutingEntry identifier (unique)
          nullable: true
        fqdn:
          maxLength: 255
          minLength: 1
          type: string
          description: Fqdn which needs to be routed
        type:
          $ref: '#/components/schemas/RoutingTypes'
        flag:
          $ref: '#/components/schemas/States'
        comment:
          maxLength: 64
          type: string
          description: Admin to add some description to a routing entry
          nullable: true
        appType:
          $ref: '#/components/schemas/ApplicationTypes'
        ip:
          type: boolean
          description: whether the secure access app has ip based configuration
          nullable: true
        error:
          maxLength: 64
          type: string
          description: partial or subset overlap in routing entries
          nullable: true
      additionalProperties: false
      description: ''
    RoutingTypes:
      enum:
        - INTERNAL
        - EXTERNAL
      type: string
    RuleOperators:
      enum:
        - EQ
        - IN
        - CONTAINS
        - LTE
        - GTE
        - NOT
        - RANGE
        - NE
      type: string
    RuleTagSources:
      enum:
        - ITM
        - EPA
        - NLS
        - CAS
        - EMPTY
      type: string
    RuleTypes:
      enum:
        - TAG
        - USERGROUP
        - PLATFORM
        - MACHINEGROUP
        - MULTIURLDOMAIN
      type: string
    RulesModel:
      required:
        - operator
        - type
        - values
      type: object
      properties:
        type:
          $ref: '#/components/schemas/RuleTypes'
        operator:
          $ref: '#/components/schemas/RuleOperators'
        tagSource:
          $ref: '#/components/schemas/RuleTagSources'
        tagKey:
          type: string
          description: Gets or Sets TagKey
          nullable: true
        values:
          type: array
          items:
            type: string
          description: Gets or Sets Values
        metadata:
          type: object
          additionalProperties:
            type: string
          description: Gets or Sets Metadata
          nullable: true
      additionalProperties: false
      description: ''
    SecurityControlModel:
      type: object
      properties:
        redirectSBS:
          type: boolean
        enhancedSecuritySettings:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/JToken'
          nullable: true
      additionalProperties: false
    SicAppDetailsModel:
      type: object
      properties:
        clients:
          type: array
          items:
            $ref: '#/components/schemas/SicClientModel'
          description: Gets or Sets Clients
          nullable: true
        backend_servers:
          type: array
          items:
            type: string
          description: Gets or Sets BackendServers
          nullable: true
      additionalProperties: false
      description: SicAppDetailsModel Api Model
    SicClientModel:
      required:
        - port
        - protocol
      type: object
      properties:
        id:
          type: string
          description: Destination identifier (unique)
          nullable: true
        port:
          maxLength: 512
          minLength: 1
          type: string
          description: Destination port
        protocol:
          $ref: '#/components/schemas/ProtocolTypes'
      additionalProperties: false
      description: SicClient Api Model
    States:
      enum:
        - ENABLED
        - DISABLED
      type: string
    StatusModel:
      type: object
      properties:
        statusCode:
          type: integer
          description: Status Code
          format: int32
        statusText:
          type: string
          description: Status Text
          nullable: true
        errorCount:
          type: integer
          description: Error Count
          format: int32
      additionalProperties: false
      description: ''
    UserAuthenticationModel:
      required:
        - password
        - username
      type: object
      properties:
        username:
          maxLength: 20
          minLength: 1
          pattern: ^(?<username>[\w\'\-\!\#\^\~\.]*[\w\'\-\!\#\^\~]+)$
          type: string
          description: The user name.
        password:
          maxLength: 32
          minLength: 1
          type: string
          description: The password.
        domain:
          maxLength: 32
          minLength: 0
          pattern: ^(?<domain>(\w+-*\w*)+(\.\w+-*\w*)*)$
          type: string
          description: The domain.
          nullable: true
      additionalProperties: false
      description: The user information used during authentication.
  securitySchemes:
    Bearer:
      type: http
      scheme: bearer
security:
  - Bearer: []
