Executive Assistant

Executive Assistant · Ações GPT

EAGPT API for reading user's emails

Equip GPTs with the ability to read emails from EA Server

  • GET /emailsReturns the list of emails in the user's mailbox.
  • POST /emails/draftCreates a draft in the user mailbox
  • POST /emails/draft/{draftId}/sendSends a draft email
Esquema API original
{
  "openapi": "3.0.2",
  "info": {
    "title": "EAGPT API for reading user's emails",
    "version": "1.0.0",
    "description": "Equip GPTs with the ability to read emails from EA Server",
    "x-openai-verification-token": "unique-verification-token"
  },
  "servers": [
    {
      "url": "https://eagpt.zeffmuks.com"
    }
  ],
  "paths": {
    "/emails": {
      "get": {
        "operationId": "list emails",
        "summary": "Returns the list of emails in the user's mailbox.",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "emails": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Email"
                      }
                    }
                  }
                }
              }
            },
            "description": "OK"
          }
        },
        "security": [
          {
            "OAuth": []
          }
        ]
      }
    },
    "/emails/draft": {
      "post": {
        "operationId": "create a draft",
        "summary": "Creates a draft in the user mailbox",
        "requestBody": {
          "description": "Draft email content",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "receiver": {
                    "type": "string",
                    "description": "Email address of the recipient"
                  },
                  "subject": {
                    "type": "string",
                    "description": "Subject of the draft email"
                  },
                  "message": {
                    "type": "string",
                    "description": "Body of the draft email"
                  }
                },
                "required": [
                  "receiver",
                  "subject",
                  "message"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "draft_id": {
                      "description": "DRAFT_ID of the newly created draft",
                      "type": "string"
                    }
                  }
                }
              }
            },
            "description": "OK"
          }
        },
        "security": [
          {
            "OAuth": []
          }
        ]
      }
    },
    "/emails/draft/{draftId}/send": {
      "post": {
        "operationId": "send a draft",
        "summary": "Sends a draft email",
        "parameters": [
          {
            "in": "path",
            "name": "draftId",
            "schema": {
              "type": "string"
            },
            "required": true,
            "description": "DRAFT_ID of a newly created draft email"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "OK"
          }
        },
        "security": [
          {
            "OAuth": []
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "Email": {
        "type": "object",
        "description": "Contents of the email",
        "properties": {
          "msg_id": {
            "type": "string"
          },
          "thread_id": {
            "type": "string"
          },
          "label_ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "snippet": {
            "type": "string"
          },
          "received_at": {
            "type": "string",
            "format": "date-time"
          },
          "From": {
            "type": "string",
            "description": "Sender's email address"
          },
          "Subject": {
            "type": "string",
            "description": "Email's subject"
          },
          "To": {
            "type": "string",
            "description": "Recipient's email address"
          },
          "body": {
            "type": "string"
          }
        },
        "required": [
          "msg_id",
          "thread_id",
          "label_ids",
          "snippet",
          "received_at",
          "From",
          "Subject",
          "To",
          "body"
        ]
      }
    }
  },
  "securitySchemes": {
    "OAuth": {
      "type": "oauth2",
      "flows": {
        "authorizationCode": {
          "authorizationUrl": "https://eagpt.zeffmuks.com/oauth/authorize",
          "tokenUrl": "https://eagpt.zeffmuks.com/oauth/token",
          "scopes": {
            "default": "default scope"
          }
        }
      }
    }
  }
}