Tessian Events API

Endpoints in this section allow you to access security events from Tessian.

OpenAPI Specification

tessian-events-api-openapi.yml Raw ↑
openapi: 3.0.0
info:
  title: Tessian Anomalies Events API
  version: 1.0.1
  x-logo:
    url: data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAlgAAADYCAYAAAA3SZ0tAAAACXBIWXMAAEJwAABCcAFu8l9tAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAABJCSURBVHgB7d1LdlvXlQbgDZJyUk4arBEEGkFJIzA0gljxo6oXslFrOUrDUisrTkNkJ6m0RDXipCe4V8uOSsoIRI9AygjEGYStKkcScWsf8FKWKYACLt7E960Fk8SLF6DM+/OcffaJAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIDZagUTqT6OTr6L9/LTZ/Ey9luP4ygAgLUmYDVU/Ue04yQe5KedN64+ynf0fuvrOAgAYG0JWGOqPozteC/uRhW3L7hbCVp7GbS+CgBg7QhYY6g+fR2stkd8yGFOG+6aNgSA9SJgjaj6JJ7ED6cDx9FVnwUA62MjGEnrm7iRo1d3IhqFpJ24Ek/7I2AAwKVnBGtM/eL2V7GX79wvoxn1WQBwyQlYDU0laEXczJGxZwEAXCoC1oSqT3L6L/pTf+1oRn0WAFwyAtaUTBy0ctowXsRXghYArD4Ba4rqacOdfFebFrOrzwKAS0DAmoGp1GdVsdv6axwGALByBKwZymnDa/nhUajPAoC1ImDNQfVxBqVWfBCCFgCsBY1GZyiDVafuAP+z1jdxNaf99qOZ0qj0SfVp4ylHAGCOBKwZKDVYGYYe5ajVD7bXaf019mKzH7SaFLG383HdDGzPBS0AWG6mCKeo+jC24734/K0Noas4zHB14wf3PS2Ef5A/gU400YrH8S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AAAAAAAAAAAAAAAAAAAAAAAAAAAAwkf8HWYDh3sK24/gAAAAASUVORK5CYII=
    altText: Tessian Logo
  description: "# About the Tessian API\nThe Tessian API provides access to your Tessian security event data and can be integrated with SIEMs and other data management tools. We offer RESTful API endpoints that return JSON objects containing the requested data.\nThe Tessian API provides access to security event data for all Tessian modules:\n\n  * <a href=\"https://www.tessian.com/defender/\"><img src=\"https://s3.eu-west-1.amazonaws.com/assets.tessian.com/email_snapshot_v2/defender_logo.png\" height=20em/></a>\n  * <a href=\"https://www.tessian.com/guardian/\"><img src=\"https://s3.eu-west-1.amazonaws.com/assets.tessian.com/email_snapshot_v2/guardian_logo.png\" height=20em/></a>\n  * <a href=\"https://www.tessian.com/enforcer/\"><img src=\"https://s3.eu-west-1.amazonaws.com/assets.tessian.com/email_snapshot_v2/enforcer_logo.png\" height=20em/></a>\n  * <a href=\"https://www.tessian.com/architect/\"><img src=\"https://s3.eu-west-1.amazonaws.com/assets.tessian.com/email_snapshot_v2/architect_logo.png\" height=20em/></a>\n\n# How to use the API\nThe API allows you to move Tessian data into your own tools or datastores, where you can visualize and interact with the data. From there, you can:\n  * Triage most important events across multiple security tools\n  * Integrate Tessian data into internal security dashboards\n  * Automate statistics and presentations for reporting purposes\n\n\nThe most common use case is to call the API on a recurring basis (e.g. once per hour or day) to retrieve all new or updated data, and send that data to your desired data tool.\nThe hostname of the API endpoint will be the same as the URL of your Tessian portal page.\n\n  * If you are a EU customer, that would be `https://your-subdomain.tessian-platform.com/...`\n  * If you are a US customer, that would be `https://your-subdomain.tessian-app.com/...`\n\n## Calling the API\nEach endpoint provides an example code snippet on how to call it. Also documented are the required and optional parameters you will need to supply to each endpoint.\n\nFor any endpoint that returns paginated results, you will need to supply a `after_checkpoint` parameter after the first call.\n\nFor example:\n\n\n  ```python\n  import requests\n\n  response = requests.get(\"https://you.tessian-platform.com/api/v1/endpoint\")\n\n  checkpoint = response.json()[\"checkpoint\"]\n\n  next_response = requests.get(\n    \"https://you.tessian-platform.com/api/v1/endpoint\",\n    params={\n      \"after_checkpoint\": checkpoint\n    }\n  )\n  ```\n\n\n## Authenticating\nIn order to authenticate and authorize the API request, you must provide an “API token”. A Tessian portal user who has the correct permissions can generate an API token by navigating to \"Integrations > Tessian API\" in the Tessian portal.\n\n### Using the Token\nOn each request, you must send the API Token in the `Authorization` HTTP header in the format `Authorization: API-Token <your-api-token>`.  Where `<your-api-token>` is the long string of characters that was generated for you in the \"API Tokens\" page of the Portal UI.\n\nExamples:\n#### Raw HTTP\n  ```http\n  GET /api/v1/endpoint HTTP/1.1\n  Host: you.tessian-platform.com\n  Authorization: API-Token <your-api-token>\n  ```\n\n#### cURL\n  ```curl\n  curl --header \"Authorization: API-Token <your-api-token>\" https://you.tessian-platform.com/api/v1/endpoint\n  ```\n\n#### Python\n  ```python\n  import requests\n\n  response = requests.get(\n    \"https://you.tessian-platform.com/api/v1/endpoint\",\n    headers={\"Authorization\": f\"API-Token {api_token}\"},\n  )\n  ```\n\n\n### Token Permissions and Lifecycle\nAn API Token has the same permissions as the user who created it. **In order to generate a valid token, the user creating the token must have \"Logs\" permissions.** If that same user is subsequently removed / has their Logs permissions revoked, the API Token's access will be automatically revoked as a security precaution. Similarly, if an API token is deleted from the token page, it will no longer be valid and any subsequent API request will fail. **The token will only ever be shown once, when it is first generated.**\n\nIf you prefer, you can create a separate \"system\" account that represents the access to the API, rather than representing a particular person. This can then be used as an API-only account, e.g. for Managed Service Providers to access the API. As with any account, the tokens created while using that account will allow access to the API until the token is deleted, the Logs permission is revoked from the account, or the account is removed.\n\n### Keeping the token safe\nAn API token allows access to your company's highly sensitive Tessian data, so treat the token the same way you would treat a password:\n\n  * Limit the number of people who have access to the token.\n  * Don't share the token over email or instant messaging applications.\n  * Delete old tokens that are no longer being used.\n  * If you think the token has been leaked, or given to someone who should not\n  have access, delete it and generate a new one.\n\n\n## Data Formats\n### Timestamps\nThe timestamp (date & time) of the email follows the [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format as Coordinated Universal Time (UTC), using (optional) microsecond precision and a zero-offset: `YYYY-MM-DDTHH:MM:SSZ` or `YYYY-MM-DDTHH:MM:SS.mmmmmmZ`. Note that this format is 24hr time.\n\nFor example, a timestamp could look like `2022-09-07T23:34:28Z`.\n\nFor inbound emails the timestamp describes the actual time that the email was sent, whereas for outbound emails it describes the time that the user (sender) _attempted_ to send the email.\n\n### Return values\nAll responses include a JSON object containing the requested data. The structure of the each return type is documented in our [OpenAPI Specification](http://assets.tessian.com/docs/openapi.json). This file documents all requests that can be made to the various endoints, as well as the expected return types. \n\nReturn types for specific requests are documented alongside the requests themselves throughout the endpoints section of this document.\n\n## General Caveats\n### Limits\nYou may receive less than `limit` items back (or even zero items), while still receiving `has_more` equal to true. Do not rely on counting the number of rows returned in order to determine whether to call the API again; instead, always look at `has_more`. Conversely, there may be times when `has_more` is true, but then you make a subsequent call and receive back zero rows (and `has_more` is false).\n\n### Future changes\nBe aware that in the future, items may acquire additional attributes, and existing attributes may acquire new values.\n### Rate limits\nRate-limiting is enabled for the API. If you receive HTTP status code 429 \"Too Many Requests\" give the API a break and try again in a few seconds.\n### Dealing with duplicate data\nThe nature of the Tessian architecture means that some elements of the data can change over time. For example, a user's response to a warning message can happen some time after an email is initially sent or received. In some cases, the API is able to return an event as soon as it is available, even if some fields are not yet available. In other cases, the Tessian algorithms need to wait for more information before events can be returned.\n\nOverall, this means that the same event is sometimes returned by the API multiple times, as new elements are added to it. Every time you call the API, it will return the events that have been modified since your previous call.\n\nIn order to deal with these duplicate rows, customers should always use only the most recent, up-to-date \"version\" of each event that was returned from the API. In other words, the data will need to be deduplicated, based on the `id` field, keeping only the `id` with the latest `updated_at` time. As an example, in Splunk, this can be done using the `dedup` command.\n\n# Questions and support\nIf you have any questions at any time we're here to help. Please email `support@tessian.com`.\n"
