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

# Set email status

> Set an email's read/unread status (moves between inbox and read folders)



## OpenAPI

````yaml /api-reference/openapi.yaml put /api/v1/mail/{id}/status
openapi: 3.1.1
info:
  title: Coconut API
  description: |
    Comprehensive API for the Coconut development platform.

    Coconut is a development environment that provides AI-assisted coding,
    task management, skill orchestration, and integrated terminal sessions.
  version: 1.0.72
  contact:
    name: Coconut Team
  license:
    name: MIT
servers:
  - url: http://localhost:3001
    description: Development server
  - url: '{baseUrl}'
    description: Production server
    variables:
      baseUrl:
        default: http://localhost:3001
        description: Base URL for the API
security:
  - sessionCookie: []
  - bearerAuth: []
  - apiKey: []
tags:
  - name: Tasks
    description: Task management
  - name: Skills
    description: AI skill configuration and management (Agent Skills spec)
  - name: Resources
    description: File and media resource management
  - name: Knowledge
    description: Knowledge document management
  - name: Terminal
    description: Terminal session management
  - name: AI
    description: AI chat and completion endpoints
  - name: Chats
    description: Chat history management
  - name: Configuration
    description: Project and global configuration
  - name: MCP
    description: Model Context Protocol server management
  - name: Context
    description: Context documents for role, agents, team, and memory
  - name: Identity
    description: Identity and agent card management
  - name: User
    description: User information and settings
  - name: Jobs
    description: Scheduled job management
  - name: Git
    description: Git repository management
  - name: Slack
    description: Slack integration and notification management
  - name: Mail
    description: Email management and Resend webhook integration
  - name: Version
    description: API version information
paths:
  /api/v1/mail/{id}/status:
    put:
      tags:
        - Mail
      summary: Set email status
      description: Set an email's read/unread status (moves between inbox and read folders)
      operationId: setMailStatus
      parameters:
        - name: id
          in: path
          required: true
          description: Email ID
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - status
              properties:
                status:
                  type: string
                  enum:
                    - read
                    - unread
                  description: Target status
      responses:
        '200':
          description: Status updated
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SuccessResponse'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          message:
                            $ref: '#/components/schemas/MailMessage'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalError'
components:
  schemas:
    SuccessResponse:
      type: object
      required:
        - success
      properties:
        success:
          type: boolean
          const: true
        data:
          type: object
    MailMessage:
      type: object
      required:
        - id
        - emailId
        - from
        - to
        - subject
        - folder
      properties:
        id:
          type: string
          description: Internal mail ID (filename without extension)
        emailId:
          type: string
          description: Email provider ID
        from:
          type: string
          description: Sender address
          example: Acme <hello@acme.com>
        to:
          type: array
          items:
            type: string
          description: Recipient addresses
        cc:
          type: array
          items:
            type: string
          description: CC addresses
        bcc:
          type: array
          items:
            type: string
          description: BCC addresses
        subject:
          type: string
          description: Email subject line
        messageId:
          type: string
          description: RFC message ID
        attachments:
          type: array
          items:
            $ref: '#/components/schemas/MailAttachment'
        receivedAt:
          type: string
          format: date-time
          description: When the email was received
        content:
          type: string
          description: Email body content
        folder:
          $ref: '#/components/schemas/MailFolder'
    MailAttachment:
      type: object
      properties:
        id:
          type: string
          description: Attachment ID
        filename:
          type: string
          description: Attachment filename
        contentType:
          type: string
          description: MIME content type
        contentDisposition:
          type: string
          description: Content disposition
        contentId:
          type: string
          description: Content ID (for inline attachments)
    MailFolder:
      type: string
      enum:
        - inbox
        - read
        - sent
      description: Mail folder name
    ErrorResponse:
      type: object
      required:
        - success
        - error
      properties:
        success:
          type: boolean
          const: false
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              description: Error code
            message:
              type: string
              description: Human-readable error message
  responses:
    NotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    InternalError:
      description: Internal server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    sessionCookie:
      type: apiKey
      in: cookie
      name: nut-session
      description: Session cookie authentication
    bearerAuth:
      type: http
      scheme: bearer
      description: Bearer token authentication
    apiKey:
      type: apiKey
      in: header
      name: X-API-Key
      description: API key authentication

````