> ## 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 person's AutoPhish history

> One person's record in the program over a period: whether they are in it, their totals and rates, and each simulation they were sent with its outcome. A `userId` comes from the activity route or the unsettled sends route. Give `window`, a period ending now, or `from` and `to` together for a custom one; with neither, the last 30 days. A period goes by the day a simulation was sent, not the day it was acted on. Figures are as of now: a simulation's result is final a week after it is sent, so a recent period is still moving. Rates are over simulations delivered, and are null, not zero, when none was.



## OpenAPI

````yaml https://api.cimento.app/v1/openapi.json get /v1/autophish/people/{userId}/history
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/autophish/people/{userId}/history:
    get:
      tags:
        - autophish
      summary: Read one person's AutoPhish history
      description: >-
        One person's record in the program over a period: whether they are in
        it, their totals and rates, and each simulation they were sent with its
        outcome. A `userId` comes from the activity route or the unsettled sends
        route. Give `window`, a period ending now, or `from` and `to` together
        for a custom one; with neither, the last 30 days. A period goes by the
        day a simulation was sent, not the day it was acted on. Figures are as
        of now: a simulation's result is final a week after it is sent, so a
        recent period is still moving. Rates are over simulations delivered, and
        are null, not zero, when none was.
      operationId: getAutophishPersonHistory
      parameters:
        - description: >-
            The person to read. A userId comes from GET /v1/autophish/activity
            or GET /v1/autophish/sends/ambiguous
          in: path
          name: userId
          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: >-
            A period ending now: 7d, 30d, 90d or 12m. Defaults to 30d. Omit it
            to give from and to instead
          in: query
          name: window
          required: false
          schema:
            enum:
              - 7d
              - 30d
              - 90d
              - 12m
            type: string
        - description: >-
            A custom period's first day, UTC. Give it with to, in place of
            window
          in: query
          name: from
          required: false
          schema:
            format: date
            pattern: ^\d{4}-\d{2}-\d{2}$
            type: string
        - description: >-
            A custom period's last day, UTC, included. Today or later reads to
            now
          in: query
          name: to
          required: false
          schema:
            format: date
            pattern: ^\d{4}-\d{2}-\d{2}$
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetAutophishPersonHistoryResult'
          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:admin
components:
  schemas:
    GetAutophishPersonHistoryResult:
      additionalProperties: false
      properties:
        enrollment:
          additionalProperties: false
          properties:
            exclusionAutomatic:
              description: AutoPhish excluded them rather than an admin
              type: boolean
            exclusionReason:
              type: string
            exemptionEndsAt:
              description: When the exemption lapses and they are targeted again
              type:
                - 'null'
                - string
            state:
              description: inactive, excluded, exempt, never_targeted or in_program
              type: string
          required:
            - state
          type: object
        person:
          additionalProperties: false
          properties:
            name:
              description: Absent when the directory holds no name for them
              type: string
            teamName:
              description: The team they were in when the simulation was planned
              type: string
            userId:
              type: string
          required:
            - userId
          type: object
        program:
          additionalProperties: false
          properties:
            enabled:
              description: >-
                False when AutoPhish is switched off for the tenant, in which
                case nothing new is going out to anyone
              type: boolean
            remediationCampaignConfigured:
              description: >-
                Whether a click assigns follow-up training at all. Without one,
                remediationCompleted is never true for anybody
              type: boolean
          required:
            - enabled
            - remediationCampaignConfigured
          type: object
        sends:
          description: The period's delivered simulations, newest first
          items:
            additionalProperties: false
            properties:
              difficulty:
                type: string
              landingPage:
                additionalProperties: false
                description: >-
                  How far they got after clicking. Absent when they did not
                  click
                properties:
                  landed:
                    description: They reached the page the link went to
                    type: boolean
                  remediationCompleted:
                    description: They finished the follow-up training
                    type: boolean
                  reviewedRedFlags:
                    description: >-
                      They went through the explanation of what gave the lure
                      away
                    type: boolean
                required:
                  - landed
                  - reviewedRedFlags
                  - remediationCompleted
                type:
                  - 'null'
                  - object
              outcome:
                additionalProperties: false
                description: What they did, absent when they did neither
                properties:
                  label:
                    description: The same wording every Cimento surface uses for it
                    type: string
                  type:
                    description: clicked or reported
                    type: string
                required:
                  - type
                  - label
                type:
                  - 'null'
                  - object
              scheduledAt:
                description: The day this counts against, whenever it was acted on
                type: string
              sendId:
                description: >-
                  The simulation, which GET /v1/autophish/sends/{sendId} reads
                  with the subject of its message and the whole of their history
                type: string
              sentAt:
                description: >-
                  When it left. Absent for a delivered simulation the dispatcher
                  never stamped
                type:
                  - 'null'
                  - string
              subject:
                type: string
              vendor:
                description: >-
                  The brand the lure impersonated, which is invented rather than
                  a real vendor relationship
                type: string
            required:
              - sendId
              - scheduledAt
            type: object
          type:
            - 'null'
            - array
        totals:
          additionalProperties: false
          properties:
            failed:
              description: Clicks
              type: integer
            failureRate:
              type:
                - 'null'
                - number
            lastSendAt:
              description: >-
                When their most recent simulation left, over their whole history
                rather than this period
              type:
                - 'null'
                - string
            medianMinutesToReport:
              description: >-
                Over the simulations they reported. Absent rather than zero when
                they reported none
              type:
                - 'null'
                - number
            reported:
              type: integer
            reportedRate:
              type:
                - 'null'
                - number
            sent:
              description: >-
                Delivered simulations in the period. One the provider never
                accepted is not counted
              type: integer
          required:
            - sent
            - reported
            - failed
          type: object
        window:
          additionalProperties: false
          description: >-
            The period as resolved, which is the past 30 days when none was
            given
          properties:
            from:
              description: The period's first day, UTC
              type: string
            to:
              description: The period's last day, UTC, included
              type: string
            window:
              description: 'The period as resolved: 7d, 30d, 90d, 12m or custom'
              type: string
          required:
            - window
            - from
            - to
          type: object
      required:
        - person
        - enrollment
        - program
        - window
        - totals
        - sends
      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.