openapi: 3.1.0
info:
  title: Tenant V3 APIs
  description: >-
    The Tenant APIs provided by Annex Cloud allow developers to manage
    user-related operations with ease. With these APIs, you can perform various
    actions such as creating and updating user information, fetching user
    profiles, and generating JWT tokens for secure API interactions.

    Key Features of Tenant APIs are


    User Management- Create, update, and retrieve user information seamlessly.


    Profile Access- Fetch detailed user profile information.


    JWT Token Generation- Secure your API requests by generating JWT tokens.


    Methods for Using Tenant APIs-


    One-step Method- In the one-step method, the token is generated and executed
    against the payload in a single operation. This approach simplifies the
    process by combining token generation and API execution in one step.


    Two-step Method-The two-step method provides more control by requiring token
    generation for each API method separately. After generating the token, it
    must be replaced by the user for every API call. Each token can be used only
    once. Attempting to reuse a token will result in an "Expired token" error.


    These methods offer flexibility depending on your security and operational
    needs, ensuring that your interactions with the Annex Cloud platform are
    both secure and efficient.
  version: 3.0.1
servers:
  - url: https://api.socialannex.com/3.0/tenant/
paths:
  /getsiteid:
    get:
      tags:
        - Tenant
      summary: Fetch the Site Information
      description: This API is used to fetch the site Information.
      operationId: getsitedetailsTenant
      parameters:
        - name: company_name
          in: path
          description: Enter the name of the site that you want to fetch the ID.
          example: socialannextestsite
          required: true
          schema:
            type: string
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/getsiteidresp'
            application/xml:
              schema:
                $ref: '#/components/schemas/getsiteidresp'
        '201':
          description: successful operation
        '400':
          description: AC1004 No Access Token Provided | AC1003 Expired token
  /getinfo:
    get:
      tags:
        - Tenant
      summary: Fetch the profile information of the users of a particular site
      description: >-
        This API is used to fetch the profile information of the users against
        the site ID.
      operationId: getInformationTenant
      parameters:
        - name: site_id
          in: path
          description: Enter the site ID to fetch the site information.
          example: '999133'
          required: true
          schema:
            type: string
        - name: page_no
          in: path
          description: Enter the page number you want to view.
          example: 1
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/getinforesp'
            application/xml:
              schema:
                $ref: '#/components/schemas/getinforesp'
        '201':
          description: successful operation
        '400':
          description: AC1004 No Access Token Provided | AC1003 Expired token
  /getprofile:
    get:
      tags:
        - Tenant
      summary: Fetch the user's profile information
      description: This API is used to fetch a user's profile information.
      operationId: getprofileTenant
      parameters:
        - name: profile_email_id
          in: path
          description: >-
            Enter the email address of the user you want to fetch information
            for.
          example: user@domain.com
          required: true
          schema:
            type: string
        - name: page_no
          in: path
          description: Enter the page number you want to view.
          example: 1
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/getprofileresp'
            application/xml:
              schema:
                $ref: '#/components/schemas/getprofileresp'
        '201':
          description: successful operation
        '400':
          description: AC1004 No Access Token Provided | AC1003 Expired token
  /getroledetail:
    get:
      tags:
        - Tenant
      summary: Fetch the user's profile information
      description: This API is used to fetch a user's profile information.
      operationId: getRoleDetailTenant
      parameters:
        - name: profileid
          in: path
          description: Enter the email address of the user.
          example: user@domain.com
          required: true
          schema:
            type: string
        - name: roleName
          in: path
          description: Enter the name of the user’s role.
          example: admin
          required: true
          schema:
            type: string
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/getroledetailresp'
            application/xml:
              schema:
                $ref: '#/components/schemas/getroledetailresp'
        '201':
          description: successful operation
        '400':
          description: AC1004 No Access Token Provided | AC1003 Expired token
  /create:
    put:
      tags:
        - Tenant
      summary: Create the user
      description: >-
        This API is used to create the user. The users created by this API are
        shown in the users list in the Users tab in the Annex Cloud ADR.
      operationId: putCreateTenant
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                site_id:
                  description: >-
                    Enter the site ID for the site the user will be added to.
                    You can enter more than one site ID separated by a comma.
                  example: 999133,849976,996755
                  type: string
                profileId:
                  description: Enter the email address of the user.
                  example: user@domain.com
                  type: string
                fullName:
                  description: Enter the full name of the user.
                  example: Rahul
                  type: string
                roleName:
                  description: Enter the name of the user's role.
                  example: admin
                  type: string
                userType:
                  description: Enter the user type as 0 (internal), 1 (customer), 2 (SSO).
                  example: 1
                  type: integer
              required:
                - site_id
                - profileId
                - fullName
                - roleName
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/putcreateresp'
            application/xml:
              schema:
                $ref: '#/components/schemas/putcreateresp'
        '201':
          description: successful operation
        '400':
          description: AC1004 No Access Token Provided | AC1003 Expired token
  /update:
    put:
      tags:
        - Tenant
      summary: Update the user's information
      description: This API is used to update the information of the user.
      operationId: putUpdateTenant
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                site_id:
                  description: >-
                    Enter the site ID where you'd like to update the user
                    information.
                  example: '999133'
                  type: string
                profileId:
                  description: Enter the email address of the user.
                  example: user@domain.com
                  type: string
                fullName:
                  description: Enter the full name of the user.
                  example: Rahul
                  type: string
                roleName:
                  description: Enter the name of the user's role.
                  example: admin
                  type: string
                userType:
                  description: Enter the user type as 0 (internal), 1 (customer), 2 (SSO).
                  example: 1
                  type: integer
              required:
                - site_id
                - profileId
                - fullName
                - roleName
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/putupdateresp'
            application/xml:
              schema:
                $ref: '#/components/schemas/putupdateresp'
        '201':
          description: successful operation
        '400':
          description: AC1004 No Access Token Provided | AC1003 Expired token
  /gettoken:
    get:
      tags:
        - Tenant
      summary: Generate the JWT token
      description: >-
        This API is used to generate the JWT token against the payload. The
        payloads are different for each method. For each method, a token has to
        be generated whenever you call the API in a two-step method.
      operationId: getTokenTenant
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                Payload to get the token for Site ID information:
                  type: object
                  properties:
                    company_name:
                      description: >-
                        Enter the name of the site that you want to fetch the
                        ID.
                      example: socialannextestsite
                      type: integer
                Payload to get the token for user's information:
                  type: object
                  properties:
                    site_id:
                      description: Enter the site ID to fetch the site information.
                      example: '999133'
                      type: string
                    page_no:
                      description: Enter the page number you want to view.
                      example: 1
                      type: integer
                Payload to get the token for the user’s profile information:
                  type: object
                  properties:
                    profile_email_id:
                      description: Enter the email address of the user you want to fetch.
                      example: user@domain.com
                      type: string
                    page_no:
                      description: Enter the page number you want to view.
                      example: 1
                      type: integer
                Payload to get the token for the information of the user:
                  type: object
                  properties:
                    site_id:
                      description: >-
                        Enter the site ID for the site the user will be added
                        to. You can enter more than one site ID separated by a
                        comma.
                      example: 999133,849976,996755
                      type: string
                    profileId:
                      description: Enter the email address of the user.
                      example: user@domain.com
                      type: string
                    fullName:
                      description: Enter the full name of the user.
                      example: Rahul S
                      type: string
                    roleName:
                      description: Enter the name of the user’s role.
                      example: admin
                      type: string
                    userType:
                      description: >-
                        Enter the user type as 0 (internal), 1 (customer), 2
                        (SSO).
                      example: 0
                      type: integer
                Payload to get the token for the updated information of the user:
                  type: object
                  properties:
                    site_id:
                      description: Enter the site ID to fetch the site information.
                      example: '999133'
                      type: string
                    profileId:
                      description: Enter the email address of the user.
                      example: user@domain.com
                      type: string
                    fullName:
                      description: Enter the full name of the user.
                      example: Rahul S
                      type: string
                    roleName:
                      description: Enter the name of the user’s role.
                      example: admin
                      type: string
                    userType:
                      description: >-
                        Enter the user type as 0 (internal), 1 (customer), 2
                        (SSO).
                      example: 0
                      type: integer
                    status:
                      description: >-
                        Enter 1 if the user's status is Active and 0 if the
                        user’s status is Inactive.
                      example: 0
                      type: integer
              required:
                - company_name
                - site_id
                - page_no
                - profile_email_id
                - page_no
                - profileId
                - fullName
                - roleName
                - status
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/gettokenresp'
            application/xml:
              schema:
                $ref: '#/components/schemas/gettokenresp'
        '201':
          description: successful operation
        '400':
          description: AC1004 No Access Token Provided | AC1003 Expired token