servers:
- url: https://your-domain.tessian-platform.com
  description: For companies hosted on tessian-platform.com.
- url: https://your-domain.tessian-app.com
  description: For companies hosted on tessian-app.com.
tags:
- name: Events
  description: 'Endpoints in this section allow you to access security events from Tessian.

    '
paths:
  /api/v1/events:
    get:
      tags:
      - Events
      summary: Security Events
      description: 'This endpoint provides security events from Defender, Guardian, and Architect.

        '
      x-codeSamples:
      - lang: Python
        source: "import requests\n\nsubdomain = \"YOUR_SUBDOMAIN\"\napi_token = \"YOUR_TOKEN\"\n\nurl = f\"https://{subdomain}.tessian-platform.com/api/v1/events\"\n\nresponse = requests.get(\n    url,\n    headers={\"Authorization\": f\"API-Token {api_token}\"},\n)\n\nprint(response.json())\n"
      parameters:
      - in: query
        name: created_after
        schema:
          type: string
          format: date-time
        description: Only include events that were created after this time.
      - in: query
        name: limit
        description: The maximum number of events to return.
        schema:
          type: integer
          minimum: 2
          maximum: 100
          default: 100
      - in: query
        name: after_checkpoint
        schema:
          type: string
        description: 'If provided, this parameter must be set to the `checkpoint` returned by a previous request to this endpoint.  When provided, events from the previous request will not be included in the response from this request. If the new checkpoint returned by this request is used in yet another call to this endpoint events from both previous requests will not be included in the response (and so on). By making a number of consecutive requests to this endpoint where the checkpoint from the previous request is provided, clients can get all events from the Tessian platform, even when there are many more than can be returned in a single request. This process is often referred to as pagination.


          If an event is updated, it will no longer be excluded from subsequent requests.

          '
        required: false
      operationId: insights.external_api.main.get_events
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  checkpoint:
                    type: string
                    description: 'This value can be provided to a subsequent request via the `after_checkpoint` query parameter to ensure that events from this request are not returned in  future responses. This allows clients to paginate through results.

                      '
                  additional_results:
                    type: boolean
                    description: 'True if there may be more events that can be immediately retrieved. Note that there may be times when `additional_results` is true, but when you make a subsequent call you receive back zero results.

                      '
                  results:
                    type: array
                    description: Tessian security events.
                    items:
                      $ref: '#/components/schemas/Event'
                    minItems: 0
                    maxItems: 100
                required:
                - checkpoint
                - additional_results
                - results
          links:
            checkpoint:
              operationId: getEvents
              parameters:
                after_checkpoint: $response.body#/checkpoint
              description: A 'checkpoint' can be used to paginate through events.
        '400':
          description: There was a problem with the request
        '401':
          description: There was a problem with the request
        '403':
          description: Invalid token or API is not enabled
        '429':
          description: Rate limited - wait a few seconds and try again
        '500':
          description: Server error
        '503':
          description: Server error
        '504':
          description: Server error
