application/json

Body

Request for creating or updating a message.

  • id string | null

    Message ID (for updating only)

  • subject string Required

    Subject

  • body string Required

    Body

  • recipientIds array[string] Required

    List of contact IDs

  • attachments array[string] Required

    List of attachment paths

Responses

  • 200 application/json

    successful operation

    Hide response attributes Show response attributes object
    • entity object Required

      Messages schema

      Hide entity attributes Show entity attributes object
      • id string Required

        id

      • companyId string Required

        Company ID

      • type string Required

        Values are staff_invitation, family_invitation, or custom.

      • subject string Required

        Subject

      • body string Required

        Body

      • fromName string Required

        From name

      • fromEmail string Required

        From email

      • status string Required

        Values are draft, pending, or sent.

      • sentAt string(date-time) | null Required

        Sent at

      • updatedAt string(date-time) Required

        Updated at

      • attachments array[string] Required

        Attachments

    • stats object Required

      Message stats schema

      Hide stats attributes Show stats attributes object
      • messageId string Required

        Message ID

      • recipients object Required

        Recipient stats schema

        Hide recipients attribute Show recipients attribute object
        • count integer Required

          Total Count (All exc archived and deleted)

  • 403 application/json

    Not authorized

    Hide response attributes Show response attributes object

    Error schema

    • statusCode number Required

      Status Code

    • messages array[string] Required

      List of error messages

    • exception object

      Exception

  • 422 application/json

    Validation error

    Hide response attributes Show response attributes object
    • statusCode number Required

      Status Code

    • messages array[string] Required

      List of error messages

    • exception object

      Exception

POST /v1/messages/
curl \
 --request POST 'https://classmanager.test/v1/messages/' \
 --header "Content-Type: application/json" \
 --data '{"id":"msg_xxxxxxxxxx","subject":"email","body":"email body","recipientIds":["con_xxxxxxxxxx"],"attachments":["/path/to/file.blah"]}'
Request examples
{
  "id": "msg_xxxxxxxxxx",
  "subject": "email",
  "body": "email body",
  "recipientIds": [
    "con_xxxxxxxxxx"
  ],
  "attachments": [
    "/path/to/file.blah"
  ]
}
Response examples (200)
{
  "entity": {
    "id": "msg_123123123123",
    "companyId": "co_123123123123",
    "type": "staff_invitation",
    "subject": "Happy Birthday",
    "body": "Body",
    "fromName": "John Doe",
    "fromEmail": "sample@example.com",
    "status": "draft",
    "sentAt": "2024-06-12T09:39:49.000000Z",
    "updatedAt": "2024-06-12T09:39:49.000000Z",
    "attachments": [
      "string"
    ]
  },
  "stats": {
    "messageId": "msg_xxxxxxxxxxxxxxxxxxxxxxxxxx",
    "recipients": {
      "count": 10
    }
  }
}
Response examples (403)
{
  "statusCode": 42.0,
  "messages": [
    "string"
  ],
  "exception": {}
}
Response examples (422)
{
  "statusCode": 42.0,
  "messages": [
    "string"
  ],
  "exception": {}
}