openapi: 3.0.1
info:
  title: SCIM Mapping Service
  description: The SCIM Mapping Service provides a variety of APIs for upserting, deleting, and retrieving SCIM Mappings for a tenant.
  version: '2.0'
tags:
  - name: ScimMappingService
security:
  - Authorization: []
paths:
  /scim-mappings:
    get:
      summary: |-
        *
        Retrieves the SCIM Mapping of a tenant.
        Permission level: read
      operationId: ScimMappingService_GetMapping
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scimGetMappingResponse'
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/rpcStatus'
      parameters:
        - name: tenantId
          description: 'The Tenant ID of the SCIM Mapping. Required: false. Default: token''s tenant.'
          in: query
          required: false
          schema:
            type: string
      tags:
        - ScimMappingService
    delete:
      summary: |-
        *
        Deletes the SCIM Mapping of a tenant.
        Permission level: read-write
      operationId: ScimMappingService_DeleteMapping
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                type: object
                properties: {}
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/rpcStatus'
      parameters:
        - name: tenantId
          description: 'The Tenant ID of the SCIM Mapping. Default: token''s tenant.'
          in: query
          required: false
          schema:
            type: string
      tags:
        - ScimMappingService
    put:
      summary: |-
        *
        Upserts a SCIM Mapping for a tenant. The Mapping is unique per tenant.
        Permission level: read-write
      operationId: ScimMappingService_UpsertMapping
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/scimUpsertMappingResponse'
        default:
          description: An unexpected error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/rpcStatus'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/scimUpsertMappingRequest'
        required: true
      tags:
        - ScimMappingService
servers:
  - url: https://prod-ui-zwseuprod01p.pp.zebra.com/api
    description: EU Server
  - url: https://prod-ui-zwsusprod01p.pp.zebra.com/api
    description: NA Server
components:
  schemas:
    protobufAny:
      type: object
      properties:
        '@type':
          type: string
      additionalProperties: {}
    rpcStatus:
      type: object
      properties:
        code:
          type: integer
          format: int32
        message:
          type: string
        details:
          type: array
          items:
            $ref: '#/components/schemas/protobufAny'
    scimGetMappingResponse:
      type: object
      properties:
        mapping:
          $ref: '#/components/schemas/scimScimMappingProto'
    scimMappingAttributeProto:
      type: object
      properties:
        scimAttribute:
          type: string
          description: 'The SCIM attribute in the source system. Required: true.'
        userField:
          $ref: '#/components/schemas/scimScimUserFields'
        scope:
          type: string
          description: 'The attribute scope. Required: false. Defaults to the value from default_scope.'
        domain:
          type: string
          description: 'The attribute domain. Required: false. Defaults to the value from default_domain.'
        mappingMode:
          $ref: '#/components/schemas/scimScimMappingMode'
    scimScimMappingMode:
      type: string
      enum:
        - ADDITIVE
        - AUTHORITATIVE
      default: ADDITIVE
      description: Controls whether ASSIGNED_ROLES and SELECTED_DEPARTMENTS are merged with or replace existing site-level values.
    scimScimMappingProto:
      type: object
      properties:
        tenantId:
          type: string
          description: |-
            The Tenant ID of the SCIM Mapping. There can only be one SCIM Mapping per tenant.
            Required: false. Default: token's tenant.
        defaultDomain:
          type: string
          description: |-
            the default domain of the template, this value is used if a scim_attribute is not mapped in the template.
            Required: false. Default: platform.
        defaultScope:
          type: string
          description: |-
            the default scope of the template, this value is used if a scim_attribute is not mapped in the template.
            Required: false. Default: core.
        attributes:
          type: array
          items:
            $ref: '#/components/schemas/scimMappingAttributeProto'
    scimScimUserDomainFieldName:
      type: string
      enum:
        - FIRST_NAME
        - LAST_NAME
        - EMAIL
        - ASSIGNED_ROLES
        - PRIMARY_SITE
        - SELECTED_DEPARTMENTS
        - MIDDLE_NAME
        - PREFERRED_NAME
      default: FIRST_NAME
      description: Predefined user domain field names that can be set via SCIM mapping.
    scimScimUserFields:
      type: object
      properties:
        domainFieldName:
          $ref: '#/components/schemas/scimScimUserDomainFieldName'
        customAttributeFieldName:
          type: string
          description: A custom attribute field name stored as a user attribute.
      description: Represents the target user field - either a predefined domain field or a custom attribute.
    scimUpsertMappingRequest:
      type: object
      properties:
        mapping:
          $ref: '#/components/schemas/scimScimMappingProto'
    scimUpsertMappingResponse:
      type: object
      properties:
        mapping:
          $ref: '#/components/schemas/scimScimMappingProto'
  securitySchemes:
    Authorization:
      type: apiKey
      description: Bearer token
      name: Authorization
      in: header