components:
  schemas:
    ArchitectEvent:
      allOf:
      - $ref: '#/components/schemas/BaseEvent'
      - $ref: '#/components/schemas/OutboundEmailDetails'
      - type: object
        properties:
          architect_details:
            type: object
            description: Details about the Architect trigger.
            properties:
              triggered_policy_ids:
                type: array
                minItems: 1
                description: The IDs of all the architect policies that triggered.
                items:
                  type: string
              triggered_policy_names:
                type: array
                minItems: 1
                description: 'The names of all the architect policies (at the time the event was created) that triggered.

                  '
                items:
                  type: string
              triggered_logic_types:
                type: array
                minItems: 1
                description: 'The types of conditions and exceptions that triggered across all architect policies. If multiple conditions or exceptions of the same type triggered, the type is only listed once here.

                  '
                items:
                  type: string
              breach_prevented:
                type: boolean
                description: 'True if Architect prevented this email from being sent. `null` if it has not yet been determined.

                  '
                nullable: true
              final_outcome:
                type: string
                description: 'The final outcome of the email. `null` if it has not yet been determined.

                  '
                enum:
                - NOT_SENT
                - SENT_WITH_CHANGES
                - SENT_WITHOUT_CHANGES
                nullable: true
              user_responses:
                type: array
                description: 'How the user responded to the Tessian warnings associated with this event.

                  '
                items:
                  type: string
                  enum:
                  - SEND
                  - DO_NOT_SEND
              is_sensitive:
                type: boolean
                description: Indicates if the email is considered sensitive.
              justifications:
                type: array
                description: Any justifications the user wrote when choosing to send the email.
                items:
                  type: string
              user_shown_message:
                type: boolean
                description: '`true` if the user was shown a message for this event, `false` if not.

                  '
            required:
            - triggered_policy_ids
            - triggered_policy_names
            - triggered_logic_types
            - breach_prevented
            - final_outcome
            - user_responses
            - is_sensitive
            - justifications
            - user_shown_message
        required:
        - architect_details
    InboundEmailDetails:
      type: object
      properties:
        inbound_email_details:
          allOf:
          - type: object
            description: Details about an inbound email.
            properties:
              received_time:
                type: string
                format: date-time
                description: The time that the email was received by the delivering mail server in UTC.
              urls:
                type: array
                items:
                  type: string
                description: The URLs extracted from the email.
            required:
            - received_time
            - urls
          - $ref: '#/components/schemas/BaseEmailDetails'
      required:
      - inbound_email_details
    OutboundEmailDetails:
      type: object
      properties:
        outbound_email_details:
          allOf:
          - type: object
            description: Details about an outbound email.
            properties:
              send_time:
                type: string
                format: date-time
                description: The time that the email was sent or a send attempt was made in UTC.
              tessian_action:
                type: string
                enum:
                - WARN
                - BLOCK
                - SILENTLY_TRACK
                description: 'The action Tessian took when the user tried to send the email. If multiple modules triggered, the action might be the result of another module (i.e. not the module described by this event).

                  '
            required:
            - send_time
            - tessian_action
          - $ref: '#/components/schemas/BaseEmailDetails'
      required:
      - outbound_email_details
    Event:
      oneOf:
      - $ref: '#/components/schemas/GuardianEvent'
      - $ref: '#/components/schemas/ArchitectEvent'
      - $ref: '#/components/schemas/DefenderEvent'
      discriminator:
        propertyName: type
        mapping:
          guardian: '#/components/schemas/GuardianEvent'
          architect: '#/components/schemas/ArchitectEvent'
          defender: '#/components/schemas/DefenderEvent'
    BaseEvent:
      type: object
      description: Properties that all events have.
      properties:
        id:
          type: string
          description: A unique identifier for the event.
        type:
          type: string
          description: The type of event.
        created_at:
          type: string
          format: date-time
          description: When the event was created in UTC.
        updated_at:
          type: string
          format: date-time
          description: When the event was last updated in UTC. Creation is counted as an update.
        portal_link:
          type: string
          format: url
          nullable: true
          description: 'A HTTP link to the Tessian portal where further information about to this event can be viewed.

            '
      required:
      - id
      - type
      - created_at
      - updated_at
      - portal_link
    GuardianEvent:
      allOf:
      - $ref: '#/components/schemas/BaseEvent'
      - $ref: '#/components/schemas/OutboundEmailDetails'
      - type: object
        properties:
          guardian_details:
            type: object
            description: Details about the Guardian trigger.
            properties:
              triggered_filter_ids:
                type: array
                description: The IDs of all the Guardian filters that triggered.
                items:
                  type: string
              type:
                type: string
                enum:
                - MISDIRECTED_EMAIL
                - MISATTACHED_FILE
                description: The type of Guardian event.
              triggered_filter_names:
                type: array
                description: 'The names of all of the Guardian filters that triggered (at the time the event was retrieved).

                  '
                items:
                  type: string
              breach_prevented:
                type: boolean
                description: True if Guardian prevented this email from being sent.
              anomalous_recipients:
                type: array
                items:
                  type: string
                  anyOf:
                  - format: email
                  - format: x.400
                description: "The recipient email addresses that Guardian has identified as being possible mistakes. \n"
              suggested_recipients:
                type: array
                items:
                  type: string
                  anyOf:
                  - format: email
                  - format: x.400
                description: 'The email addresses that Guardian thinks the user should be sending the email to.

                  '
              anomalous_attachments:
                type: array
                description: The name(s) of the email attachment(s) Guardian identified as misattached.
                items:
                  type: string
              final_outcome:
                type: string
                description: 'The final outcome of the email or `null` if the final outcome is not yet known.

                  '
                nullable: true
                enum:
                - null
                - NOT_SENT
                - SENT_WITH_CHANGES
                - SENT_WITHOUT_CHANGES
              user_responses:
                type: array
                description: 'How the user responded to the Tessian warnings associated with this event.

                  '
                items:
                  type: string
                  enum:
                  - SEND
                  - DO_NOT_SEND
              justifications:
                type: array
                description: Any justifications the user wrote when choosing to send the email.
                items:
                  type: string
              user_shown_message:
                type: boolean
                description: '`true` if the user was shown a message for this event, `false` if not.

                  '
            required:
            - triggered_filter_ids
            - type
            - triggered_filter_names
            - breach_prevented
            - anomalous_recipients
            - suggested_recipients
            - anomalous_attachments
            - final_outcome
            - user_responses
            - justifications
            - user_shown_message
        required:
        - guardian_details
    DefenderEvent:
      allOf:
      - $ref: '#/components/schemas/BaseEvent'
      - $ref: '#/components/schemas/InboundEmailDetails'
      - type: object
        properties:
          defender_details:
            type: object
            description: Details about the Defender trigger.
            properties:
              burst_attack_id:
                type: string
                description: An identifier for the burst attack this event is part of.
              intent_types:
                type: array
                description: The intent types that indicate phishing that Defender found in the email.
                items:
                  type: string
                  enum:
                  - INVOICE
                  - CREDENTIALS
                  - INFORMATION_THEFT
                  - BLACKMAIL
                  - SUSPICIOUS_URL
                  - SUSPICIOUS_ATTACHMENT
                  - URGENCY
              threat_signal_types:
                type: array
                description: The types of threat signals that Defender found in the email.
                items:
                  type: string
              threat_types:
                type: array
                description: The types of attacks detected by Defender.
                items:
                  type: string
                  enum:
                  - DIRECT_SPOOF_IMPERSONATION
                  - OTHER_PHISHING
                  - MATCHED_DENYLIST
                  - LOOKALIKE_IMPERSONATION
                  - BRAND_IMPERSONATION
                  - ACCOUNT_TAKEOVER
              spf_result:
                type: string
                nullable: true
                enum:
                - PASSED
                - FAILED
                - null
                description: The result of SPF or `null` if the result is not known.
              dkim_result:
                type: string
                nullable: true
                enum:
                - PASSED
                - FAILED
                - null
                description: The result of DKIM or `null` if the result is not known.
              dmarc_result:
                type: string
                nullable: true
                enum:
                - PASSED
                - FAILED
                - null
                description: The result of DMARC or `null` if the result is not known.
              sender_location:
                type: string
                nullable: true
                description: 'A human readable description of the geographical location the email was sent from or `null` if the location is not known.

                  '
              users_responded:
                type: object
                description: How the end users interacted with the email.
                properties:
                  malicious:
                    type: integer
                    minimum: 0
                    description: 'The number of users who indicated that they thought this email was malicious using the buttons in the Tessian warning.

                      '
                  safe:
                    type: integer
                    minimum: 0
                    description: 'The number of users who indicated that they thought this email was safe using the buttons in the Tessian warning.

                      '
                  unsure:
                    type: integer
                    minimum: 0
                    description: "The number of users who indicated that they were not sure if this email was malicious or safe using the buttons in the Tessian warning. \n"
                  deleted:
                    type: integer
                    minimum: 0
                    description: 'The number of users who deleted the email without otherwise indicating if they thought the email was malicious or safe.

                      '
                required:
                - malicious
                - safe
                - unsure
                - deleted
              number_protected_users:
                type: integer
                minimum: 0
                description: "The number of recipients of this email that are included in a filter that is  actively protecting them (e.g. not only silently tracked). \n"
        

# --- truncated at 32 KB (37 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/tessian/refs/heads/main/openapi/tessian-events-api-openapi.yml