Snap widgets

Create Snap Widget

Create a snap widget object.

POST
/snap-widgets.create
AuthorizationBearer <token>

All the DevRev APIs require a token to authenticate the user. Provide Authorization: Bearer <TOKEN> as a header to every API request. How do I find my token?

In: header

An email preview widget.

bcc?array<create-email-info>

The list of bcc addresses.

cc?array<create-email-info>

The list of cc addresses.

from?array<create-email-info>

The list of from addresses.

html_body?string

The html body of the email.

Formattext
in_reply_to?string

The in reply to of the email.

Formattext
inlines?array<create-email-inline-attachment>

The list of inline attachments.

is_spam?boolean

Whether the email is spam.

message_id?string

The message id of the email.

Formattext
raw_email_artifact?string

The raw email artifact.

Formatid
references?array<string>

The list of references in the email.

reply_to?array<create-email-info>

The list of reply to addresses.

sent_timestamp?string

The time the email was sent.

Formatdate-time
subject?string

The subject of the email.

Formattext
text_body?string

The text body of the email.

Formattext
to?array<create-email-info>

The list of to addresses.

A starter message nudge widget.

starter_message_nudge_typecreate-starter-message-nudge-widget-starter-message-nudge-type

Response Body

curl -X POST "https://api.devrev.ai/snap-widgets.create" \  -H "Content-Type: application/json" \  -d '{    "type": "email_preview",    "name": "string"  }'
{
  "snap_widget": {
    "type": "email_preview",
    "created_by": {
      "type": "dev_user",
      "display_id": "string",
      "id": "string",
      "display_name": "string",
      "display_picture": {
        "display_id": "string",
        "id": "string",
        "file": {
          "type": "string",
          "name": "string",
          "size": 0
        }
      },
      "email": "string",
      "full_name": "string",
      "state": "active"
    },
    "created_date": "2023-01-01T12:00:00.000Z",
    "display_id": "string",
    "id": "string",
    "modified_by": {
      "type": "dev_user",
      "display_id": "string",
      "id": "string",
      "display_name": "string",
      "display_picture": {
        "display_id": "string",
        "id": "string",
        "file": {
          "type": "string",
          "name": "string",
          "size": 0
        }
      },
      "email": "string",
      "full_name": "string",
      "state": "active"
    },
    "modified_date": "2023-01-01T12:00:00.000Z",
    "interactions": [
      {
        "type": "click",
        "click_action": "open_plug_widget"
      }
    ],
    "name": "string",
    "namespace": "ai_assistant_message",
    "status": "draft",
    "bcc": [
      {
        "address": "string",
        "name": "string",
        "user": {
          "type": "dev_user",
          "display_id": "string",
          "id": "string",
          "display_name": "string",
          "display_picture": {
            "display_id": "string",
            "id": "string",
            "file": {
              "type": "string",
              "name": "string",
              "size": 0
            }
          },
          "email": "string",
          "full_name": "string",
          "state": "active"
        }
      }
    ],
    "cc": [
      {
        "address": "string",
        "name": "string",
        "user": {
          "type": "dev_user",
          "display_id": "string",
          "id": "string",
          "display_name": "string",
          "display_picture": {
            "display_id": "string",
            "id": "string",
            "file": {
              "type": "string",
              "name": "string",
              "size": 0
            }
          },
          "email": "string",
          "full_name": "string",
          "state": "active"
        }
      }
    ],
    "from": [
      {
        "address": "string",
        "name": "string",
        "user": {
          "type": "dev_user",
          "display_id": "string",
          "id": "string",
          "display_name": "string",
          "display_picture": {
            "display_id": "string",
            "id": "string",
            "file": {
              "type": "string",
              "name": "string",
              "size": 0
            }
          },
          "email": "string",
          "full_name": "string",
          "state": "active"
        }
      }
    ],
    "html_body": "string",
    "in_reply_to": "string",
    "inlines": [
      {
        "artifact": {
          "display_id": "string",
          "id": "string",
          "file": {
            "type": "string",
            "name": "string",
            "size": 0
          }
        },
        "content_id": "string"
      }
    ],
    "is_spam": true,
    "message_id": "string",
    "raw_email_artifact": {
      "display_id": "string",
      "id": "string",
      "file": {
        "type": "string",
        "name": "string",
        "size": 0
      }
    },
    "references": [
      "string"
    ],
    "reply_to": [
      {
        "address": "string",
        "name": "string",
        "user": {
          "type": "dev_user",
          "display_id": "string",
          "id": "string",
          "display_name": "string",
          "display_picture": {
            "display_id": "string",
            "id": "string",
            "file": {
              "type": "string",
              "name": "string",
              "size": 0
            }
          },
          "email": "string",
          "full_name": "string",
          "state": "active"
        }
      }
    ],
    "sent_timestamp": "2023-01-01T12:00:00.000Z",
    "subject": "string",
    "text_body": "string",
    "to": [
      {
        "address": "string",
        "name": "string",
        "user": {
          "type": "dev_user",
          "display_id": "string",
          "id": "string",
          "display_name": "string",
          "display_picture": {
            "display_id": "string",
            "id": "string",
            "file": {
              "type": "string",
              "name": "string",
              "size": 0
            }
          },
          "email": "string",
          "full_name": "string",
          "state": "active"
        }
      }
    ]
  }
}
{
  "detail": "string",
  "message": "string",
  "type": "artifact_already_attached_to_a_parent",
  "existing_parent": "string",
  "is_same": true
}
{
  "detail": "string",
  "message": "string",
  "type": "unauthenticated"
}
{
  "detail": "string",
  "message": "string",
  "type": "forbidden"
}
{
  "detail": "string",
  "message": "string",
  "type": "too_many_requests",
  "retry_after": 0
}
{
  "detail": "string",
  "message": "string",
  "type": "internal_error",
  "reference_id": "string"
}
{
  "detail": "string",
  "message": "string",
  "type": "service_unavailable"
}