IRONSCALES Mailboxes API

The Mailboxes API from IRONSCALES — 3 operation(s) for mailboxes.

OpenAPI Specification

ironscales-mailboxes-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: IRONSCALES Management Mailboxes API
  description: The Mailboxes operations of the IRONSCALES Management API, split by tag from the provider-published Swagger 2.0 document at https://appapi.ironscales.com/appapi/docs/?format=openapi. Operations, parameters, responses and definitions are carried verbatim from the source specification.
  version: v1
servers:
- url: https://appapi.ironscales.com/appapi
security:
- JWT: []
tags:
- name: Mailboxes
paths:
  /mailboxes/{company_id}/compliance-report/:
    parameters:
    - name: company_id
      in: path
      required: true
      schema:
        type: string
    get:
      operationId: Get compliance report
      description: 'Compliance report for a company per user

        <br/><b>Scopes:</b>

        <ul>

        <li>partner.all</li>

        <li>company.all</li>

        <li>partner.company.view</li>

        <li>company.view</li>

        </ul>'
      parameters:
      - name: period
        in: query
        description: "\nPeriod to filter the campaigns by:\n<ul>\n    <li>1 - Last 7 days</li>\n    <li>2 - Last year</li>\n    <li>3 - Last 3 month</li>\n    <li>4 - Last 6 month</li>\n    <li>5 - Custom range (up to 180d) - MM-DD-YYYY - MM-DD-YYYY</li>\n</ul>\n"
        required: false
        schema:
          type: integer
          enum:
          - 1
          - 2
          - 3
          - 4
          - 5
          default: 3
      - name: customPeriodFrom
        in: query
        description: Start date of the custom period in MM-DD-YYYY format
        required: false
        schema:
          type: string
          format: date
      - name: customPeriodTo
        in: query
        description: End date of the custom period in MM-DD-YYYY format
        required: false
        schema:
          type: string
          format: date
      - name: page
        in: query
        description: Page number
        required: false
        schema:
          type: integer
          default: 1
      responses:
        '200':
          description: Successfully Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MailboxesUserComplianceReportResponse'
      tags:
      - Mailboxes
  /mailboxes/{company_id}/list/:
    parameters:
    - name: company_id
      in: path
      required: true
      schema:
        type: string
    get:
      operationId: List of a company mailboxes
      description: 'List of a company mailboxes

        <br/><b>Scopes:</b>

        <ul>

        <li>partner.all</li>

        <li>company.all</li>

        <li>partner.company.view</li>

        <li>company.view</li>

        </ul>


        All filters with string values are case-insensitive'
      parameters:
      - name: ids
        in: query
        description: List of mailbox ids
        required: false
        schema:
          type: array
          items:
            type: integer
      - name: exclude_ids
        in: query
        description: List of mailbox ids to exclude
        required: false
        schema:
          type: array
          items:
            type: integer
      - name: search
        in: query
        description: Search term to look for in first_name, last_name, title, department, email or phone_number fields
        required: false
        schema:
          type: string
      - name: is_enabled
        in: query
        required: false
        schema:
          type: boolean
      - name: tags
        in: query
        description: Array of tag names
        required: false
        schema:
          type: array
          items:
            type: string
            minLength: 1
      - name: first_name
        in: query
        required: false
        schema:
          type: string
      - name: last_name
        in: query
        required: false
        schema:
          type: string
      - name: department
        in: query
        required: false
        schema:
          type: string
      - name: email
        in: query
        required: false
        schema:
          type: string
      - name: title
        in: query
        required: false
        schema:
          type: string
      - name: is_protected
        in: query
        required: false
        schema:
          type: boolean
      - name: language
        in: query
        description: Language full name
        required: false
        schema:
          type: string
      - name: awareness
        in: query
        description: 0 - Beginner Level, 1 - Mid Level, 2 - Expert Level
        required: false
        schema:
          type: array
          items:
            type: integer
            maximum: 2
            minimum: 0
      - name: sort
        in: query
        required: false
        schema:
          type: string
          enum:
          - id
          - title
          - department
          - first_name
          - last_name
          - email
          - awareness
          - is_enabled
          - language
          - is_protected
          default: id
      - name: order
        in: query
        required: false
        schema:
          type: string
          enum:
          - asc
          - desc
          default: asc
      - name: page
        in: query
        description: Page Number
        required: false
        schema:
          type: integer
          default: 1
      - name: items_per_page
        in: query
        description: Number of items per page (optional, overrides default)
        required: false
        schema:
          type: integer
          default: 100
          minimum: 1
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MailboxesPageDetails'
        '400':
          description: Error explanation in error_message
          content:
            application/json:
              example:
                error_message: explanation
        '404':
          description: Company was not found or page out of range
        '403':
          description: No permissions
      tags:
      - Mailboxes
    put:
      operationId: Bulk edit of a company mailboxes
      description: 'List of a company mailboxes

        <br/><b>Scopes:</b>

        <ul>

        <li>partner.all</li>

        <li>company.all</li>

        <li>partner.company.edit</li>

        <li>company.edit</li>

        </ul>


        Tags manipulation - both adding and deletion - is performed asynchronously by background task.

        The result of these operations may be not available immediately after getting a response.'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MailboxesUpdateResponse'
        '400':
          description: Error explanation in error_message
          content:
            application/json:
              example:
                error_message: explanation
        '404':
          description: Company was not found or page out of range
        '403':
          description: No permissions
      tags:
      - Mailboxes
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MailboxUpdateRequest'
        required: true
  /mailboxes/{company_id}/user-campaigns-performance/:
    parameters:
    - name: company_id
      in: path
      required: true
      schema:
        type: string
    get:
      operationId: Get user campaign performance
      description: '

        List of a company users performances per campaign

        <br/><b>Scopes:</b>

        <ul>

        <li>partner.all</li>

        <li>company.all</li>

        <li>partner.company.view</li>

        <li>company.view</li>

        </ul>

        '
      parameters:
      - name: period
        in: query
        description: "\nPeriod to filter the campaigns by:\n<ul>\n    <li>1 - Last 7 days</li>\n    <li>2 - Last year</li>\n    <li>3 - Last 3 month</li>\n    <li>4 - Last 6 month</li>\n    <li>5 - Custom range (up to 180d) - MM-DD-YYYY - MM-DD-YYYY</li>\n</ul>\n"
        required: false
        schema:
          type: integer
          enum:
          - 1
          - 2
          - 3
          - 4
          - 5
          default: 3
      - name: customPeriodFrom
        in: query
        description: Start date of the custom period in MM-DD-YYYY format
        required: false
        schema:
          type: string
          format: date
      - name: customPeriodTo
        in: query
        description: End date of the custom period in MM-DD-YYYY format
        required: false
        schema:
          type: string
          format: date
      - name: page
        in: query
        description: Page number
        required: false
        schema:
          type: integer
          default: 1
      - name: country
        in: query
        description: Country name to filter the users by
        required: false
        schema:
          type: string
      - name: department
        in: query
        description: Department name to filter the users by
        required: false
        schema:
          type: string
      - name: campaignType
        in: query
        description: "\nType of the campaign:\n<ul>\n    <li>1 - Simulation</li>\n    <li>2 - Training</li>\n    <li>3 - Spear Phishing</li>\n</ul>\n"
        required: false
        style: form
        explode: true
        schema:
          type: array
          items:
            type: integer
            enum:
            - 1
            - 2
            - 3
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MailboxesUserPerformanceResponse'
        '400':
          description: Error explanation in error_message
          content:
            application/json:
              example:
                error_message: explanation
        '404':
          description: Company was not found or page out of range
        '403':
          description: No permissions
      tags:
      - Mailboxes
