openapi: 3.0.3
info:
  title: ThingPark Subscribers API
  description: REST interface for **Subscribers**.
  version: "8.0"
servers:
  - url: https://community.thingpark.io/thingpark/smp/rest
    description: Community
  - url: https://thingparkenterprise.eu.actility.com/thingpark/smp/rest
    description: Europe
  - url: https://thingparkenterprise.us.actility.com/thingpark/smp/rest
    description: United-States
  - url: https://thingparkenterprise.au.actility.com/thingpark/smp/rest
    description: Australia
  - url: https://{hostname}/thingpark/smp/rest
    description: Self-hosted TPE
    variables:
      hostname:
        default: enterprise.actility.local
        description: Hostname of the self-hosted TPE deployment
paths:
  "/subscribers/mine":
    get:
      tags:
        - subscribers
      summary: Retrieve Subscriber
      description: |
        Retrieve a Subscriber Account.

        ### Access rights:
        - `<SubscriberAccount>.acl/x`
      parameters:
        - $ref: "#/components/parameters/CustomFields"
      responses:
        "200":
          $ref: "#/components/responses/Subscriber"
        default:
          $ref: "#/components/responses/Error"
    parameters: []
  "/subscribers/mine/applications":
    get:
      tags:
        - products
      summary: Retrieve ApplicationsSubscriber
      description: >
        Retrieve the list of Applications (see also the RETRIEVE associated to a
        `<place>`.


        Results are ordered by "name" (lexicographic order).


        ### Access rights:

        - `<SubscriberAccount>.acl/x`
      parameters:
        - $ref: "#/components/parameters/PageIndex"
        - $ref: "#/components/parameters/Language-tag"
        - $ref: "#/components/parameters/ApplicationState"
      responses:
        "200":
          $ref: "#/components/responses/ApplicationsSubscriber"
        default:
          $ref: "#/components/responses/Error"
    parameters: []
  "/subscribers/mine/domainGroups":
    get:
      tags:
        - domains
      summary: Retrieve Domain Groups
      description: |
        Retrieve the list of domain groups.

        Results are ordered by name (lexicographic order).

        ### Access rights:
        - `<SubscriberAccount>.acl/x`
      responses:
        "200":
          $ref: "#/components/responses/DomainGroups"
        default:
          $ref: "#/components/responses/Error"
    post:
      tags:
        - domains
      summary: Create Domain Group
      description: |
        Create a domain group: the `name` must be unique among all domain groups
        within the subscriber account.

        A domain group allows gathering several domains belonging to the same
        segregation scope (this scope may be the geographical location, the IoT
        vertical use-case, end-customer ID...). A resource cannot be associated
        with two domains belonging to the same group.

        ### Access rights:
        - `<SubscriberAccount>.acl/a`
      requestBody:
        $ref: "#/components/requestBodies/DomainGroup"
      responses:
        "201":
          $ref: "#/components/responses/DomainGroup"
        default:
          $ref: "#/components/responses/Error"
    parameters: []
  "/subscribers/mine/domainGroups/{domainGroupUid}":
    get:
      tags:
        - domains
      summary: Retrieve a Domain Group
      description: |
        Retrieve a domain group.

        ### Access rights:
        - `<SubscriberAccount>.acl/x`
      responses:
        "200":
          $ref: "#/components/responses/DomainGroup"
        default:
          $ref: "#/components/responses/Error"
    put:
      tags:
        - domains
      summary: Update a Domain Group
      description: |
        Update a domain group: only `color` and `description` can be updated.

        ### Access rights:
        - `<SubscriberAccount>.acl/a`
      requestBody:
        $ref: "#/components/requestBodies/DomainGroup"
      responses:
        "200":
          $ref: "#/components/responses/DomainGroup"
        default:
          $ref: "#/components/responses/Error"
    delete:
      tags:
        - domains
      summary: Delete a Domain Group
      description: |
        Delete a domain group: the domain group can be deleted only if it does
        not contain any domain.

        ### Access rights:
        - `<SubscriberAccount>.acl/a`
      responses:
        "204":
          $ref: "#/components/responses/Delete"
        default:
          $ref: "#/components/responses/Error"
    parameters:
      - $ref: "#/components/parameters/DomainGroup"
  "/subscribers/mine/domains":
    get:
      tags:
        - domains
      summary: Retrieve Domains
      description: |
        Retrieve the list of domains.

        Results are ordered by name (lexicographic order).

        ### Access rights:
        - `<SubscriberAccount>.acl/a`
      parameters:
        - name: groupName
          in: query
          description: |
            Only return domains belonging to the group identified by `groupName`
            (exact match).
          schema:
            type: string
        - name: domain
          in: query
          description: |
            Domain filtering (exact match)

            Domain group name and domain name must be provided as follow:
            `domain.group.name`:`domain.name`
          style: form
          explode: true
          schema:
            type: array
            items:
              type: string
              example: Site:France/Caen
        - name: state
          in: query
          description: State filtering (exact match)
          schema:
            type: string
            enum:
              - ACTIVE
              - INACTIVE
      responses:
        "200":
          $ref: "#/components/responses/Domains"
        default:
          $ref: "#/components/responses/Error"
    post:
      tags:
        - domains
      summary: Create Domain
      description: |
        Create a domain: the `groupName` must match an existing domain group
        and the `name` must be unique among all domains belonging to this group.

        Use domains to restrict user access to a subset of resources, by
        associating resources (base stations, devices or multicast groups) with
        one or several domains and setting domain restrictions for individual
        user accounts.

        ### Access rights:
        - `<SubscriberAccount>.acl/a`
      requestBody:
        $ref: "#/components/requestBodies/Domain"
      responses:
        "201":
          $ref: "#/components/responses/Domain"
        default:
          $ref: "#/components/responses/Error"
    parameters: []
  "/subscribers/mine/domains/{domainUid}":
    get:
      tags:
        - domains
      summary: Retrieve a Domain
      description: |
        Retrieve a domain.

        ### Access rights:
        - `<SubscriberAccount>.acl/a`
      responses:
        "200":
          $ref: "#/components/responses/Domain"
        default:
          $ref: "#/components/responses/Error"
    put:
      tags:
        - domains
      summary: Update a Domain
      description: |
        Update a domain: only `state` and `description` can be updated.

        ### Access rights:
        - `<SubscriberAccount>.acl/a`
      requestBody:
        $ref: "#/components/requestBodies/Domain"
      responses:
        "200":
          $ref: "#/components/responses/Domain"
        default:
          $ref: "#/components/responses/Error"
    delete:
      tags:
        - domains
      summary: Delete a Domain
      description: |
        Delete a domain: the domain can be deleted only if its state is
        `INACTIVE` and if it is no more associated with resources.

        ### Access rights:
        - `<SubscriberAccount>.acl/a`
      responses:
        "204":
          $ref: "#/components/responses/Delete"
        default:
          $ref: "#/components/responses/Error"
    parameters:
      - $ref: "#/components/parameters/Domain"
  "/subscribers/mine/domains/suggestions":
    get:
      tags:
        - domains
      summary: Retrieve Domain Suggestions
      description: |
        Retrieve a list of full domain names and/or domain name prefixes
        starting with a query string (case insensitive).

        Only the domains matching the domain restrictions of the authenticated
        user can be retrieved.

        The number of suggestions returned in the response is configurable
        (system-wide). By default the 20 first results are returned.

        Results are ordered by `name` (lexicographic order).

        ### Access rights:
        - `<SubscriberAccount>.acl/x`
      parameters:
        - name: query
          in: query
          description: |
            Returns the domain names starting with the query value (case
            insensitive)
          required: true
          schema:
            type: string
        - name: type
          in: query
          description: |
            Return domain suggestions matching the type (exact match).
          schema:
            type: string
            enum:
              - FULL
              - PREFIX
        - name: excludeGroup
          in: query
          description: |
            Exclude any domain suggestion associated with the provided domain
            groups (exact match).
          schema:
            type: array
            items:
              type: string
        - name: excludeDomain
          in: query
          description: >
            Exclude the provided full domains from the suggestions (exact
            match).


            Domain group name and domain name must be provided as follow:

            `domain.group.name`:`domain.name`
          schema:
            type: array
            items:
              type: string
        - name: state
          in: query
          description: State filtering (exact match)
          schema:
            type: string
            enum:
              - ACTIVE
              - INACTIVE
      responses:
        "200":
          $ref: "#/components/responses/DomainSuggestions"
        default:
          $ref: "#/components/responses/Error"
    parameters: []
  "/subscribers/mine/serviceAccounts":
    parameters: []
    get:
      parameters:
        - $ref: "#/components/parameters/PageIndex"
      operationId: getServiceAccounts
      description: |
        Retrieve service accounts

        ### Access rights:
        - `<SubscriberAccount>.acl/a`
      tags:
        - service-accounts
      responses:
        "200":
          description: Service accounts
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ServiceAccounts"
        default:
          $ref: "#/components/responses/Error"
    post:
      description: |
        Create a service account

        ### Access rights:
        - `<SubscriberAccount>.acl/a`
      operationId: addServiceAccount
      tags:
        - service-accounts
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ServiceAccount"
      responses:
        "201":
          description: Created service account
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ServiceAccount"
        default:
          $ref: "#/components/responses/Error"
  "/subscribers/mine/serviceAccounts/{serviceAccountId}":
    parameters:
      - $ref: "#/components/parameters/ServiceAccountId"
    get:
      operationId: getServiceAccount
      description: |
        Retrieve a service account

        ### Access rights:
        - `<SubscriberAccount>.acl/a`
      tags:
        - service-accounts
      responses:
        "200":
          description: Service account
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ServiceAccount"
        default:
          $ref: "#/components/responses/Error"
    put:
      operationId: updateServiceAccount
      description: |
        Update a service account

        ### Access rights:
        - `<SubscriberAccount>.acl/a`
      tags:
        - service-accounts
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ServiceAccount"
      responses:
        "200":
          description: Service account updated
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ServiceAccount"
        default:
          $ref: "#/components/responses/Error"
    delete:
      operationId: deleteServiceAccount
      description: |
        Delete a service account

        ### Access rights:
        - `<SubscriberAccount>.acl/a`
      tags:
        - service-accounts
      responses:
        "204":
          description: Service account deleted
        default:
          $ref: "#/components/responses/Error"
  "/subscribers/mine/serviceAccounts/{serviceAccountId}/secret":
    parameters:
      - $ref: "#/components/parameters/ServiceAccountId"
    post:
      operationId: createServiceAccountSecret
      description: |
        Generate a new secret

        ### Access rights:
        - `<SubscriberAccount>.acl/a`
      tags:
        - service-accounts
      responses:
        "200":
          description: Secret created
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ServiceAccountSecret"
        default:
          $ref: "#/components/responses/Error"
  "/subscribers/mine/serviceAccounts/groups":
    parameters:
      - $ref: "#/components/parameters/Language-tag"
    get:
      operationId: getServiceAccountsGroups
      description: |
        Retrieve groups assignable to service accounts

        ### Access rights:
        - `<SubscriberAccount>.acl/a`
      tags:
        - service-accounts
      responses:
        "200":
          description: Service account groups
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Groups"
        default:
          $ref: "#/components/responses/Error"
  "/subscribers/mine/users":
    get:
      tags:
        - users
      summary: Retrieve Users
      description: >
        Retrieve the list of Users accessible to a Subscriber. This includes:

        - All User Accounts attached to the End User realm of the Subscriber Account.


        Results are ordered by "lastName" (lexicographic order).


        ### Access rights:

        - `<SubscriberAccount>.acl/a`
      x-rateLimit:
        category: MEDIUM_IMPACT
      parameters:
        - $ref: "#/components/parameters/PageIndex"
        - name: firstName
          in: query
          description: Return user matching the first name (prefix match).
          schema:
            type: string
        - name: lastName
          in: query
          description: Return user matching the last name (prefix match).
          schema:
            type: string
        - name: email
          in: query
          description: Return user matching the email (prefix match).
          schema:
            type: string
        - name: organization
          in: query
          description: Return user matching the organization (prefix match).
          schema:
            type: string
        - name: query
          in: query
          description: |
            Search users with a firstName or lastName or email containing the
            provided term (prefix match).
          schema:
            type: string
        - name: apiOnly
          in: query
          deprecated: true
          description: >
            Either `true` to return API only users or `false` to return non API
            only users. 

            All types of users are returned if the query param is not provided.


            This property must no longer be used: service accounts must be used

            to access the API.
          schema:
            type: boolean
      responses:
        "200":
          $ref: "#/components/responses/Users"
        default:
          $ref: "#/components/responses/Error"
    post:
      tags:
        - users
      summary: Create User
      description: >
        Create an End User:

        - The End User is automatically attached to the End User Realm of the Subscriber.

        - The email address is used as login.

        - The User Account language is initialized with the Subscriber language.

        - The following cases are supported regarding the user password:
          - The password is provided in the Request: this password is disposable.
          - The password is not provided in the Request: an activation URL is sent by email to the user.

        ### Access rights:

        - `<SubscriberAccount>.acl/a` if `password` is not provided in the request

        - `<SubscriberAccount>.acl/RA` if `password` is provided in the request
      x-rateLimit:
        category: MEDIUM_IMPACT
      parameters:
        - name: noGroup
          in: query
          description: If true, the created user is not associated to any group, else user
            id added to ADMINS group.
          schema:
            type: boolean
            default: false
      requestBody:
        $ref: "#/components/requestBodies/User"
      responses:
        "201":
          $ref: "#/components/responses/User"
        default:
          $ref: "#/components/responses/Error"
    parameters: []
  "/subscribers/mine/users/{userUid}":
    get:
      tags:
        - users
      summary: Retrieve a user account
      description: >
        Retrieve a user account.


        ### Access rights:

        - `<SubscriberAccount>.acl/a`

        - Access is granted to user on its own account (hardcoded without ACL Permission)
      responses:
        "200":
          $ref: "#/components/responses/User"
        default:
          $ref: "#/components/responses/Error"
    put:
      tags:
        - users
      summary: Update a user account
      description: |
        Update a user account. A user cannot edit its own account.

        If the email is updated, a reset URL is sent to the new email address.

        If the user account is associated with a federated identity, only
        `domainRestrictions`, `groupIDs` and `language` properties can be
        updated.

        ### Access rights:
        - `<SubscriberAccount>.acl/a`
      requestBody:
        $ref: "#/components/requestBodies/User"
      responses:
        "200":
          $ref: "#/components/responses/User"
        default:
          $ref: "#/components/responses/Error"
    delete:
      tags:
        - users
      summary: Delete a user account
      description: |
        Delete a user account. A user cannot delete its own account.

        ### Access rights:
        - `<SubscriberAccount>.acl/a`
      responses:
        "204":
          description: User account deleted
        default:
          $ref: "#/components/responses/Error"
    parameters:
      - $ref: "#/components/parameters/User"
  "/subscribers/mine/users/passwordPolicy":
    get:
      tags:
        - users
      summary: Retrieve PasswordPolicy
      description: |
        Retrieve the password policy for users.

        ### Access rights:
        - `<SubscriberAccount>.acl/x`
      responses:
        "200":
          $ref: "#/components/responses/PasswordPolicy"
        default:
          $ref: "#/components/responses/Error"
    parameters: []
  "/subscribers/mine/users/groups":
    get:
      tags:
        - users
      summary: Retrieve user groups
      description: |
        Retrieve the groups available for users.

        ### Access rights:
        - `<SubscriberAccount>.acl/x`
      responses:
        "200":
          $ref: "#/components/responses/UserGroups"
        default:
          $ref: "#/components/responses/Error"
    parameters:
      - $ref: "#/components/parameters/Language-tag"
components:
  schemas:
    ApplicationsSubscriber:
      type: object
      readOnly: true
      required:
        - briefs
        - more
      properties:
        briefs:
          type: object
          properties:
            brief:
              type: array
              items:
                type: object
                required:
                  - name
                  - commercialName
                  - ID
                  - supplier
                  - state
                  - presentationStatus
                  - widgetActivated
                  - href
                properties:
                  ID:
                    type: string
                  commercialName:
                    type: string
                  href:
                    type: string
                  logo:
                    type: string
                    nullable: true
                  name:
                    type: string
                  description:
                    type: string
                    nullable: true
                  place:
                    type: object
                    deprecated: true
                    description: >
                      This property must no longer be used: the associated
                      feature is no more available in the product.
                    required:
                      - personalName
                      - ID
                    properties:
                      ID:
                        type: string
                      personalName:
                        type: string
                    nullable: true
                  presentationStatus:
                    enum:
                      - SHOWN
                      - HIDDEN
                    type: string
                  state:
                    type: object
                    required:
                      - value
                      - timestamp
                    properties:
                      info1:
                        type: string
                        description: Current Additional info
                        nullable: true
                      timestamp:
                        type: integer
                        format: int64
                        example: 1577836800000
                        description: Current timestamp, epoch time in milliseconds
                      value:
                        $ref: "#/components/schemas/EnumApplicationState"
                  supplier:
                    type: object
                    required:
                      - name
                      - commercialName
                    properties:
                      commercialName:
                        type: string
                      name:
                        type: string
                  widgetActivated:
                    type: boolean
                    description: TRUE when dashboard URI and/or portal URI are defined for the
                      application.
              nullable: true
        more:
          $ref: "#/components/schemas/More"
    Domain:
      type: object
      required:
        - name
        - group
      x-requiredCreate:
        - state
      x-requiredRead:
        - state
      properties:
        name:
          x-updateForbidden: true
          type: string
          description: |
            Domains belonging to the same group must have distinct names. Once
            defined at creation step, the domain name cannot be changed
            afterwards. The domain name may contain "/" characters to define a
            hierarchy (e.g., Paris/Warehouse1).
          pattern: ^((?!\x20)[^\x00-\x1F\x2F\x3A\x3C\x3E\x7F]{1,20}(?<!\x20)\/){0,4}(?!\x20)[^\x00-\x1F\x2F\x3A\x3C\x3E\x7F]{1,20}(?<!\x20)$
          example: France/Paris
        group:
          x-updateForbidden: true
          type: object
          required:
            - name
          description: Domain group associated with the domain
          properties:
            name:
              type: string
              description: Name of the domain group
              pattern: ^(?!\x20)[^\x00-\x1F\x3A\x3C\x3E\x7F]{1,20}(?<!\x20)$
              example: Site
            color:
              readOnly: true
              type: string
              description: RGB color code of the domain group
              pattern: ^#[0-9a-fA-F]{6}$
              example: "#A6CEE3"
              nullable: true
        state:
          type: string
          enum:
            - ACTIVE
            - INACTIVE
          description: >
            State of the domain:

            -	`ACTIVE`: the domain can be used and cannot be deleted

            -	`INACTIVE`: the domain can no more be used and can be deleted if not in use
        description:
          type: string
          description: Optional free description
          example: Paris office
          nullable: true
    DomainGroup:
      type: object
      required:
        - name
      properties:
        name:
          x-updateForbidden: true
          type: string
          description: |
            Domain groups must have distinct names. Once defined at creation
            step, the domain group name cannot be changed afterwards.
          pattern: ^(?!\x20)[^\x00-\x1F\x3A\x3C\x3E\x7F]{1,20}(?<!\x20)$
          example: Site
        color:
          type: string
          description: RGB color code of the domain group
          pattern: ^#[0-9a-fA-F]{6}$
          example: "#A6CEE3"
          nullable: true
        description:
          type: string
          description: Optional free description
          example: Caen office
          nullable: true
    DomainGroups:
      type: object
      readOnly: true
      required:
        - briefs
      properties:
        briefs:
          type: object
          required:
            - brief
          properties:
            brief:
              type: array
              items:
                type: object
                allOf:
                  - $ref: "#/components/schemas/DomainGroup"
                  - type: object
                    properties:
                      href:
                        type: string
                        description: Domain group href
                        nullable: true
              example:
                - name: Site
                  color: "#A6CEE3"
                  description: Resource physical location
                  href: /thingpark/smp/rest/subscribers/99906959/domainGroups/145
                - name: Vertical
                  color: "#DADA00"
                  description: Resource usage
                  href: /thingpark/smp/rest/subscribers/99906959/domainGroups/244
    DomainRestrictions:
      type: object
      description: |
        User's domain restrictions:
        - If no domain restrictions are defined, the user can access all
          cross-domain resources and all domain-specific resources
        - Else, the user can access all cross-domain resources and only
          domain-specific resources matching the domain restrictions
      required:
        - and
      properties:
        and:
          type: array
          description: |
            A resource matches if it matches all `and` items.
          items:
            type: object
            description: |
              A resource matches if it is associated with a domain satisfying
              the following requirements:
              - The group name of the resource domain is `group.name` (exact
                match)
              - If `type` is `PREFIX`:
                - The name of the resource domain is prefixed with `name`
              - Else: (`type` is `FULL`)
                - The name of the resource domain is `name` (exact match)
            required:
              - type
              - name
              - group
            properties:
              type:
                type: string
                enum:
                  - FULL
                  - PREFIX
                description: |
                  Type of domain restriction:
                  - `FULL`: restriction on full domain
                  - `PREFIX`: restriction on domain prefix
                example: FULL
              name:
                type: string
                description: Name of the full domain or domain prefix
                pattern: ^((?!\x20)[^\x00-\x1F\x2F\x3A\x3C\x3E\x7F]{1,20}(?<!\x20)\/){0,4}(?!\x20)[^\x00-\x1F\x2F\x3A\x3C\x3E\x7F]{1,20}(?<!\x20)$
                example: France/Caen
              group:
                type: object
                description: |
                  Domain group associated with the domain restriction
                required:
                  - name
                properties:
                  name:
                    type: string
                    description: Name of the domain group
                    pattern: ^(?!\x20)[^\x00-\x1F\x3A\x3C\x3E\x7F]{1,20}(?<!\x20)$
                    example: Site
            minItems: 1
          example:
            - type: PREFIX
              name: France
              group:
                name: Site
            - type: FULL
              name: Energy
              group:
                name: Vertical
      nullable: true
    Domains:
      type: object
      readOnly: true
      required:
        - briefs
      properties:
        briefs:
          type: object
          required:
            - brief
          properties:
            brief:
              type: array
              items:
                type: object
                allOf:
                  - $ref: "#/components/schemas/Domain"
                  - type: object
                    properties:
                      href:
                        type: string
                        description: Domain href
                        nullable: true
              example:
                - name: Energy
                  group:
                    name: Vertical
                    color: "#DADA00"
                  state: ACTIVE
                  description: Energy sensors
                  href: /thingpark/smp/rest/subscribers/99906959/domains/261
                - name: France/Caen
                  group:
                    name: Site
                    color: "#A6CEE3"
                  state: ACTIVE
                  description: Caen office
                  href: /thingpark/smp/rest/subscribers/99906959/domains/162
                - name: France/Lannion
                  group:
                    name: Site
                    color: "#A6CEE3"
                  state: ACTIVE
                  description: Lannion office
                  href: /thingpark/smp/rest/subscribers/99906959/domains/174
                - name: France/Lyon
                  group:
                    name: Site
                    color: "#A6CEE3"
                  state: ACTIVE
                  description: Lyon office
                  href: /thingpark/smp/rest/subscribers/99906959/domains/190
                - name: France/Paris
                  group:
                    name: Site
                    color: "#A6CEE3"
                  state: ACTIVE
                  description: Paris office
                  href: /thingpark/smp/rest/subscribers/99906959/domains/208
                - name: Location
                  group:
                    name: Vertical
                    color: "#DADA00"
                  state: ACTIVE
                  description: Location trackers
                  href: /thingpark/smp/rest/subscribers/99906959/domains/288
    DomainSuggestions:
      type: object
      readOnly: true
      required:
        - briefs
        - query
      properties:
        briefs:
          type: object
          required:
            - brief
          properties:
            brief:
              type: array
              items:
                type: object
                required:
                  - type
                  - name
                  - group
                  - state
                properties:
                  type:
                    type: string
                    enum:
                      - FULL
                      - PREFIX
                    description: >
                      Type of domain:

                      - `FULL`: full domain, can be associated with resources and can be used in domain restrictions

                      - `PREFIX`: domain prefix, can only be used in domain restrictions
                    example: FULL
                  name:
                    type: string
                    description: Name of the domain
                    example: France/Caen
                  group:
                    type: object
                    description: Domain group associated with the domain
                    required:
                      - name
                    properties:
                      name:
                        type: string
                        description: Name of the domain group associated with the domain
                        example: Site
                  state:
                    type: string
                    enum:
                      - ACTIVE
                      - INACTIVE
                    description: >
                      State of the domain:

                      -	`ACTIVE`: the domain can be used and cannot be deleted

                      -	`INACTIVE`: the domain can no more be used and can be deleted if not in use
              example:
                - type: PREFIX
                  name: France
                  group:
                    name: Site
                  state: ACTIVE
                - type: FULL
                  name: France/Caen
                  group:
                    name: Site
                  state: ACTIVE
                - type: FULL
                  name: France/Lannion
                  group:
                    name: Site
                  state: ACTIVE
                - type: FULL
                  name: France/Lyon
                  group:
                    name: Site
                  state: ACTIVE
                - type: FULL
                  name: France/Paris
                  group:
                    name: Site
                  state: ACTIVE
        query:
          type: string
          description: The query string provided in the request
          example: Fr
    Error:
      type: object
      readOnly: true
      required:
        - code
        - message
      properties:
        code:
          type: integer
          format: int32
          example: 25
        message:
          type: string
          example: unknown error
    OccContext:
      type: object
      required:
        - lastUpdate
        - version
        - who
      x-createForbidden: true
      properties:
        lastUpdate:
          type: integer
          format: int64
          example: 1577836800000
          readOnly: true
        version:
          minimum: 0
          type: integer
        who:
          type: string
          readOnly: true
          example: John Doe
      description: Optimistic Concurrency Control.
      nullable: true
    PasswordPolicy:
      type: object
      readOnly: true
      properties:
        forbiddenContent:
          type: object
          properties:
            value:
              type: array
              items:
                enum:
                  - firstName
                  - lastName
                type: string
              description: Password forbidden content
              example:
                - firstName
                - lastName
              nullable: true
          nullable: true
        mandatoryContent:
          type: object
          properties:
            value:
              type: array
              items:
                enum:
                  - lower
                  - upper
                  - digit
                  - special
                type: string
              description: >
                Password mandatory content


                Empty means no password mandatory content


                Special means that password should contain at least one special character `~!@#$%^&*()_=|:;"'<>,.?/-+{}[]\
              example:
                - lower
                - upper
                - digit
                - special
              nullable: true
          nullable: true
        maximumSize:
          type: integer
          description: Maximum password size
          format: int32
          nullable: true
        minimumSize:
          type: integer
          description: Minimum password size
          format: int32
          nullable: true
    ResourceCustomFields:
      type: object
      properties:
        customField:
          type: array
          items:
            type: object
            required:
              - ID
              - type
              - required
              - multivalued
            properties:
              ID:
                type: string
              type:
                type: string
                enum:
                  - BOOL
                  - INTEGER
                  - FLOAT
                  - ENUMERATE
                  - STRING
                readOnly: true
              name:
                type: string
                readOnly: true
                nullable: true
              required:
                type: boolean
                readOnly: true
              multivalued:
                type: boolean
                readOnly: true
              booleanValue:
                type: array
                items:
                  type: boolean
                description: |
                  boolean value (only applicable if type is BOOL)
                nullable: true
              integerValue:
                type: array
                items:
                  type: integer
                  format: int32
                description: |
                  integer value (only applicable if type is INTEGER)
                nullable: true
              floatValue:
                type: array
                items:
                  type: number
                  format: float
                description: |
                  float value (only applicable if type is FLOAT)
                nullable: true
              enumValue:
                type: object
                required:
                  - value
                properties:
                  value:
                    type: array
                    items:
                      type: object
                      required:
                        - ID
                      properties:
                        ID:
                          type: string
                        name:
                          type: string
                          readOnly: true
                          nullable: true
                description: |
                  enumerate value (only applicable if type is ENUMERATE)
                nullable: true
              stringValue:
                type: array
                items:
                  type: string
                description: |
                  enumerate value (only applicable if type is ENUMERATE)
                nullable: true
          description: List of Custom Fields
          nullable: true
      nullable: true
    ResourceCustomFieldSet:
      type: object
      required:
        - ID
        - href
      properties:
        ID:
          type: string
          description: |
            ID of the Custom Field Set associated with the Resource
        href:
          type: string
          description: |
            HREF to retrieve the Custom Field Set using helpers WS
          readOnly: true
        name:
          type: string
          description: |
            Name of the Custom Field Set associated with the Resource
          readOnly: true
          nullable: true
      nullable: true
    ServiceAccount:
      type: object
      required:
        - id
        - name
        - clientID
        - groupIDs
        - hasSecret
      properties:
        id:
          type: string
          description: Unique identifier assigned on creation
          readOnly: true
          example: 00e320a0-c518-42f4-9899-48e0c041fb56
        name:
          type: string
          example: My service account
        clientID:
          type: string
          example: sub-199983788/my-service-account
          description: Must start with `sub-<subscriber ID>/`
          pattern: ^sub-[A-Za-z0-9_/.-]+$
        groupIDs:
          type: array
          items:
            type: string
          example:
            - actility-sup/device-manager
            - actility-sup/network-manager
            - ADMINS
        hasSecret:
          type: boolean
          readOnly: true
          description: The service account have a client secret.
        disabled:
          type: boolean
          default: false
          description: A disabled service account cannot authenticate.
          nullable: true
        domainRestrictions:
          $ref: "#/components/schemas/DomainRestrictions"
    ServiceAccounts:
      type: object
      properties:
        briefs:
          type: object
          properties:
            brief:
              type: array
              items:
                $ref: "#/components/schemas/ServiceAccountBrief"
              nullable: true
          nullable: true
        more:
          type: boolean
          nullable: true
    ServiceAccountBrief:
      type: object
      required:
        - id
        - name
        - clientID
        - groupIDs
        - hasSecret
        - href
      properties:
        id:
          type: string
          description: Unique identifier assigned on creation
          example: 00e320a0-c518-42f4-9899-48e0c041fb56
        name:
          type: string
          example: My service account
        clientID:
          type: string
          example: sub-199983788/my-service-account
          description: Must start with `sub-<subscriber ID>/`
          pattern: ^sub-[A-Za-z0-9_/.-]+$
        groupIDs:
          type: array
          items:
            type: string
          example:
            - actility-sup/device-manager
            - actility-sup/network-manager
            - ADMINS
        hasSecret:
          type: boolean
          readOnly: true
          description: The service account have a client secret.
        disabled:
          type: boolean
          default: false
          description: A disabled service account cannot authenticate.
          nullable: true
        domainRestrictions:
          $ref: "#/components/schemas/DomainRestrictions"
        href:
          type: string
          example: /subscribers/32/serviceAccounts/tpk-100000123
    ServiceAccountSecret:
      type: object
      required:
        - clientSecret
      properties:
        clientSecret:
          type: string
          example: N"v=NZz)q3}<<5CC!%3?E@W[Dx=)e.
    Subscriber:
      type: object
      required:
        - ID
        - profileID
        - type
        - occContext
      x-requiredRead:
        - name
        - language
      properties:
        ID:
          type: string
          description: Subscriber ID
          readOnly: true
          example: "199906959"
        chargingAnniversary:
          type: integer
          format: int32
          deprecated: true
          description: >
            Subscriber Account charging day


            This property must no longer be used: the associated feature is no more available in the product.
          readOnly: true
          example: 21
          nullable: true
        clientIdPrefix:
          type: string
          example: sub-199906959/
          description: Mandatory prefix service accounts must have.
          readOnly: true
          nullable: true
        contactEmail:
          type: string
          description: Contact email address
          example: john.doe@example.com
          nullable: true
        contactHomePhone:
          type: string
          description: Home phone number
          example: "+3312346789"
          nullable: true
        contactInfo:
          type: string
          description: Contact information
          example: Please contact john.doe@example.com
          nullable: true
        contactMobilePhone:
          type: string
          description: Mobile phone number
          example: "+3362346789"
          nullable: true
        contactName:
          type: string
          description: Name of the Subscriber contact
          example: John Doe
          nullable: true
        contactOfficePhone:
          type: string
          description: Office phone number
          example: "+3312346789"
          nullable: true
        customFields:
          type: object
          allOf:
            - $ref: "#/components/schemas/ResourceCustomFields"
          example:
            customField:
              - ID: connectivity
                type: ENUMERATE
                required: false
                multivalued: true
                enumValue:
                  value:
                    - ID: connectivity/lorawan
                      name: LoRaWAN
                    - ID: connectivity/cellular
                      name: Cellular
              - ID: country
                type: STRING
                required: true
                multivalued: false
                stringValue:
                  - FR
          nullable: true
        customFieldSet:
          type: object
          readOnly: true
          allOf:
            - $ref: "#/components/schemas/ResourceCustomFieldSet"
          example:
            ID: wireless-subscriber
            href: /thingpark/smp/rest/subscribers/99906959/helpers/customFieldSets/88
            name: Wireless Subscriber
          nullable: true
        extID:
          type: string
          description: External subscriber ID
          example: "1234"
          nullable: true
        index1:
          type: string
          description: Free index
          example: ""
          nullable: true
        index2:
          type: string
          description: Free index
          example: ""
          nullable: true
        index3:
          type: string
          description: Free index
          example: ""
          nullable: true
        language:
          type: string
          description: Language tag (RFC2616)
          example: en-US
        marketplaceUrl:
          type: string
          description: Marketplace URL
          readOnly: true
          example: https://market.thingpark.com
          nullable: true
        name:
          type: string
          description: Subscriber name
          example: John Doe
        nextChargingDate:
          type: string
          format: date
          deprecated: true
          description: >
            Next charging date.


            This property must no longer be used: the associated feature is no more available in the product.
          readOnly: true
          nullable: true
        occContext:
          $ref: "#/components/schemas/OccContext"
        organization:
          type: string
          description: Subscriber organization
          example: ACME
          nullable: true
        profileID:
          type: string
          description: ID of the Subscriber Profile
          readOnly: true
          example: TPK/SUBS
        type:
          enum:
            - PRODUCTION
            - TEST
          type: string
          description: Account type
          readOnly: true
        vatNumber:
          type: string
          deprecated: true
          description: >
            VAT number


            This property must no longer be used: the associated feature is no more available in the product.
          example: FR12345678901
          nullable: true
    User:
      type: object
      required:
        - firstName
        - lastName
        - email
        - thingparkID
        - ctxHref
        - state
        - userState
        - federatedIdentities
      properties:
        apiOnly:
          type: boolean
          deprecated: true
          description: >
            `true` if the user account is specifically designed to be used by an
            application.

            `apiOnly` user accounts are not subject to password expiration.


            This property must no longer be used: service accounts must be used

            to access the API.
          example: false
          default: false
          nullable: true
        ctxHref:
          type: string
          description: User HREF in Subscriber context
          example: /thingpark/smp/rest/subscribers/103/users/112
          readOnly: true
        domainRestrictions:
          $ref: "#/components/schemas/DomainRestrictions"
        email:
          type: string
          example: john.doe@example.com
        facebookID:
          type: string
          deprecated: true
          description: >
            Facebook end user ID


            This property must no longer be used: the associated feature is no more available in the product.
          nullable: true
        federatedIdentities:
          readOnly: true
          type: array
          items:
            type: object
            properties:
              identityProvider:
                type: string
                description: Identifier of the identity provider
                example: acme
                nullable: true
              userId:
                type: string
                description: User identifier provided by the identity provider
                example: acme|60deb3e13aa25c006ac97629
                nullable: true
        firstName:
          type: string
          example: John
        googleID:
          type: string
          deprecated: true
          description: >
            Google end user ID


            This property must no longer be used: the associated feature is no more available in the product.
          nullable: true
        groupIDs:
          type: array
          items:
            type: string
          example:
            - actility-sup/device-manager
            - actility-sup/network-manager
            - ADMINS
          nullable: true
        homePhone:
          type: string
          example: "+3312346789"
          nullable: true
        language:
          type: string
          description: User's language
          example: en-US
          nullable: true
        lastConnection:
          readOnly: true
          description: Date of the last connection, epoch time in milliseconds
          type: integer
          format: int64
          example: 1577836800000
          nullable: true
        lastName:
          type: string
          example: Doe
        mobilePhone:
          type: string
          example: "+3362346789"
          nullable: true
        officePhone:
          type: string
          example: "+3312346789"
          nullable: true
        password:
          x-updateForbidden: true
          type: string
          writeOnly: true
          example: K;EEPSj-Z4<q2eBY
          nullable: true
        state:
          enum:
            - PENDING
            - ACCEPTED
          type: string
          description: State of the relation between the Subscriber and the User
          readOnly: true
          example: ACCEPTED
        thingparkID:
          type: string
          description: ThingPark end user ID
          readOnly: true
          example: tpk-100000007
        userState:
          enum:
            - PENDING
            - ACCEPTED
            - LOCKED
          type: string
          description: State of the User
          readOnly: true
          example: ACCEPTED
    Groups:
      type: object
      readOnly: true
      required:
        - briefs
      properties:
        briefs:
          type: object
          properties:
            brief:
              type: array
              items:
                type: object
                required:
                  - ID
                  - name
                properties:
                  ID:
                    type: string
                    example: ADMINS
                  name:
                    type: string
                    example: Administrators
                  description:
                    type: string
                    nullable: true
              example:
                - ID: actility-sup/device-manager
                  name: Device Manager
                - ID: actility-sup/network-manager
                  name: Network Manager
                - ID: ADMINS
                  name: Administrators
              nullable: true
    Users:
      type: object
      readOnly: true
      required:
        - briefs
        - more
      properties:
        briefs:
          type: object
          properties:
            brief:
              type: array
              items:
                type: object
                required:
                  - firstName
                  - lastName
                  - ID
                  - email
                  - state
                  - userState
                  - href
                  - ctxHref
                  - groupIDs
                  - federatedIdentities
                properties:
                  apiOnly:
                    type: boolean
                    deprecated: true
                    description: >
                      `true` if the user account is specifically designed to be
                      used by an application.


                      This property must no longer be used: service accounts must be used

                      to access the API.
                    example: false
                    nullable: true
                  ID:
                    type: string
                    description: ThingPark ID
                    example: tpk-100000007
                  ctxHref:
                    type: string
                    description: User HREF in Subscriber context
                    example: /thingpark/smp/rest/subscribers/103/users/112
                  domainRestrictions:
                    $ref: "#/components/schemas/DomainRestrictions"
                  email:
                    type: string
                    example: john.doe@example.com
                  federatedIdentities:
                    readOnly: true
                    type: array
                    items:
                      type: object
                      properties:
                        identityProvider:
                          type: string
                          description: Identifier of the identity provider
                          example: acme
                          nullable: true
                        userId:
                          type: string
                          description: User identifier provided by the identity provider
                          example: acme|60deb3e13aa25c006ac97629
                          nullable: true
                  firstName:
                    type: string
                    example: John
                  groupIDs:
                    type: array
                    description: Group IDs
                    items:
                      type: string
                    example:
                      - actility-sup/device-manager
                      - actility-sup/network-manager
                      - ADMINS
                  homePhone:
                    type: string
                    description: Only showed when the state is ACCEPTED
                    example: "+3312346789"
                    nullable: true
                  href:
                    type: string
                    example: /thingpark/smp/rest/users/112
                  lastConnection:
                    description: Date of the last connection, epoch time in milliseconds
                    type: integer
                    format: int64
                    example: 1577836800000
                    nullable: true
                  lastName:
                    type: string
                    example: Doe
                  mobilePhone:
                    type: string
                    description: Only showed when the state is ACCEPTED
                    example: "+3362346789"
                    nullable: true
                  officePhone:
                    type: string
                    description: Only showed when the state is ACCEPTED
                    example: "+3312346789"
                    nullable: true
                  organization:
                    type: string
                    example: Acme
                    nullable: true
                  state:
                    enum:
                      - PENDING
                      - ACCEPTED
                    type: string
                    description: State of the relation between the Subscriber and the User
                    example: ACCEPTED
                  userState:
                    enum:
                      - PENDING
                      - ACCEPTED
                      - LOCKED
                    type: string
                    description: State of the User
                    example: ACCEPTED
              nullable: true
        more:
          $ref: "#/components/schemas/More"
    More:
      type: boolean
      description: TRUE when more briefs can be retrieved with an upper page index.
      readOnly: true
    EnumApplicationState:
      type: string
      enum:
        - INIT
        - TRYING
        - VALIDATED
        - PROCESSING
        - ACTIVE
        - ACTIVE/SUSPENDING
        - ACTIVE/SUSPENDED
        - ACTIVE/RESUMING
        - DEACTIVATING
        - DEACTIVATED
        - ABORTING
        - ABORTED
  responses:
    ApplicationsSubscriber:
      description: Successful UPDATE or RETRIEVE
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/ApplicationsSubscriber"
    Delete:
      description: Successful DELETE
    Domain:
      description: Successful CREATE, UPDATE or RETRIEVE
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Domain"
    DomainGroup:
      description: Successful CREATE, UPDATE or RETRIEVE
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/DomainGroup"
    DomainGroups:
      description: Successful RETRIEVE
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/DomainGroups"
    Domains:
      description: Successful RETRIEVE
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Domains"
    DomainSuggestions:
      description: Successful RETRIEVE
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/DomainSuggestions"
    Error:
      description: Unexpected error
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Error"
    PasswordPolicy:
      description: Successful UPDATE or RETRIEVE
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/PasswordPolicy"
    Subscriber:
      description: Successful UPDATE or RETRIEVE
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Subscriber"
    User:
      description: Successful CREATE
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/User"
    UserGroups:
      description: Successful RETRIEVE
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Groups"
    Users:
      description: Successful UPDATE or RETRIEVE
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Users"
  parameters:
    CustomFields:
      name: customFields
      in: query
      description: |
        Return custom fields. When this query parameter is not specified in
        the request, custom fields are not returned.
      schema:
        type: boolean
    Domain:
      name: domainUid
      in: path
      description: Uid of Domain
      required: true
      schema:
        type: integer
        format: int32
    DomainGroup:
      name: domainGroupUid
      in: path
      description: Uid of Domain Group
      required: true
      schema:
        type: integer
        format: int32
    Language-tag:
      name: language-tag
      in: query
      description: >
        Returns items by using the language-tag.


        When this query parameter is not specified in the request or when requested language is not

        available, items are returned by using the default language of the

        System Provider.
      schema:
        type: string
    PageIndex:
      name: pageIndex
      in: query
      description: Returns the requested page index.
      schema:
        type: integer
        format: int32
    ServiceAccountId:
      name: serviceAccountId
      in: path
      required: true
      schema:
        type: string
        example: 00e320a0-c518-42f4-9899-48e0c041fb56
    User:
      name: userUid
      in: path
      description: >
        Unique identifier of the end-user, either

        * the string 'me' to reference the authenticated end-user requesting the API

        * the sequential integer (`UID`) assigned to the end-user at creation
      required: true
      examples:
        uid:
          summary: UID
          value: "123"
        me:
          summary: The authenticated end-user
          value: me
      schema:
        type: string
    ApplicationState:
      name: state
      in: query
      description: |
        Returns applications matching the state. Multiple state query
        parameters can be encoded in the URI. By default, all applications
        are returned.
      schema:
        type: array
        items:
          $ref: "#/components/schemas/EnumApplicationState"
      style: form
      explode: true
  examples: {}
  requestBodies:
    Domain:
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Domain"
      required: true
    DomainGroup:
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/DomainGroup"
      required: true
    User:
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/User"
      required: true
  headers: {}
  securitySchemes:
    Subscriber_service_account:
      type: oauth2
      description: Authenticate using subscriber service account credentials
      flows:
        clientCredentials:
          tokenUrl: /users-auth/protocol/openid-connect/token
          scopes: {}
  links: {}
  callbacks: {}
security:
  - Subscriber_service_account: []
tags:
  - name: domains
    description: Domains
  - name: products
    description: Products
  - name: service-accounts
    description: Service Accounts
  - name: subscribers
    description: Subscribers
  - name: users
    description: Users
