Set Sent Folder via API

Nylas API Endpoint Enhancement: Set Sent Folder

3 min read
    Tags:

    End-users with custom IMAP accounts can now set their sent folder manually, so even in the case of language differences where the “Sent” folder is labeled with the word for “Sent” in other languages, your users can now manually set their “Sent” folder to display all sent messages. Previously, Sent folders could be updated manually via the Nylas Dashboard. This means your support team has been doing a great job assigning the Sent folder for your end-users by going into the Nylas dashboard and setting it per their request.

    However, we heard from developers that they’d like to build this functionality into their own applications so end-users can select their own sent folders right inside their CRM. We’ve heard you and taken heed!

    Here’s an example of how to make use of this added functionality. 

    First, make sure that the account is a custom IMAP account. You can do this by making a GET call to the /account endpoint and check the response you receive: if the ‘provider’ attribute is set to ‘custom’, you are good to go.

    Next, make a PUT call to /folders/{id} endpoint which takes a new body parameter: `name`.

    So, say you’d like to set folder ID 41a815dvlgslz7y7dz6c5kbhb as the Sent folder for an account. Make a call like so:

    curl -X PUT \
    
      https://api.nylas.com/folders/41a815dvlgslz7y7dz6c5kbhb \
    
      -H 'Authorization: Basic QU9PR294S3dIdU5nZ2Y4QThWOTQwSGM3alZGWkVlOg==' \
    
      -H 'Content-Type: application/json' \
    
      -H 'cache-control: no-cache' \
    
      -d '{
    
        "name": "Sent"
    
    }'

    This will be especially handy for customers that have IMAP accounts in different languages. For example, if your users are in Sweden, their sent folders are labeled “Skickat”; Nylas may not automatically detect it as the sent folder which means that emails might not automatically appear in the sent folder. We developed this new feature so customers can set their sent folder regardless of the name! For the Swedish end-user, the same call above might look like this:

    curl -X PUT \
    
      https://api.nylas.com/folders/41a815dvlgslz7y7dz6c5kbhb \
    
      -H 'Authorization: Basic QU9PR294S3dIdU5nZ2Y4QThWOTQwSGM3alZGWkVlOg==' \
    
      -H 'Content-Type: application/json' \
    
      -H 'cache-control: no-cache' \
    
      -d '{
    
        "name": "Skickat”"
    
    }'

    Sign up today to get a free API key and try it out, or if you’re already a customer, test out the new features and let us know what you think!

     

    Related resources

    Nylas Ranks on the 2024 Deloitte Technology Fast 500™ for the Third Consecutive Year

    Attributes generative AI advancements, customer-centric innovations, and expanding ecosystem of partnerships to its revenue growth…

    Extract Text from Images with the Nylas OCR Endpoint

    Detect and extract text found within PDFs, TIFFs, and handwritten images with the Nylas Neural API.

    Gain Full Control Over Data Sync with Nylas’ Sync Policy

    Customize your data sync settings with Nylas’ flexible Sync Policy.