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

# Update Admin Alert

> Resolve / dismiss an alert and / or set the caller's own read marker.

Closing is a status update only: it stamps ``resolved_at`` / ``resolved_by`` /
resolution and does not replay or retry whatever raised the alert. Repeating
the same status is a no-op that returns the alert as first closed; asking for
the other status on a closed alert is a 409 ``alert_already_closed``.

``read`` belongs to the caller alone and may be set on open or closed alerts.
Requires a human (JWT) team-owner session; API keys are rejected. An alert id
that is malformed, unknown, or belongs to another team is the same 404.



## OpenAPI

````yaml /openapi/mio-openapi.json patch /api/v1/teams/{team_id}/admin-alerts/{alert_id}
openapi: 3.1.0
info:
  description: >-
    Production API reference for Membership.io. Use the authored guides for
    workflows and the generated endpoint pages for exact parameters and schemas.
  title: Membership.io API
  version: 0.1.0
servers:
  - description: Production
    url: https://api.member.dev
security:
  - bearerAuth: []
paths:
  /api/v1/teams/{team_id}/admin-alerts/{alert_id}:
    patch:
      tags:
        - admin-alerts
      summary: Update Admin Alert
      description: >-
        Resolve / dismiss an alert and / or set the caller's own read marker.


        Closing is a status update only: it stamps ``resolved_at`` /
        ``resolved_by`` /

        resolution and does not replay or retry whatever raised the alert.
        Repeating

        the same status is a no-op that returns the alert as first closed;
        asking for

        the other status on a closed alert is a 409 ``alert_already_closed``.


        ``read`` belongs to the caller alone and may be set on open or closed
        alerts.

        Requires a human (JWT) team-owner session; API keys are rejected. An
        alert id

        that is malformed, unknown, or belongs to another team is the same 404.
      operationId: >-
        admin_alerts.patch_admin_alerts_patch_teams_by_team_id_admin_alerts_by_alert_id
      parameters:
        - in: path
          name: team_id
          required: true
          schema:
            title: Team Id
            type: string
        - in: path
          name: alert_id
          required: true
          schema:
            title: Alert Id
            type: string
      requestBody:
        content:
          application/vnd.api+json:
            schema:
              $ref: '#/components/schemas/AdminAlertPatchRequest'
        required: true
      responses:
        '200':
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/JsonApiResponse_AdminAlertAttributes_'
          description: Successful Response
        '403':
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/JsonApiErrorResponse'
          description: Not the team owner, or an API-key principal (human JWT only).
        '404':
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/JsonApiErrorResponse'
          description: 'Alert not found: unknown, malformed or another team''s id.'
        '409':
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/JsonApiErrorResponse'
          description: >-
            `alert_already_closed` (the alert was closed the other way) or
            `resource_id_mismatch` (data.id differs from the URL).
        '422':
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
      security:
        - HTTPBearer: []
