> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cimento.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Read one phishing campaign and its participants

> One campaign, as the only entry of `campaigns`, with how it is set up, the templates it sends and its report notification. `results` counts how all its participants did. `participants` is a page of the people it targets, which `query` and `simulationStatus` narrow: `failure` finds who fell for a simulation, `success` who reported it, and `pending` everyone else. The other list filters do not apply. Pages the participants with `limit` and `offset`: `totalCount` is how many participants match and `nextOffset`, while more remain, is the `offset` of the next page.



## OpenAPI

````yaml https://api.cimento.app/v1/openapi.json get /v1/phishing/campaigns/{campaignId}
openapi: 3.1.0
info:
  description: >-
    Read-only access to a Cimento tenant's phishing, training and AutoPhish
    data, for a customer's own systems.


    **Authentication.** Every route takes an OAuth 2.0 access token for an API
    service account, as `Authorization: Bearer <token>`. Create the account in
    Cimento under Integrations, API access, then exchange its client ID and
    secret for a token at the token URL with the client credentials grant. A
    token lasts an hour and carries the scopes the account was given; each route
    says which it needs.


    **Requests.** Every route is a `GET`. A parameter that takes a list takes
    its values separated by commas. A parameter the route does not have, or one
    given twice, is refused.


    **Paging.** Paging differs by route and each says which it uses. Most lists
    take `limit` and `offset` and answer with `totalCount` and, while more
    remain, `nextOffset`. Two AutoPhish lists take a `cursor` and answer with
    `nextCursor`, with no total.


    **Rate limit.** Each service account may make a short burst of requests and
    then about one a second. Past that the answer is `429` with a `Retry-After`
    header, in seconds.


    **Errors.** Every error has one shape,
    `{"error":{"code":"...","message":"..."}}`.
  title: Cimento Analytics API
  version: '1'
servers:
  - url: https://api.cimento.app
security: []
tags:
  - description: >-
      AutoPhish, the tenant's one continuous phishing program: its settings, its
      results and what people did with its simulations.
    name: autophish
  - description: >-
      Phishing campaigns: the figures across them, and the campaigns and
      templates those figures can be filtered by.
    name: phishing
  - description: Training campaigns and the courses they assign.
    name: training
paths:
  /v1/phishing/campaigns/{campaignId}:
    get:
      tags:
        - phishing
      summary: Read one phishing campaign and its participants
      description: >-
        One campaign, as the only entry of `campaigns`, with how it is set up,
        the templates it sends and its report notification. `results` counts how
        all its participants did. `participants` is a page of the people it
        targets, which `query` and `simulationStatus` narrow: `failure` finds
        who fell for a simulation, `success` who reported it, and `pending`
        everyone else. The other list filters do not apply. Pages the
        participants with `limit` and `offset`: `totalCount` is how many
        participants match and `nextOffset`, while more remain, is the `offset`
        of the next page.
      operationId: getPhishingCampaign
      parameters:
        - description: The campaign to read
          in: path
          name: campaignId
          required: true
          schema:
            format: uuid
            pattern: >-
              ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
            type: string
        - description: >-
            Words to find in campaign names or, when reading one campaign, in
            the first name, last name or email of a participant
          in: query
          name: query
          required: false
          schema:
            type: string
        - description: >-
            Only campaigns in this state, judged as the web app's filter judges
            it
          in: query
          name: status
          required: false
          schema:
            enum:
              - draft
              - scheduled
              - running
              - completed
              - cancelled
            type: string
        - description: Only campaigns sent this way
          in: query
          name: channel
          required: false
          schema:
            enum:
              - email
              - sms
              - phone_call
              - multi_channel
              - qr_code
              - instant_messaging
              - social_media
            type: string
        - description: >-
            Only campaigns whose scheduledStartDate is on or after this: a day,
            YYYY-MM-DD, or a date and time with its offset
          in: query
          name: startsFrom
          required: false
          schema:
            pattern: >-
              ^\d{4}-\d{2}-\d{2}(T\d{2}:\d{2}:\d{2}(\.\d+)?(Z|[+-]\d{2}:\d{2}))?$
            type: string
        - description: >-
            Only campaigns whose scheduledStartDate is before this, a day or a
            date and time as startsFrom takes. For a period that ends with a
            day, the day after it
          in: query
          name: startsBefore
          required: false
          schema:
            pattern: >-
              ^\d{4}-\d{2}-\d{2}(T\d{2}:\d{2}:\d{2}(\.\d+)?(Z|[+-]\d{2}:\d{2}))?$
            type: string
        - description: >-
            An IANA time zone, such as Europe/London, in which a day given to
            startsFrom or startsBefore begins. UTC without it
          in: query
          name: timeZone
          required: false
          schema:
            type: string
        - description: >-
            Only participants with this result. It applies when reading one
            campaign
          in: query
          name: simulationStatus
          required: false
          schema:
            enum:
              - pending
              - success
              - failure
            type: string
        - description: How many to return, up to 100. Defaults to 20
          in: query
          name: limit
          required: false
          schema:
            default: 20
            maximum: 100
            minimum: 1
            type: integer
        - description: 'How many to skip: the nextOffset of the previous page'
          in: query
          name: offset
          required: false
          schema:
            minimum: 0
            type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SearchPhishingCampaignsResult'
          description: What was asked for.
        '400':
          $ref: '#/components/responses/InvalidRequest'
        '401':
          $ref: '#/components/responses/InvalidToken'
        '403':
          $ref: '#/components/responses/InsufficientScope'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
        '503':
          $ref: '#/components/responses/Unavailable'
      security:
        - oauth2:
            - phishing_analytics:view_employee_data
            - phishing_campaigns:view
