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

# Choose which emails to keep

> Off, the default, keeps only campaign emails and their replies. On also imports the other email threads of the workspace's inboxes, the last 30 days first and then each new one, in the background. Turning it off deletes those other conversations from Bavlio; nothing changes in the inboxes.

## OpenAPI

```json
{
  "openapi": "3.2.0",
  "info": {
    "title": "Bavlio API",
    "version": "1.0.0"
  },
  "paths": {
    "/mail/all-messages": {
      "put": {
        "tags": [
          "Email"
        ],
        "operationId": "mail.setMailAllMessages",
        "parameters": [],
        "security": [
          {
            "bearer": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "account": {
                      "anyOf": [
                        {
                          "type": "object",
                          "properties": {
                            "included_in_plan": {
                              "type": "boolean",
                              "description": "True while the workspace's subscription pays for its email, so sending domains and inboxes can be added; false without a subscription."
                            },
                            "all_messages": {
                              "type": "boolean",
                              "description": "True when Bavlio also keeps the emails of the workspace's inboxes outside campaigns; false keeps only campaign emails and their replies."
                            },
                            "message_import": {
                              "anyOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "checked": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 9007199254740991,
                                      "description": "Email threads checked so far."
                                    },
                                    "share": {
                                      "type": "number",
                                      "minimum": 0,
                                      "maximum": 1,
                                      "description": "How much of the import is done, from 0 to 1."
                                    },
                                    "done": {
                                      "type": "boolean",
                                      "description": "True once the import has finished."
                                    }
                                  },
                                  "required": [
                                    "checked",
                                    "share",
                                    "done"
                                  ],
                                  "additionalProperties": false
                                },
                                {
                                  "type": "null"
                                }
                              ],
                              "description": "Progress of importing the last 30 days of other emails after all_messages was turned on, share running from 0 to 1; null while all_messages is off."
                            },
                            "created_at": {
                              "type": "string",
                              "description": "When Bavlio set up the workspace's email, as an ISO 8601 timestamp."
                            }
                          },
                          "required": [
                            "included_in_plan",
                            "all_messages",
                            "message_import",
                            "created_at"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "description": "The workspace's email account, which Bavlio sets up on its own when the workspace is created; null for the minute until it is set up."
                    }
                  },
                  "required": [
                    "account"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "RequestInvalidBody",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RequestInvalidBodyEncoded"
                }
              }
            }
          },
          "401": {
            "description": "AuthMissing | AuthInvalid",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/AuthMissingEncoded"
                    },
                    {
                      "$ref": "#/components/schemas/AuthInvalidEncoded"
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "WorkspaceNotFound",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkspaceNotFoundEncoded"
                }
              }
            }
          },
          "409": {
            "description": "MailAccountOpening",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MailAccountOpeningEncoded"
                }
              }
            }
          }
        },
        "description": "Off, the default, keeps only campaign emails and their replies. On also imports the other email threads of the workspace's inboxes, the last 30 days first and then each new one, in the background. Turning it off deletes those other conversations from Bavlio; nothing changes in the inboxes.",
        "summary": "Choose which emails to keep",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "all_messages": {
                    "type": "boolean",
                    "description": "true: the inbox also keeps the account's conversations outside campaigns (scope other), its recent ones first, then every new message. false: it keeps only campaign conversations and deletes the account's other conversations from Bavlio; nothing changes on LinkedIn or in the mailbox."
                  }
                },
                "required": [
                  "all_messages"
                ],
                "additionalProperties": false
              }
            }
          },
          "required": true
        }
      }
    }
  },
  "components": {
    "schemas": {
      "RequestInvalidBodyEncoded": {
        "type": "object",
        "properties": {
          "_tag": {
            "type": "string",
            "enum": [
              "RequestInvalidBody"
            ]
          },
          "statusCode": {
            "type": "number",
            "enum": [
              400
            ]
          },
          "code": {
            "type": "string",
            "enum": [
              "invalid_body"
            ]
          },
          "message": {
            "type": "string"
          }
        },
        "required": [
          "_tag",
          "statusCode",
          "code",
          "message"
        ],
        "additionalProperties": false
      },
      "AuthInvalidEncoded": {
        "type": "object",
        "properties": {
          "_tag": {
            "type": "string",
            "enum": [
              "AuthInvalid"
            ]
          },
          "statusCode": {
            "type": "number",
            "enum": [
              401
            ]
          },
          "code": {
            "type": "string",
            "enum": [
              "auth_invalid"
            ]
          },
          "message": {
            "type": "string",
            "enum": [
              "Bearer credential rejected"
            ]
          }
        },
        "required": [
          "_tag",
          "statusCode",
          "code",
          "message"
        ],
        "additionalProperties": false
      },
      "AuthMissingEncoded": {
        "type": "object",
        "properties": {
          "_tag": {
            "type": "string",
            "enum": [
              "AuthMissing"
            ]
          },
          "statusCode": {
            "type": "number",
            "enum": [
              401
            ]
          },
          "code": {
            "type": "string",
            "enum": [
              "auth_missing"
            ]
          },
          "message": {
            "type": "string",
            "enum": [
              "Bearer credential required"
            ]
          }
        },
        "required": [
          "_tag",
          "statusCode",
          "code",
          "message"
        ],
        "additionalProperties": false
      },
      "WorkspaceNotFoundEncoded": {
        "type": "object",
        "properties": {
          "_tag": {
            "type": "string",
            "enum": [
              "WorkspaceNotFound"
            ]
          },
          "statusCode": {
            "type": "number",
            "enum": [
              404
            ]
          },
          "code": {
            "type": "string",
            "enum": [
              "workspace_not_found"
            ]
          },
          "message": {
            "type": "string",
            "enum": [
              "No such workspace for this account: save a company profile or pick a workspace you belong to"
            ]
          }
        },
        "required": [
          "_tag",
          "statusCode",
          "code",
          "message"
        ],
        "additionalProperties": false
      },
      "MailAccountOpeningEncoded": {
        "type": "object",
        "properties": {
          "_tag": {
            "type": "string",
            "enum": [
              "MailAccountOpening"
            ]
          },
          "statusCode": {
            "type": "number",
            "enum": [
              409
            ]
          },
          "code": {
            "type": "string",
            "enum": [
              "mail_account_opening"
            ]
          },
          "message": {
            "type": "string",
            "enum": [
              "Bavlio is still setting up email for this workspace: try again in a minute"
            ]
          }
        },
        "required": [
          "_tag",
          "statusCode",
          "code",
          "message"
        ],
        "additionalProperties": false
      }
    },
    "securitySchemes": {
      "bearer": {
        "description": "Send `Authorization: Bearer <token>`. The token is an API key, which starts with `bav_` and comes from creating an API key or starting a registration, or the access token of a Bavlio sign-in.",
        "type": "http",
        "scheme": "Bearer"
      }
    }
  },
  "security": [],
  "tags": [
    {
      "name": "Registration",
      "description": "Open a Bavlio account without signing in. Starting a registration returns an API key for a new ephemeral account, which becomes permanent once its email address is verified."
    },
    {
      "name": "Authentication",
      "description": "Identify the calling account, finish a registration and manage the account's API keys."
    },
    {
      "name": "Account",
      "description": "The account behind your sign-in, and deleting it."
    },
    {
      "name": "Workspaces",
      "description": "A workspace holds the company profile, outreach schedule, team, campaigns and billing Bavlio works with. Calls that act in a workspace use the one whose id is in the bavlio-workspace header, or the account's default workspace when the header is absent."
    },
    {
      "name": "Teams",
      "description": "Manage who belongs to a workspace: its members, their roles and the invitations to join it. Each workspace's plan sets how many team seats it has."
    },
    {
      "name": "Campaigns",
      "description": "A campaign finds leads that match an ideal customer profile (ICP) and buying signals, and reaches out to them through its sequence of LinkedIn and email steps."
    },
    {
      "name": "Companies",
      "description": "Companies on LinkedIn, to pick as the competitors whose engaged audience a campaign watches."
    },
    {
      "name": "Do not contact",
      "description": "Companies and people the workspace's campaigns never reach, such as existing customers and partners. Every campaign checks the list before it adds a lead and before every step it sends."
    },
    {
      "name": "Lead imports",
      "description": "Bring your own leads: preview a CSV, confirm which column holds what, then import it into a campaign, where the leads go through the same sequence as the ones Bavlio finds."
    },
    {
      "name": "Sequences",
      "description": "A campaign's sequence is the steps Bavlio runs for each lead: profile visits, likes, invites, LinkedIn messages, emails, waits, conditions and A/B tests. Every message and email waits in the review queue for approval before it is sent."
    },
    {
      "name": "Inbox",
      "description": "Conversations with the people your campaigns reached and, for accounts that opt in, your other LinkedIn and email conversations: read them, reply to them and follow changes live."
    },
    {
      "name": "Reviews",
      "description": "Messages and emails go to a lead only after someone approves them. The review queue holds the replies Bavlio drafted for people who answered and the messages and emails it drafted for campaign sequences."
    },
    {
      "name": "Billing",
      "description": "The plans and add-ons on offer and the workspace's subscription and usage. Plan changes, add-ons, top-ups, cancellation and the billing portal need the workspace owner or an admin."
    },
    {
      "name": "LinkedIn",
      "description": "Connect the LinkedIn accounts your campaigns send from, confirm their sign-ins, choose the country LinkedIn sees them from, and disconnect them."
    },
    {
      "name": "Meetings",
      "description": "Meetings booked through the workspace's calendar tool (Google Calendar, Calendly or Cal.com), and the calendar connection that imports them."
    },
    {
      "name": "Email",
      "description": "The workspace's email, which Bavlio sets up on its own: add sending domains and tracking domains, and create the inboxes campaigns send email from, up to the plan's inbox seats."
    },
    {
      "name": "Locations",
      "description": "Places to aim a campaign at, from a continent down to a city. Country, state and city names come from the Countries States Cities Database (https://github.com/dr5hn/countries-states-cities-database), made available under the Open Database License (ODbL) 1.0; continents from countries-list."
    }
  ],
  "servers": [
    {
      "url": "https://api.bavlio.com"
    }
  ]
}
```
