Skip to content

Drafts

6 endpoints

Email draft management

GET /accounts/{accountId}/drafts

Get drafts for an account

Get a paginated list of email drafts for a specific account

Parameters

accountId string

In path Required

Unique account identifier assigned by Riposte. You may also provide the custom user ID set during authentication; the API resolves it to the canonical account.


                        acct_123456789
                      
Additional parameters
page string

In query Optional

1-indexed page number to return when using offset pagination.


                            1
                          
limit string

In query Optional

Maximum number of items to include per page.


                            50
                          
pageToken string

In query Optional

Opaque token returned from a previous request for page-based pagination.


                            WyJjdXJzb3IiLCIxMjM0Il0=
                          
cursor string

In query Optional

Cursor identifier returned from a previous response when using cursor-based pagination.


                            cursor_2024-02-15T10:00:00Z
                          

Returns

Paginated list of drafts stored for an account.

Content type: application/json

Status: 200

Example request
                
                    
                    curl -X GET "http://localhost:8080/accounts/{accountId}/drafts"
                  
              
Example response 200

              {
  "drafts": [
    {
      "id": "draft_01HZVBFQ1ZPQF52TJPMM4P5N3S",
      "subject": "Product launch follow-up"
    }
  ],
  "pagination": {
    "page": 1,
    "limit": 50,
    "total": 5,
    "totalPages": 1,
    "hasNext": false,
    "hasPrev": false
  }
}
            

POST /accounts/{id}/drafts

Create draft through account

Create an email draft using the specified account

Parameters

id string

In path Required

Unique account identifier assigned by Riposte. You may also provide the custom user ID set during authentication; the API resolves it to the canonical account.


                        acct_123456789
                      

Request body

Required • application/json

Simplified payload for sending a message using default account settings.

Request body (application/json)

post-/accounts/{id}/drafts-request-body-application/json

object<{ to, cc, bcc, … }>

Simplified payload for sending a message using default account settings.

Field Type Description Values
bcc Optional array<string> Optional BCC recipients hidden from other recipients.
Example [ "[email protected]" ]
body Required string Message body formatted as either plain text or HTML.
min length 1
Example Hi there, Thanks for signing up!
cc Optional array<string> Optional CC recipients.
Example [ "[email protected]" ]
isHtml Optional boolean Indicates whether the body content is HTML.
Example false
subject Required string Email subject line.
min length 1
Example Welcome to Riposte
to Required array<string> Primary recipients for the message.
Example [ "[email protected]" ]

Returns

Default Response

Content type: application/json

Status: 200

Example request
                
                    
                    curl -X POST "http://localhost:8080/accounts/{id}/drafts" \
                  
                    
                      -H "Content-Type: application/json" \
                  
                    
                      --data @- <<'BODY'
                  
                    
                    {
                  
                    
                      "to": [
                  
                    
                        "[email protected]"
                  
                    
                      ],
                  
                    
                      "subject": "Welcome to Riposte",
                  
                    
                      "body": "Hi there,\n\nThanks for signing up!",
                  
                    
                      "isHtml": false
                  
                    
                    }
                  
                    
                    BODY
                  
              
Example response 200

No example response available.


POST /drafts

Create a new draft

Create a new email draft

Parameters

This endpoint does not accept parameters.

Request body

Required • application/json

Create a new draft message stored on the Riposte platform.

Request body (application/json)

post-/drafts-request-body-application/json

object<{ accountId, to, cc, … }>

Create a new draft message stored on the Riposte platform.

Field Type Description Values
accountId Required string Identifier of the account that will own the draft.
min length 1
Example acct_123456789
bcc Optional array<string> Optional BCC recipients.
Example [ "[email protected]" ]
body Required string Body content for the draft message.
min length 1
Example Thanks for meeting with us today...
cc Optional array<string> Optional CC recipients.
Example [ "[email protected]" ]
isHtml Optional boolean Indicates whether the body content is HTML.
Example true
subject Required string Subject line to store with the draft.
min length 1
Example Follow-up meeting notes
to Required array<string> Primary recipients for the draft.
Example [ "[email protected]" ]

Returns

Representation of a stored draft message.

Content type: application/json

Status: 200

Example request
                
                    
                    curl -X POST "http://localhost:8080/drafts" \
                  
                    
                      -H "Content-Type: application/json" \
                  
                    
                      --data @- <<'BODY'
                  
                    
                    {
                  
                    
                      "accountId": "acct_123456789",
                  
                    
                      "to": [
                  
                    
                        "[email protected]"
                  
                    
                      ],
                  
                    
                      "subject": "Follow-up meeting notes",
                  
                    
                      "body": "<p>Thanks for meeting with us today...</p>",
                  
                    
                      "isHtml": true
                  
                    
                    }
                  
                    
                    BODY
                  
              