components:
  schemas:
    getsiteidresp:
      type: object
      properties:
        data:
          type: object
          description: Displays details for the following parameters
          properties:
            siteName:
              type: string
              description: Display the name of the site.
              example: Socialannextestsite
            siteId:
              type: integer
              description: Displays the site ID of the site that you have fetched.
              example: 9991331
            ssoEnabled:
              type: integer
              description: Displays 1 if SSO is enabled or 2 if SSO is not enabled.
              example: 1
    getinforesp:
      type: object
      properties:
        data:
          type: object
          description: Displays details for the following parameters
          properties:
            totalProfileCount:
              type: integer
              description: >-
                Displays the total number of profiles that exist on the site
                that you have fetched.
              example: 514
            totalProfilePageCount:
              type: integer
              description: Displays the total number of pages that exist in the response.
              example: 35
            profileInfo:
              type: object
              description: >-
                Displays the following details for the profiles that exist on
                the site for the fetched siteID.
              properties:
                siteId:
                  type: integer
                  description: Displays the site ID you have fetched.
                  example: 9991331
                profileId:
                  type: string
                  description: Displays the email address linked to the profile.
                  example: user@domain.com
                fullName:
                  type: string
                  description: Displays the full name of the user.
                  example: Junaid Alam
                roleName:
                  type: string
                  description: Displays the role of the user.
                  example: report
                nextUrl:
                  type: string
                  description: Displays the next page URL to fetch the profile information.
                  example: >-
                    https://api.socialannex.com/3.0/tenant/profiles/getinfo/9991331/4
    getprofileresp:
      type: object
      properties:
        data:
          type: object
          description: Displays details for the following parameters
          properties:
            totalProfileCount:
              type: integer
              description: >-
                Displays the total number of profiles that exist on the site
                that you have fetched.
              example: 514
            totalProfilePageCount:
              type: integer
              description: Displays the total number of pages that exist in the response.
              example: 35
            profileId:
              type: string
              description: Displays the email address attached to the user's profile.
              example: user@domain.com
            fullName:
              type: string
              description: Displays the full name of the user.
              example: Junaid Alam
            siteInfo:
              type: object
              description: Displays the following information about the user's profile
              properties:
                siteId:
                  type: integer
                  description: Displays the site ID you have fetched.
                  example: 9991331
                roleName:
                  type: string
                  description: Displays the role of the user.
                  example: admin
                userType:
                  type: integer
                  description: >-
                    Displays the user type as 0 (internal), 1 (customer), 2
                    (SSO).
                  example: 2
                creationDate:
                  type: string
                  description: >-
                    Displays the date when the user's profile was created. The
                    format of the date is "yyyy-MM-dd'T'HH:mm:ss Z".
                  example: 2020-10-30T05:30:00+0000
                updateDate:
                  type: string
                  description: >-
                    Displays the date when the user's profile was last updated.
                    The format of the date is "yyyy-MM-dd'T'HH:mm:ss Z".
                  example: 2020-10-30T05:30:00+0000
                status:
                  type: integer
                  description: >-
                    Displays 1 if the user's status is Active and displays 0 if
                    the user's status is Inactive.
                  example: 0
    getroledetailresp:
      type: object
      properties:
        data:
          type: object
          description: Displays details for the following parameters
          properties:
            roleId:
              type: string
              description: Displays the ID assigned to the role.
              example: '1'
            roleName:
              type: string
              description: Displays the name assigned role.
              example: superadministrator
            roleServices:
              type: string
              description: Displays the services available for the role.
              example: Manage Users, Manage Services, Manage options, Global Report
    putcreateresp:
      type: object
      properties:
        data:
          type: object
          description: Displays details for the following parameters
          properties:
            '9991331':
              type: object
              description: >-
                Displays the site ID as a parameter. If multiple Site IDs are
                provided in the site_id parameter in the request, then each site
                ID is shown as a different object to differentiate the multiple
                site IDs.
              properties:
                profileId:
                  type: string
                  description: Displays the email address of the user.
                  example: user@domain.com
                fullName:
                  type: string
                  description: Displays the full name of the user.
                  example: Rahul s
                roleName:
                  type: string
                  description: Displays the role the user has been assigned.
                  example: admin
                description:
                  type: string
                  description: >-
                    Displays the message 'user created successfully' if the user
                    is created.
                  example: user created successfully.
    putupdateresp:
      type: object
      properties:
        data:
          type: object
          description: Displays details for the following parameters
          properties:
            '9991331':
              type: object
              description: >-
                Displays the site ID as a parameter. If multiple Site IDs are
                provided in the site_id parameter in the request, then each site
                ID is shown as a different object to differentiate the multiple
                site IDs.
              properties:
                profileId:
                  type: string
                  description: Displays the updated email address of the user.
                  example: user@domain.com
                fullName:
                  type: string
                  description: Displays the updated full name of the user.
                  example: anil kumar
                roleName:
                  type: string
                  description: Displays the updated role of the user.
                  example: admin
                description:
                  type: string
                  description: >-
                    Displays the message 'user updated successfully.' if the
                    user is updated.
                  example: user updated successfully.
    gettokenresp:
      type: object
      properties:
        data:
          type: object
          description: Displays details for the following parameters
          properties:
            bearerToken:
              type: string
              description: >-
                Displays the generated JWT token. Copy this token and paste it
                in the Authorization parameter of the headers section in the
                request.
              example: >-
                eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJBdXRob3JpemF0aW9uVG9rZW4iLCJleHAiOjE3MDkwMjM1NjgsInNpdGVfaWQiOiI5OTkxMzMxIiwiaG1hYyI6IndUbGFjVXphNTdZRFZ2b3pudmxYTXdid25HWmE1djJkQ1wvVVdrWnJIMklFPSJ9.fiUzfxjFm3InZ2xE4yn_SMlVPXv4aRTyLhkoiWLTPm0
tags:
  - name: Tenant
    description: >-
      Annex Cloud’s Tenant APIs enable seamless user management and secure API
      interactions. With these APIs, you can create, update, and retrieve user
      data, access user profiles, and generate one-time-use JWT tokens to
      protect your requests. Choose between a simple one-step method or a more
      controlled two-step process, depending on your security needs.
security:
  - MuseumPlaceholderAuth: []