components:
  schemas:
    MailboxFilter:
      type: object
      properties:
        ids:
          type: array
          items:
            type: integer
        exclude_ids:
          type: array
          items:
            type: integer
        search:
          title: Search
          type: string
          minLength: 1
        is_enabled:
          title: Is enabled
          type:
          - boolean
          - 'null'
        tags:
          type: array
          items:
            type: string
            minLength: 1
    MailboxesUpdateResponse:
      required:
      - mailbox_ids
      - error_message
      type: object
      properties:
        mailbox_ids:
          description: IDs of mailboxes that matched the filters
          type: array
          items:
            type: integer
        error_message:
          title: Error message
          description: Error description if any of mailboxes wasn't updated
          type: string
          minLength: 1
    MailboxesUserComplianceReport:
      required:
      - firstName
      - email
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        firstName:
          title: First name
          type: string
          maxLength: 40
          minLength: 1
        lastName:
          title: Last name
          type:
          - string
          - 'null'
          maxLength: 40
        country:
          title: Country
          type:
          - string
          - 'null'
          maxLength: 100
        department:
          title: Department
          type:
          - string
          - 'null'
          maxLength: 100
        title:
          title: Title
          type:
          - string
          - 'null'
          maxLength: 250
        email:
          title: Email
          type: string
          format: email
          maxLength: 254
          minLength: 1
        language:
          title: Language
          type: string
          readOnly: true
        simulationCampaignsCompletionsCount:
          title: Simulation campaigns completions count
          type: integer
          readOnly: true
        lastSimulationCampaignDate:
          title: Last simulation campaign date
          description: date-time format %b %d, %Y %H:%M
          type:
          - string
          - 'null'
          format: date-time
          readOnly: true
        trainingCampaignsCompletionsCount:
          title: Training campaigns completions count
          type: integer
          readOnly: true
        lastTrainingCampaignDate:
          title: Last training campaign date
          description: date-time format %b %d, %Y %H:%M
          type:
          - string
          - 'null'
          format: date-time
          readOnly: true
        riskLevel:
          title: Risk level
          type: string
          enum:
          - Low
          - Medium
          - High
          readOnly: true
        awarenessLevel:
          title: Awareness level
          type: string
          enum:
          - Beginner Level
          - Mid Level
          - Expert Level
          readOnly: true
    MailboxesUserPerformanceResponse:
      required:
      - page
      - total_pages
      - data
      type: object
      properties:
        page:
          title: Page
          type: integer
        total_pages:
          title: Total pages
          type: integer
        data:
          type: array
          items:
            $ref: '#/components/schemas/MailboxesUserPerformance'
    MailboxesUserPerformance:
      required:
      - userId
      - firstName
      - lastName
      - country
      - department
      - title
      - email
      - campaignId
      - campaignName
      - campaignCollectingEndDate
      type: object
      properties:
        id:
          title: ID
          type: integer
          readOnly: true
        userId:
          title: Userid
          type: integer
        firstName:
          title: First name
          type: string
          minLength: 1
        lastName:
          title: Last name
          type: string
          minLength: 1
        country:
          title: Country
          type: string
          minLength: 1
        department:
          title: Department
          type: string
          minLength: 1
        title:
          title: Title
          type: string
          minLength: 1
        email:
          title: Email
          type: string
          minLength: 1
        campaignId:
          title: Campaign id
          type: integer
        campaignName:
          title: Campaign name
          type: string
          minLength: 1
        campaignType:
          title: Campaign type
          type: string
          enum:
          - Training
          - Simulation
          - Spear Phishing
          - Agentic
          readOnly: true
        campaignSimulationResult:
          title: Campaign simulation result
          type:
          - string
          - 'null'
          enum:
          - Reported
          - Clicked
          - Entered Details
          - Opened
          - Unopened
          - Not delivered
          - N/A
          readOnly: true
        campaignTrainingStatus:
          title: Campaign training status
          type:
          - string
          - 'null'
          enum:
          - Postponed
          - Manually trained
          - 'Yes'
          - 'No'
          - Started, not completed
          - Not started
          - N/A
          - Scheduled to send
          readOnly: true
        campaignTrainingName:
          title: Campaign training name
          type:
          - string
          - 'null'
          readOnly: true
          minLength: 1
        campaignCollectingEndDate:
          title: Collecting end date (UTC)
          description: date-time format %b %d, %Y %H:%M
          type: string
          format: date-time
        campaignScore:
          title: Campaign score
          type:
          - integer
          - 'null'
          readOnly: true
          maximum: 100
          minimum: 0
        campaignLocale:
          title: Campaign locale
          type: string
          readOnly: true
        campaignTemplateName:
          title: Campaign template name
          type:
          - string
          - 'null'
          readOnly: true
          minLength: 1
    MailboxesDetails:
      required:
      - id
      - firstName
      - lastName
      - title
      - department
      - email
      - phoneNumber
      - tags
      - language
      - riskLevel
      - awarenessLevel
      - protected
      - unprotectedReason
      type: object
      properties:
        id:
          title: Id
          type: integer
        firstName:
          title: Firstname
          type:
          - string
          - 'null'
          minLength: 1
        lastName:
          title: Lastname
          type:
          - string
          - 'null'
          minLength: 1
        title:
          title: Title
          type:
          - string
          - 'null'
          minLength: 1
        department:
          title: Department
          type:
          - string
          - 'null'
          minLength: 1
        email:
          title: Email
          type: string
          minLength: 1
        phoneNumber:
          title: Phonenumber
          type:
          - string
          - 'null'
          minLength: 1
        tags:
          type:
          - array
          - 'null'
          items:
            type: string
            minLength: 1
        language:
          title: Language
          type:
          - string
          - 'null'
          minLength: 1
        enabled:
          title: Enabled
          type: boolean
        riskLevel:
          title: Risklevel
          type:
          - string
          - 'null'
          minLength: 1
        awarenessLevel:
          title: Awarenesslevel
          type:
          - string
          - 'null'
          minLength: 1
        protected:
          title: Protected
          type:
          - boolean
          - 'null'
        unprotectedReason:
          title: Unprotectedreason
          type:
          - string
          - 'null'
          minLength: 1
    MailboxUpdateRequest:
      required:
      - params
      type: object
      properties:
        filters:
          $ref: '#/components/schemas/MailboxFilter'
        params:
          $ref: '#/components/schemas/MailboxUpdateParams'
    MailboxUpdateParams:
      type: object
      properties:
        is_enabled:
          title: Is enabled
          type: boolean
        add_tags:
          type: array
          items:
            type: string
            minLength: 1
        remove_tags:
          type: array
          items:
            type: string
            minLength: 1
    MailboxesPageDetails:
      required:
      - page
      - total_pages
      - total_count
      - mailboxes
      type: object
      properties:
        page:
          title: Page
          type: integer
        total_pages:
          title: Total pages
          type: integer
        total_count:
          title: Total count
          type: integer
        mailboxes:
          type: array
          items:
            $ref: '#/components/schemas/MailboxesDetails'
    MailboxesUserComplianceReportResponse:
      required:
      - page
      - total_pages
      - data
      type: object
      properties:
        page:
          title: Page
          type: integer
        total_pages:
          title: Total pages
          type: integer
        data:
          type: array
          items:
            $ref: '#/components/schemas/MailboxesUserComplianceReport'
  securitySchemes:
    JWT:
      type: apiKey
      name: Authorization
      in: header