components:
  schemas:
    AdminAlertPatchRequest:
      properties:
        data:
          $ref: '#/components/schemas/AdminAlertPatchData'
      required:
        - data
      title: AdminAlertPatchRequest
      type: object
    JsonApiResponse_AdminAlertAttributes_:
      properties:
        data:
          $ref: '#/components/schemas/JsonApiResource_AdminAlertAttributes_'
        included:
          anyOf:
            - items: {}
              type: array
            - type: 'null'
          title: Included
        links:
          anyOf:
            - $ref: '#/components/schemas/JsonApiLinks'
            - type: 'null'
        meta:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Meta
      required:
        - data
      title: JsonApiResponse[AdminAlertAttributes]
      type: object
    JsonApiErrorResponse:
      description: Error JSON:API response.
      properties:
        errors:
          items:
            $ref: '#/components/schemas/JsonApiError'
          title: Errors
          type: array
        meta:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Meta
      required:
        - errors
      title: JsonApiErrorResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    AdminAlertPatchData:
      additionalProperties: false
      properties:
        attributes:
          $ref: '#/components/schemas/AdminAlertPatchAttributes'
        id:
          description: >-
            Optional. When present it must equal the id of the resource this
            request updates; a different id is a 409 resource_id_mismatch and
            null is a 422.
          title: Id
          type: string
        type:
          const: admin_alerts
          title: Type
          type: string
      required:
        - type
        - attributes
      title: AdminAlertPatchData
      type: object
    JsonApiResource_AdminAlertAttributes_:
      properties:
        attributes:
          $ref: '#/components/schemas/AdminAlertAttributes'
        id:
          title: Id
          type: string
        links:
          anyOf:
            - $ref: '#/components/schemas/JsonApiLinks'
            - type: 'null'
        meta:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Meta
        relationships:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Relationships
        type:
          title: Type
          type: string
      required:
        - id
        - type
        - attributes
      title: JsonApiResource[AdminAlertAttributes]
      type: object
    JsonApiLinks:
      properties:
        self:
          anyOf:
            - type: string
            - type: 'null'
          title: Self
      title: JsonApiLinks
      type: object
    JsonApiError:
      properties:
        code:
          anyOf:
            - type: string
            - type: 'null'
          title: Code
        detail:
          anyOf:
            - type: string
            - type: 'null'
          title: Detail
        id:
          anyOf:
            - type: string
            - type: 'null'
          title: Id
        meta:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Meta
        source:
          anyOf:
            - additionalProperties:
                type: string
              type: object
            - type: 'null'
          title: Source
        status:
          title: Status
          type: string
        title:
          title: Title
          type: string
      required:
        - status
        - title
      title: JsonApiError
      type: object
    ValidationError:
      properties:
        ctx:
          title: Context
          type: object
        input:
          title: Input
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
    AdminAlertPatchAttributes:
      additionalProperties: false
      description: >-
        Writable attributes: close the alert and / or set the caller's read
        marker.


        At least one member is required, and an explicit ``null`` is rejected so
        a

        client cannot send a request that looks like an update and changes
        nothing.

        ``read`` is strict: only JSON ``true`` / ``false`` count.
      properties:
        read:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Read
        status:
          anyOf:
            - enum:
                - resolved
                - dismissed
              type: string
            - type: 'null'
          title: Status
      title: AdminAlertPatchAttributes
      type: object
    AdminAlertAttributes:
      description: >-
        Attributes block for an admin_alerts resource object.


        ``alert_type`` is the alert type slug (e.g. ``"stripe_sync_failed"``) —

        named specifically, never a bare ``type``, which is reserved for the
        JSON:API

        resource ``type`` (api-response.md). ``payload`` is the structured JSON

        context the writer attached (event IDs, error message, etc.).


        ``status`` is ``open`` until an owner closes the alert as ``resolved``
        or

        ``dismissed``; ``resolved_at`` / ``resolved_by`` record that closure and
        are

        null while the alert is open (the list endpoint only returns open
        alerts).

        ``read`` is the CALLING user's own read marker — never another user's.
      properties:
        alert_type:
          title: Alert Type
          type: string
        created_at:
          title: Created At
          type: string
        hub_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Hub Id
        payload:
          additionalProperties: true
          title: Payload
          type: object
        read:
          title: Read
          type: boolean
        resolved_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Resolved At
        resolved_by:
          anyOf:
            - type: string
            - type: 'null'
          title: Resolved By
        source_module:
          title: Source Module
          type: string
        status:
          enum:
            - open
            - resolved
            - dismissed
          title: Status
          type: string
      required:
        - source_module
        - alert_type
        - hub_id
        - payload
        - created_at
        - status
        - read
        - resolved_at
        - resolved_by
      title: AdminAlertAttributes
      type: object
  securitySchemes:
    bearerAuth:
      bearerFormat: JWT or mio_sk API key
      description: >-
        Send platform JWTs, contact JWTs, or team API keys as `Authorization:
        Bearer <token>`.
      scheme: bearer
      type: http
    HTTPBearer:
      scheme: bearer
      type: http

````

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