Example response 200

              {
  "id": "draft_01HZVBFQ1ZPQF52TJPMM4P5N3S",
  "accountId": "acct_123456789",
  "to": [
    "[email protected]"
  ],
  "subject": "Product launch follow-up",
  "body": "<p>Thanks again for your time today...</p>",
  "isHtml": true,
  "providerDraftId": "r-2ec5adf9d4f381d4",
  "createdAt": "2024-06-11T09:15:00.000Z",
  "updatedAt": "2024-06-11T10:05:00.000Z"
}
            

DELETE /drafts/{id}

Delete a draft

Delete an email draft

Parameters

id string

In path Required

Unique account identifier assigned by Riposte. You may also provide the custom user ID set during authentication; the API resolves it to the canonical account.


                        draft_01HZVBFQ1ZPQF52TJPMM4P5N3S
                      

Returns

Generic success wrapper for endpoints that simply confirm completion.

Content type: application/json

Status: 200

Example request
                
                    
                    curl -X DELETE "http://localhost:8080/drafts/{id}"
                  
              
Example response 200

              {
  "success": true,
  "message": "Account paused successfully."
}
            

GET /drafts/{id}

Get a specific draft

Retrieve a specific email draft by ID

Parameters

id string

In path Required

Unique account identifier assigned by Riposte. You may also provide the custom user ID set during authentication; the API resolves it to the canonical account.


                        draft_01HZVBFQ1ZPQF52TJPMM4P5N3S
                      

Returns

Representation of a stored draft message.

Content type: application/json

Status: 200

Example request
                
                    
                    curl -X GET "http://localhost:8080/drafts/{id}"
                  
              
Example response 200

              {
  "id": "draft_01HZVBFQ1ZPQF52TJPMM4P5N3S",
  "accountId": "acct_123456789",
  "to": [
    "[email protected]"
  ],
  "subject": "Product launch follow-up",
  "body": "<p>Thanks again for your time today...</p>",
  "isHtml": true,
  "providerDraftId": "r-2ec5adf9d4f381d4",
  "createdAt": "2024-06-11T09:15:00.000Z",
  "updatedAt": "2024-06-11T10:05:00.000Z"
}
            

PUT /drafts/{id}

Update a draft

Update an existing email draft

Parameters

id string

In path Required

Unique account identifier assigned by Riposte. You may also provide the custom user ID set during authentication; the API resolves it to the canonical account.


                        draft_01HZVBFQ1ZPQF52TJPMM4P5N3S
                      

Request body

Optional • application/json

Partial update payload for modifying a draft message.

Request body (application/json)

put-/drafts/{id}-request-body-application/json

object<{ to, cc, bcc, … }>

Partial update payload for modifying a draft message.

Field Type Description Values
bcc Optional array<string> Replace the list of BCC recipients.
Example [ "[email protected]" ]
body Optional string Updated body content for the draft.
Example Here are the revised next steps...
cc Optional array<string> Replace the list of CC recipients.
Example [ "[email protected]" ]
isHtml Optional boolean Toggle whether the body should be treated as HTML.
Example true
subject Optional string Updated subject for the draft.
Example Updated follow-up notes
to Optional array<string> Replace the list of primary recipients.
Example [ "[email protected]" ]

Returns

Representation of a stored draft message.

Content type: application/json

Status: 200

Example request
                
                    
                    curl -X PUT "http://localhost:8080/drafts/{id}" \
                  
                    
                      -H "Content-Type: application/json" \
                  
                    
                      --data @- <<'BODY'
                  
                    
                    {
                  
                    
                      "subject": "Updated follow-up notes",
                  
                    
                      "body": "Here are the revised next steps..."
                  
                    
                    }
                  
                    
                    BODY
                  
              
Example response 200

              {
  "id": "draft_01HZVBFQ1ZPQF52TJPMM4P5N3S",
  "accountId": "acct_123456789",
  "to": [
    "[email protected]"
  ],
  "subject": "Product launch follow-up",
  "body": "<p>Thanks again for your time today...</p>",
  "isHtml": true,
  "providerDraftId": "r-2ec5adf9d4f381d4",
  "createdAt": "2024-06-11T09:15:00.000Z",
  "updatedAt": "2024-06-11T10:05:00.000Z"
}