components:
  schemas:
    SearchPhishingCampaignsResult:
      additionalProperties: false
      properties:
        campaigns:
          items:
            additionalProperties: false
            properties:
              appUrl:
                description: Where the web app shows this campaign
                type: string
              audience:
                additionalProperties: false
                description: >-
                  Who it reaches. Absent while it has no audience, and on a
                  campaign that targets targetGroups and targetDepartments
                  instead
                properties:
                  departmentNames:
                    description: >-
                      With departments, the departments by name. With new_hires,
                      the departments the new hires must be in, when it names
                      any
                    items:
                      type: string
                    type:
                      - 'null'
                      - array
                  emails:
                    description: With specific_employees, their email addresses
                    items:
                      type: string
                    type:
                      - 'null'
                      - array
                  groupId:
                    description: With existing_group, the ID of the group
                    type: string
                  quickPath:
                    description: >-
                      Which of the web app's audience choices:
                      specific_employees, departments, existing_group,
                      all_employees, new_hires, repeated_offender, high_risk or
                      advanced
                    type: string
                  ruleSummary:
                    description: With advanced, the rule as the web app words it
                    type: string
                  threshold:
                    description: >-
                      With repeated_offender, how many phishing simulations
                      someone failed in the window, at least
                    type: integer
                  unit:
                    description: 'The window''s unit: days, weeks or months'
                    type: string
                  value:
                    description: >-
                      How many units back the window goes: with new_hires, since
                      someone was hired, and with repeated_offender, for the
                      failures counted
                    type: integer
                required:
                  - quickPath
                type:
                  - 'null'
                  - object
              autoEnrollEnabled:
                description: >-
                  Whether people who come to match the audience after launch are
                  enrolled
                type:
                  - 'null'
                  - boolean
              campaignId:
                type: string
              campaignName:
                type: string
              channel:
                type: string
              customerSendingDomainId:
                description: >-
                  The tenant's own sending domain its emails go out from, when
                  it uses one
                type: string
              deliveryMethod:
                description: >-
                  How that integration delivers, such as smtp or
                  google_workspace_dmi
                type: string
              description:
                type: string
              integrationId:
                description: The integration it sends through
                type: string
              lifecyclePolicy:
                additionalProperties: false
                description: >-
                  What it does when someone it enrolled stops matching the
                  audience
                properties:
                  onRejoinAfterRemoved:
                    description: re_enroll or skip someone removed who matches it again
                    type: string
                  onUserLeft:
                    description: remove or keep someone who stops matching the audience
                    type: string
                type:
                  - 'null'
                  - object
              notificationConfig:
                additionalProperties: false
                description: >-
                  The one-time report on its results that admins are sent.
                  Absent when none is set
                properties:
                  absoluteTime:
                    description: When it is sent
                    type: string
                  channel:
                    description: email or slack
                    type: string
                  enabled:
                    type: boolean
                  templateId:
                    description: The notification template it is written from
                    type: string
                required:
                  - enabled
                  - absoluteTime
                type:
                  - 'null'
                  - object
              recurrence:
                additionalProperties: false
                description: >-
                  Whether it runs once or sends again to whoever in its audience
                  it has not reached in the last value units. Absent, and
                  audience with it, for a service account: both need a scope
                  none can be given
                properties:
                  mode:
                    description: one_time or recurring
                    type: string
                  unit:
                    description: With recurring, days, weeks or months
                    type: string
                  value:
                    description: With recurring, how many units it goes by
                    type: integer
                required:
                  - mode
                type:
                  - 'null'
                  - object
              remediation:
                additionalProperties: false
                description: >-
                  The training campaign remediationTrainingCampaignId names: its
                  course and when it is due. Absent unless the token also holds
                  training_campaigns:view
                properties:
                  course:
                    additionalProperties: false
                    properties:
                      courseId:
                        type: string
                      courseName:
                        type: string
                    required:
                      - courseId
                      - courseName
                    type:
                      - 'null'
                      - object
                  dueAfterUnit:
                    description: days, weeks or months
                    type: string
                  dueAfterValue:
                    type: integer
                  dueAtTime:
                    description: >-
                      The time of day a relative due date falls on, in
                      dueAtTimezone
                    type: string
                  dueAtTimezone:
                    type: string
                  dueDateMode:
                    description: >-
                      fixed_date is due on scheduledEndDate, relative is due
                      dueAfterValue dueAfterUnit after each person is enrolled,
                      and evergreen is never due
                    type: string
                  notificationRules:
                    description: >-
                      The messages it sends by itself. Absent for a service
                      account, which cannot be given the scope they need
                    items:
                      additionalProperties: false
                      properties:
                        absoluteTime:
                          description: With timingType absolute, the moment it sends
                          type: string
                        assignmentStatus:
                          description: >-
                            Only the assigned people in these states, or their
                            managers: enrolled, in_progress, overdue or
                            completed. Absent for everyone
                          items:
                            type: string
                          type:
                            - 'null'
                            - array
                        channel:
                          description: email or slack
                          type: string
                        enabled:
                          description: >-
                            Whether it sends. One that is off is kept and sends
                            nothing
                          type: boolean
                        notificationConfigId:
                          type: string
                        offsetDays:
                          description: Days from relativeTo, negative for before it
                          type:
                            - 'null'
                            - integer
                        offsetHours:
                          description: Hours added to offsetDays
                          type: integer
                        recipientType:
                          description: >-
                            employee for the people assigned, manager for their
                            managers, or admin
                          type: string
                        recurrenceDaysOfWeek:
                          description: >-
                            The days one that repeats sends on, 0 for Sunday.
                            Absent for every day
                          items:
                            type: integer
                          type:
                            - 'null'
                            - array
                        recurrenceTimeOfDay:
                          description: On one that repeats, the time of day it sends, HH:MM
                          type: string
                        recurrenceTimezone:
                          description: >-
                            The zone recurrenceTimeOfDay is in for someone who
                            has none of their own
                          type: string
                        relativeTo:
                          description: >-
                            With timingType relative, what offsetDays counts
                            from: start_date, end_date or assignment_date
                          type: string
                        rule:
                          additionalProperties: false
                          description: >-
                            The rule as the rule builder on the campaign page
                            shows it
                          properties:
                            audiencePreset:
                              type: string
                            customTiming:
                              additionalProperties: false
                              properties:
                                offsetDays:
                                  description: How many days
                                  type: integer
                                offsetDirection:
                                  description: Whether that is before or after the date
                                  type: string
                                relativeTo:
                                  description: >-
                                    The date: start_date for the campaign's
                                    start, or end_date for the date the course
                                    is due
                                  type: string
                              required:
                                - offsetDays
                                - offsetDirection
                                - relativeTo
                              type:
                                - 'null'
                                - object
                            exact:
                              description: >-
                                False for a rule saved some other way than on
                                the campaign's page, which these choices
                                describe only roughly: it can be removed but not
                                edited
                              type: boolean
                            recurrenceDaysOfWeek:
                              items:
                                type: integer
                              type:
                                - 'null'
                                - array
                            recurrenceTimeOfDay:
                              type: string
                            timingPreset:
                              type: string
                          required:
                            - timingPreset
                            - audiencePreset
                            - exact
                          type:
                            - 'null'
                            - object
                        templateId:
                          description: >-
                            The notification template it sends. A rule without
                            one sends nothing
                          type: string
                        templateName:
                          type: string
                        timingType:
                          description: immediate, relative or absolute
                          type: string
                        title:
                          description: A custom message's name. A standard one has none
                          type: string
                        triggerType:
                          description: >-
                            What sets it off: campaign_start, assignment,
                            completion, overdue, cancellation, or reminder for
                            one that goes by its timing
                          type: string
                      required:
                        - notificationConfigId
                        - enabled
                        - triggerType
                        - recipientType
                        - channel
                      type: object
                    type:
                      - 'null'
                      - array
                  scheduledEndDate:
                    type: string
                  scheduledStartDate:
                    description: The earliest anyone is enrolled
                    type: string
                type:
                  - 'null'
                  - object
              remediationTrainingCampaignId:
                description: The training campaign that enrolls the people who fail
                type: string
              scheduledEndDate:
                type: string
              scheduledStartDate:
                type: string
              status:
                description: >-
                  The stored status. The web app also goes by the dates, so it
                  can show another
                type: string
              tags:
                items:
                  type: string
                type:
                  - 'null'
                  - array
              targetDepartments:
                description: The departments it targets by ID when it has no targetGroupId
                items:
                  type: string
                type:
                  - 'null'
                  - array
              targetGroupId:
                description: >-
                  The ID of the group that holds its audience. Absent while it
                  has no audience
                type: string
              targetGroups:
                description: The groups it targets by ID when it has no targetGroupId
                items:
                  type: string
                type:
                  - 'null'
                  - array
              templateRecencyWindow:
                description: >-
                  Repeat protection: no one is sent a template they got in this
                  many of their latest sends while it has another to send.
                  Absent when a template may repeat
                type: integer
              templateSelectionMode:
                description: >-
                  random_per_recipient sends each person one of the templates at
                  random, ai_selected the one picked to suit them
                type: string
              templates:
                description: The templates it sends. Absent in a list
                items:
                  additionalProperties: false
                  properties:
                    difficultyLevel:
                      type: string
                    templateId:
                      type: string
                    templateName:
                      type: string
                  required:
                    - templateId
                    - templateName
                  type: object
                type:
                  - 'null'
                  - array
              timingConfig:
                additionalProperties: false
                description: When in the day it sends, and how fast
                properties:
                  deliveryWindow:
                    additionalProperties: false
                    properties:
                      endHour:
                        type:
                          - 'null'
                          - integer
                      startHour:
                        type:
                          - 'null'
                          - integer
                      timezone:
                        type: string
                      timezoneStrategy:
                        description: >-
                          userLocal sends in each person's own timezone, fixed
                          sends in timezone
                        type: string
                      type:
                        description: businessHours or allDay
                        type: string
                    type:
                      - 'null'
                      - object
                  pacingPreference:
                    description: stealthy, standard or fixed, slowest first
                    type: string
                type:
                  - 'null'
                  - object
              totalTargets:
                type: integer
              trackingEndDate:
                type: string
              trackingWindowMode:
                description: >-
                  finite tracks results until trackingEndDate, indefinite
                  without end
                type: string
              updatedAt:
                description: When it last changed
                type: string
            required:
              - campaignId
              - campaignName
              - channel
              - status
              - totalTargets
            type: object
          type:
            - 'null'
            - array
        nextOffset:
          description: The offset of the next page. Absent on the last
          type:
            - 'null'
            - integer
        participants:
          description: With campaignId, a page of the people it targets, by name
          items:
            additionalProperties: false
            properties:
              assignedAt:
                type: string
              deliveryStatus:
                description: sent, delivered, bounced or notSent
                type: string
              departments:
                items:
                  additionalProperties: false
                  properties:
                    id:
                      type: string
                    name:
                      type: string
                  required:
                    - id
                    - name
                  type: object
                type:
                  - 'null'
                  - array
              eventCount:
                description: Events recorded for them, such as opens and clicks
                type: integer
              groups:
                items:
                  additionalProperties: false
                  properties:
                    id:
                      type: string
                    name:
                      type: string
                  required:
                    - id
                    - name
                  type: object
                type:
                  - 'null'
                  - array
              isActive:
                type: boolean
              lastInteractionAt:
                type: string
              reportedAt:
                type: string
              simulationStatus:
                type: string
              templateName:
                description: The template they were sent
                type: string
              userDisplayName:
                type: string
              userEmail:
                type: string
              userId:
                type: string
            required:
              - userId
              - userDisplayName
              - userEmail
              - isActive
              - simulationStatus
              - deliveryStatus
              - assignedAt
              - eventCount
            type: object
          type:
            - 'null'
            - array
        results:
          additionalProperties: false
          description: With campaignId, how all its participants did, whatever the filters
          properties:
            activeEmployees:
              type: integer
            deliveredCount:
              type: integer
            engagedCount:
              description: Participants who failed or passed
              type: integer
            failureCount:
              type: integer
            inactiveEmployees:
              type: integer
            pendingCount:
              type: integer
            sentCount:
              type: integer
            successCount:
              type: integer
            totalEmployees:
              type: integer
          required:
            - totalEmployees
            - activeEmployees
            - inactiveEmployees
            - sentCount
            - deliveredCount
            - engagedCount
            - pendingCount
            - successCount
            - failureCount
          type:
            - 'null'
            - object
        totalCount:
          description: >-
            How many campaigns match, or with campaignId how many participants,
            across every page
          type: integer
      required:
        - campaigns
        - totalCount
      type: object
    Error:
      additionalProperties: false
      description: What every error answers with.
      properties:
        error:
          additionalProperties: false
          properties:
            code:
              description: >-
                Which error it is, one of `invalid_request`, `invalid_token`,
                `insufficient_scope`, `not_found`, `rate_limited`,
                `unavailable`. Stable: branch on this, and treat one you do not
                know as the status alone.
              type: string
            message:
              description: >-
                What went wrong, for a developer to read. The wording can
                change.
              type: string
          required:
            - code
            - message
          type: object
      required:
        - error
      type: object
  responses:
    InvalidRequest:
      content:
        application/json:
          example:
            error:
              code: invalid_request
              message: ...
          schema:
            $ref: '#/components/schemas/Error'
      description: >-
        A parameter is unknown, repeated, empty or not what the route takes. The
        message names it and says what is wrong.
    InvalidToken:
      content:
        application/json:
          example:
            error:
              code: invalid_token
              message: ...
          schema:
            $ref: '#/components/schemas/Error'
      description: >-
        No access token was sent, or it is expired or not valid. Get another
        from the token URL.
      headers:
        WWW-Authenticate:
          description: Always `Bearer error="invalid_token"`.
          schema:
            type: string
    InsufficientScope:
      content:
        application/json:
          example:
            error:
              code: insufficient_scope
              message: ...
          schema:
            $ref: '#/components/schemas/Error'
      description: >-
        The token lacks a scope the route needs, which the message then names,
        or the account may not read what was asked for.
    NotFound:
      content:
        application/json:
          example:
            error:
              code: not_found
              message: ...
          schema:
            $ref: '#/components/schemas/Error'
      description: >-
        Nothing has that ID, or the tenant does not have the feature the route
        belongs to.
    RateLimited:
      content:
        application/json:
          example:
            error:
              code: rate_limited
              message: ...
          schema:
            $ref: '#/components/schemas/Error'
      description: >-
        The service account is making requests too quickly. Wait the seconds
        `Retry-After` gives, then try again.
      headers:
        Retry-After:
          description: How many seconds to wait before the next request.
          schema:
            type: integer
    Unavailable:
      content:
        application/json:
          example:
            error:
              code: unavailable
              message: ...
          schema:
            $ref: '#/components/schemas/Error'
      description: The service could not answer just now. Try again shortly.
  securitySchemes:
    oauth2:
      description: >-
        An API service account's access token, from the client credentials
        grant.
      flows:
        clientCredentials:
          scopes:
            phishing:admin: AutoPhish activity and settings
            phishing_analytics:view: Phishing analytics
            phishing_analytics:view_employee_data: Phishing results for named employees
            phishing_campaigns:view: Phishing campaigns
            phishing_templates:view: Phishing templates
            training_campaigns:view: Training campaigns
            training_courses:view: Training courses
          tokenUrl: https://api.cimento.app/oauth2/token
      type: oauth2

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.