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

# Take action on an email

> Runs an action (quarantine, move or restore) on every mailbox copy of one email, and optionally changes its verdict to one the tenant's remediation policy allows for that action. Identify the email by `threat_id` or `internet_message_id`, not both. Not idempotent: after a timeout, check the email before retrying. Audit-logged.

> [!NOTE]
>
> Taking a Decision Center action through the API is in **beta**. The request and response may change.
> If the endpoint returns `403` with "This feature is not available for your tenant", it isn't enabled
> for your tenant yet — contact Ocean support.


## OpenAPI

````yaml post /api/v1/decision_center/actions
openapi: 3.0.0
info:
  contact: {}
  title: Ocean Security API
  version: 1.0.0
  description: Ocean Security API for threat detection and security metrics
servers:
  - url: https://api.ocean.security
    description: Production server
security:
  - ApiKeyAuth: []
tags:
  - name: Threats
    description: Operations for retrieving threat information
  - name: Metrics
    description: Security metrics and analytics endpoints
paths:
  /api/v1/decision_center/actions:
    post:
      tags:
        - Decision Center
      summary: Take action on an email
      description: >-
        Runs an action (quarantine, move or restore) on every mailbox copy of
        one email, and optionally changes its verdict to one the tenant's
        remediation policy allows for that action. Identify the email by
        `threat_id` or `internet_message_id`, not both. Not idempotent: after a
        timeout, check the email before retrying. Audit-logged.
      parameters:
        - description: Authentication API Key
          in: header
          name: X-Api-Key
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/controllers_decisioncenter.TakeActionRequest
        description: The email and the action to take
        required: true
      responses:
        '200':
          description: The action ran
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/ocean_api_common.BaseResponse-controllers_decisioncenter_TakeActionResult
        '400':
          description: >-
            Invalid request, or an action or verdict the tenant's policy does
            not route; the message then lists the available actions, or the
            verdicts the action allows
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/types.ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/types.ErrorResponse'
        '403':
          description: >-
            Missing remediation:edit permission, or the feature is not enabled
            for the tenant
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/types.ErrorResponse'
        '404':
          description: No email with this id in the last 90 days
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/types.ErrorResponse'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/types.ErrorResponse'
        '504':
          description: The action did not finish in time; it may still complete
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/types.ErrorResponse'
components:
  schemas:
    controllers_decisioncenter.TakeActionRequest:
      properties:
        action:
          allOf:
            - $ref: '#/components/schemas/controllers_decisioncenter.Action'
          enum:
            - quarantine
            - move_to_trash
            - move_to_spam
            - move_to_graymail
            - move_to_promotions
            - restore
          example: quarantine
        include_reason_in_correction_email:
          type: boolean
        internet_message_id:
          description: InternetMessageID is the email's RFC 5322 Message-Id.
          example: <CAF=x1@mail.example.com>
          maxLength: 998
          type: string
        reason:
          maxLength: 500
          type: string
        send_correction_email:
          type: boolean
        threat_id:
          description: >-
            ThreatID is the threat's `id`, as in the Portal and `GET
            /api/v1/threats`.
          example: e651a45ce9cea7e8add31b7643732654bab3591675429d98b8ed60b074740050
          maxLength: 998
          type: string
        verdict:
          description: >-
            Verdict also changes the email's verdict. Omit it to keep the
            current one.
          enum:
            - malicious
            - spam
            - safe
            - graymail
            - simulation
          example: malicious
          type: string
      required:
        - action
      type: object
    ocean_api_common.BaseResponse-controllers_decisioncenter_TakeActionResult:
      properties:
        results:
          $ref: '#/components/schemas/controllers_decisioncenter.TakeActionResult'
        status:
          type: integer
      type: object
    types.ErrorResponse:
      properties:
        error:
          type: string
      type: object
    controllers_decisioncenter.Action:
      enum:
        - quarantine
        - move_to_trash
        - move_to_spam
        - move_to_graymail
        - move_to_promotions
        - restore
      type: string
      x-enum-varnames:
        - ActionQuarantine
        - ActionMoveToTrash
        - ActionMoveToSpam
        - ActionMoveToGraymail
        - ActionMoveToPromotions
        - ActionRestore
    controllers_decisioncenter.TakeActionResult:
      properties:
        action_taken:
          description: ActionTaken is omitted when no copy was remediated.
          enum:
            - moved_to_trash
            - moved_to_spam
            - moved_to_graymail
            - moved_to_promotions
            - quarantined
            - released_from_quarantine
            - restored
            - none
          example: quarantined
          type: string
        correction_email_status:
          description: CorrectionEmailStatus is set when a correction email was requested.
          enum:
            - success
            - failed
            - skip
          type: string
        failure_reason:
          description: FailureReason is set when status is failed.
          enum:
            - message_not_found
            - permission_denied
            - mailbox_unavailable
            - provider_error
            - internal_error
          type: string
        messages_attempted:
          type: integer
        messages_failed:
          type: integer
        previous_verdict:
          type: string
        status:
          enum:
            - succeeded
            - partially_succeeded
            - failed
          example: succeeded
          type: string
        threat_id:
          type: string
        verdict:
          type: string
      type: object
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-Api-Key
      description: API key for authentication

````