BotreamDocs Website Türkçe v0.1.1

Email & API commands

mail · restapi

mail Mail

Sends email (SMTP) and works with a mailbox (IMAP): read lists messages as records; their Id is what saveattachments, move, delete and markread take. The account (user name and password) comes from a vault credential: choose --vault and --credential.

Parameters of every variant

ParameterValueDefaultDescription
--retrynumberNumber of retry attempts. When not set, screen and file commands try once more after a passing problem (a page still loading, a covered element, a locked file); 0 turns that off
--retryintervalnumber1Seconds between retries

Actions (--action)

--action:send

Sends a message through an SMTP server. A failed send is not repeated by --retry once the server may have taken the message.

ParameterValueDefaultDescription
--smtp requiredtextSMTP server, e.g. smtp.gmail.com or smtp.office365.com
--port requirednumber587 (STARTTLS, usual), 465 (TLS) or 25 (internal relays)
--vaulttextVault that holds the mail account (Vaults page); --credential is then the name of the credential in it
--credentialany valueThe mail account: the name of a credential in --vault (its user name and password, kept on the Vaults page), or a credential variable ($cred$). Gmail, Outlook.com and Yahoo need an app password; with --authtype:oauth2 the credential is the app registration (client id / client secret). Leave empty for a relay that takes mail without signing in
--from requiredtextSender address, e.g. bot@company.com or "Robot <bot@company.com>"
--to requiredtextRecipients, separated by , or ;
--cctextCopy recipients, separated by , or ;
--bcctextBlind copy recipients, separated by , or ;
--replytotextAddress that replies go to, when not the sender
--subject requiredtext
--body requiredtext
--bodytypeone of text, htmltext
--attachmenttextFile paths, separated by , or ; A file on the agent machine.
--priorityone of low, normal, highnormalImportance shown by mail programs
--securityone of auto, ssl, starttls, noneautoauto: TLS on ports 465/993, STARTTLS when the server offers it on other ports (a password is never sent unencrypted); ssl: TLS from the start; starttls: must switch to TLS; none: unencrypted (internal servers only)
--ssltrue / falseOlder form of --security: false = none, true = TLS or STARTTLS (--security wins when both are set)
--timeoutnumber60Seconds to wait for the mail server before giving up
--ignoresslerrorstrue / falsefalseAccept any server certificate (internal servers with a self-signed certificate); keep false for public servers
--authtypeone of password, oauth2, nonepassword: sign in with the credential; none: send without signing in (relays); oauth2: Microsoft 365 sign-in with an app registration (IMAP.AccessAsApp / SMTP.SendAsApp), for mailboxes where password sign-in is switched off. When not set: password when --credential is set, otherwise none
--tenanttextoauth2: the Microsoft 365 directory, e.g. contoso.onmicrosoft.com or its id
--mailboxtextoauth2: the address whose mailbox is used (send: the --from address when empty)
--action:read

Messages of a folder, newest first, as a list of records (Id, From, FromName, To, Cc, Subject, Date, Body, HtmlBody, IsRead, Attachments).

ParameterValueDefaultDescription
--server requiredtextIMAP server, e.g. imap.gmail.com or outlook.office365.com
--portnumber993993 for TLS (usual), 143 for STARTTLS or unencrypted
--vaulttextVault that holds the mail account (Vaults page); --credential is then the name of the credential in it
--credential requiredany valueThe mail account: the name of a credential in --vault (its user name and password, kept on the Vaults page), or a credential variable ($cred$). Gmail, Outlook.com and Yahoo need an app password; with --authtype:oauth2 the credential is the app registration (client id / client secret)
--securityone of auto, ssl, starttls, noneautoauto: TLS on ports 465/993, STARTTLS when the server offers it on other ports (a password is never sent unencrypted); ssl: TLS from the start; starttls: must switch to TLS; none: unencrypted (internal servers only)
--ssltrue / falseOlder form of --security: false = none, true = TLS or STARTTLS (--security wins when both are set)
--timeoutnumber60Seconds to wait for the mail server before giving up
--ignoresslerrorstrue / falsefalseAccept any server certificate (internal servers with a self-signed certificate); keep false for public servers
--authtypeone of password, oauth2passwordoauth2: Microsoft 365 sign-in with an app registration (IMAP.AccessAsApp / SMTP.SendAsApp), for mailboxes where password sign-in is switched off
--tenanttextoauth2: the Microsoft 365 directory, e.g. contoso.onmicrosoft.com or its id
--mailboxtextoauth2: the address whose mailbox is used (send: the --from address when empty)
--foldertextINBOXMail folder, e.g. INBOX or Processed (mail --action:folders lists them)
--unreadtrue / falsetrueOnly unread messages
--fromtextOnly messages whose sender contains this
--totextOnly messages whose recipients contain this
--subjecttextOnly messages whose subject contains this
--bodytextOnly messages whose text contains this
--sinceany valueOnly messages received on or after this date
--beforeany valueOnly messages received before this date
--hasattachmentstrue / falsetrue: only messages with attachments; false: only messages without
--maxnumber50At most this many messages
--markreadtrue / falsefalseMark the returned messages as read
--output requiredvariable nameVariable that receives the result
--action:count

Number of messages in a folder that match the same filters as read (default: the unread ones).

ParameterValueDefaultDescription
--server requiredtextIMAP server, e.g. imap.gmail.com or outlook.office365.com
--portnumber993993 for TLS (usual), 143 for STARTTLS or unencrypted
--vaulttextVault that holds the mail account (Vaults page); --credential is then the name of the credential in it
--credential requiredany valueThe mail account: the name of a credential in --vault (its user name and password, kept on the Vaults page), or a credential variable ($cred$). Gmail, Outlook.com and Yahoo need an app password; with --authtype:oauth2 the credential is the app registration (client id / client secret)
--securityone of auto, ssl, starttls, noneautoauto: TLS on ports 465/993, STARTTLS when the server offers it on other ports (a password is never sent unencrypted); ssl: TLS from the start; starttls: must switch to TLS; none: unencrypted (internal servers only)
--ssltrue / falseOlder form of --security: false = none, true = TLS or STARTTLS (--security wins when both are set)
--timeoutnumber60Seconds to wait for the mail server before giving up
--ignoresslerrorstrue / falsefalseAccept any server certificate (internal servers with a self-signed certificate); keep false for public servers
--authtypeone of password, oauth2passwordoauth2: Microsoft 365 sign-in with an app registration (IMAP.AccessAsApp / SMTP.SendAsApp), for mailboxes where password sign-in is switched off
--tenanttextoauth2: the Microsoft 365 directory, e.g. contoso.onmicrosoft.com or its id
--mailboxtextoauth2: the address whose mailbox is used (send: the --from address when empty)
--foldertextINBOXMail folder, e.g. INBOX or Processed (mail --action:folders lists them)
--unreadtrue / falsetrueOnly unread messages
--fromtextOnly messages whose sender contains this
--totextOnly messages whose recipients contain this
--subjecttextOnly messages whose subject contains this
--bodytextOnly messages whose text contains this
--sinceany valueOnly messages received on or after this date
--beforeany valueOnly messages received before this date
--hasattachmentstrue / falsetrue: only messages with attachments; false: only messages without
--output requiredvariable nameVariable that receives the result
--action:folders

The full names of the mail folders of the account (e.g. INBOX, Archive/2024), as a list.

ParameterValueDefaultDescription
--server requiredtextIMAP server, e.g. imap.gmail.com or outlook.office365.com
--portnumber993993 for TLS (usual), 143 for STARTTLS or unencrypted
--vaulttextVault that holds the mail account (Vaults page); --credential is then the name of the credential in it
--credential requiredany valueThe mail account: the name of a credential in --vault (its user name and password, kept on the Vaults page), or a credential variable ($cred$). Gmail, Outlook.com and Yahoo need an app password; with --authtype:oauth2 the credential is the app registration (client id / client secret)
--securityone of auto, ssl, starttls, noneautoauto: TLS on ports 465/993, STARTTLS when the server offers it on other ports (a password is never sent unencrypted); ssl: TLS from the start; starttls: must switch to TLS; none: unencrypted (internal servers only)
--ssltrue / falseOlder form of --security: false = none, true = TLS or STARTTLS (--security wins when both are set)
--timeoutnumber60Seconds to wait for the mail server before giving up
--ignoresslerrorstrue / falsefalseAccept any server certificate (internal servers with a self-signed certificate); keep false for public servers
--authtypeone of password, oauth2passwordoauth2: Microsoft 365 sign-in with an app registration (IMAP.AccessAsApp / SMTP.SendAsApp), for mailboxes where password sign-in is switched off
--tenanttextoauth2: the Microsoft 365 directory, e.g. contoso.onmicrosoft.com or its id
--mailboxtextoauth2: the address whose mailbox is used (send: the --from address when empty)
--output requiredvariable nameVariable that receives the result
--action:saveattachments

Saves the attachments of a message into a folder; --output receives the list of files.

ParameterValueDefaultDescription
--server requiredtextIMAP server, e.g. imap.gmail.com or outlook.office365.com
--portnumber993993 for TLS (usual), 143 for STARTTLS or unencrypted
--vaulttextVault that holds the mail account (Vaults page); --credential is then the name of the credential in it
--credential requiredany valueThe mail account: the name of a credential in --vault (its user name and password, kept on the Vaults page), or a credential variable ($cred$). Gmail, Outlook.com and Yahoo need an app password; with --authtype:oauth2 the credential is the app registration (client id / client secret)
--securityone of auto, ssl, starttls, noneautoauto: TLS on ports 465/993, STARTTLS when the server offers it on other ports (a password is never sent unencrypted); ssl: TLS from the start; starttls: must switch to TLS; none: unencrypted (internal servers only)
--ssltrue / falseOlder form of --security: false = none, true = TLS or STARTTLS (--security wins when both are set)
--timeoutnumber60Seconds to wait for the mail server before giving up
--ignoresslerrorstrue / falsefalseAccept any server certificate (internal servers with a self-signed certificate); keep false for public servers
--authtypeone of password, oauth2passwordoauth2: Microsoft 365 sign-in with an app registration (IMAP.AccessAsApp / SMTP.SendAsApp), for mailboxes where password sign-in is switched off
--tenanttextoauth2: the Microsoft 365 directory, e.g. contoso.onmicrosoft.com or its id
--mailboxtextoauth2: the address whose mailbox is used (send: the --from address when empty)
--foldertextINBOXMail folder, e.g. INBOX or Processed (mail --action:folders lists them)
--id requiredany valueId of a message from mail read, e.g. $message.Id$ (valid in the folder it was read from)
--destination requiredtextFolder for the files (existing files are kept; a number is added to the name) A folder on the agent machine.
--filtertext*File name pattern, e.g. *.pdf
--outputvariable nameVariable that receives the result
--action:move
ParameterValueDefaultDescription
--server requiredtextIMAP server, e.g. imap.gmail.com or outlook.office365.com
--portnumber993993 for TLS (usual), 143 for STARTTLS or unencrypted
--vaulttextVault that holds the mail account (Vaults page); --credential is then the name of the credential in it
--credential requiredany valueThe mail account: the name of a credential in --vault (its user name and password, kept on the Vaults page), or a credential variable ($cred$). Gmail, Outlook.com and Yahoo need an app password; with --authtype:oauth2 the credential is the app registration (client id / client secret)
--securityone of auto, ssl, starttls, noneautoauto: TLS on ports 465/993, STARTTLS when the server offers it on other ports (a password is never sent unencrypted); ssl: TLS from the start; starttls: must switch to TLS; none: unencrypted (internal servers only)
--ssltrue / falseOlder form of --security: false = none, true = TLS or STARTTLS (--security wins when both are set)
--timeoutnumber60Seconds to wait for the mail server before giving up
--ignoresslerrorstrue / falsefalseAccept any server certificate (internal servers with a self-signed certificate); keep false for public servers
--authtypeone of password, oauth2passwordoauth2: Microsoft 365 sign-in with an app registration (IMAP.AccessAsApp / SMTP.SendAsApp), for mailboxes where password sign-in is switched off
--tenanttextoauth2: the Microsoft 365 directory, e.g. contoso.onmicrosoft.com or its id
--mailboxtextoauth2: the address whose mailbox is used (send: the --from address when empty)
--foldertextINBOXMail folder, e.g. INBOX or Processed (mail --action:folders lists them)
--id requiredany valueId of a message from mail read, e.g. $message.Id$ (valid in the folder it was read from)
--target requiredtextMail folder to move the message to, e.g. Processed
--action:delete
ParameterValueDefaultDescription
--server requiredtextIMAP server, e.g. imap.gmail.com or outlook.office365.com
--portnumber993993 for TLS (usual), 143 for STARTTLS or unencrypted
--vaulttextVault that holds the mail account (Vaults page); --credential is then the name of the credential in it
--credential requiredany valueThe mail account: the name of a credential in --vault (its user name and password, kept on the Vaults page), or a credential variable ($cred$). Gmail, Outlook.com and Yahoo need an app password; with --authtype:oauth2 the credential is the app registration (client id / client secret)
--securityone of auto, ssl, starttls, noneautoauto: TLS on ports 465/993, STARTTLS when the server offers it on other ports (a password is never sent unencrypted); ssl: TLS from the start; starttls: must switch to TLS; none: unencrypted (internal servers only)
--ssltrue / falseOlder form of --security: false = none, true = TLS or STARTTLS (--security wins when both are set)
--timeoutnumber60Seconds to wait for the mail server before giving up
--ignoresslerrorstrue / falsefalseAccept any server certificate (internal servers with a self-signed certificate); keep false for public servers
--authtypeone of password, oauth2passwordoauth2: Microsoft 365 sign-in with an app registration (IMAP.AccessAsApp / SMTP.SendAsApp), for mailboxes where password sign-in is switched off
--tenanttextoauth2: the Microsoft 365 directory, e.g. contoso.onmicrosoft.com or its id
--mailboxtextoauth2: the address whose mailbox is used (send: the --from address when empty)
--foldertextINBOXMail folder, e.g. INBOX or Processed (mail --action:folders lists them)
--id requiredany valueId of a message from mail read, e.g. $message.Id$ (valid in the folder it was read from)
--action:markread
ParameterValueDefaultDescription
--server requiredtextIMAP server, e.g. imap.gmail.com or outlook.office365.com
--portnumber993993 for TLS (usual), 143 for STARTTLS or unencrypted
--vaulttextVault that holds the mail account (Vaults page); --credential is then the name of the credential in it
--credential requiredany valueThe mail account: the name of a credential in --vault (its user name and password, kept on the Vaults page), or a credential variable ($cred$). Gmail, Outlook.com and Yahoo need an app password; with --authtype:oauth2 the credential is the app registration (client id / client secret)
--securityone of auto, ssl, starttls, noneautoauto: TLS on ports 465/993, STARTTLS when the server offers it on other ports (a password is never sent unencrypted); ssl: TLS from the start; starttls: must switch to TLS; none: unencrypted (internal servers only)
--ssltrue / falseOlder form of --security: false = none, true = TLS or STARTTLS (--security wins when both are set)
--timeoutnumber60Seconds to wait for the mail server before giving up
--ignoresslerrorstrue / falsefalseAccept any server certificate (internal servers with a self-signed certificate); keep false for public servers
--authtypeone of password, oauth2passwordoauth2: Microsoft 365 sign-in with an app registration (IMAP.AccessAsApp / SMTP.SendAsApp), for mailboxes where password sign-in is switched off
--tenanttextoauth2: the Microsoft 365 directory, e.g. contoso.onmicrosoft.com or its id
--mailboxtextoauth2: the address whose mailbox is used (send: the --from address when empty)
--foldertextINBOXMail folder, e.g. INBOX or Processed (mail --action:folders lists them)
--id requiredany valueId of a message from mail read, e.g. $message.Id$ (valid in the folder it was read from)
--readtrue / falsetruefalse marks the message as unread

Examples

mail --action:send --smtp:"smtp.gmail.com" --port:587 --vault:"Mail" --credential:"Robot mailbox" --from:"bot@company.com" --to:"admin@company.com" --cc:"manager@company.com" --subject:"RPA Report" --body:$reportContent$ --bodytype:html --attachment:"C:\report.pdf"
mail --action:send --smtp:"relay.company.local" --port:25 --authtype:none --from:"bot@company.com" --to:"team@company.com; boss@company.com" --replyto:"help@company.com" --priority:high --subject:"Done" --body:"All invoices are booked"
mail --action:read --server:"imap.gmail.com" --vault:"Mail" --credential:"Robot mailbox" --subject:"Invoice" --since:$yesterday$ --hasattachments:true --max:20 --output:messages
mail --action:count --server:"imap.gmail.com" --vault:"Mail" --credential:"Robot mailbox" --output:unreadCount
mail --action:folders --server:"imap.gmail.com" --vault:"Mail" --credential:"Robot mailbox" --output:folders
mail --action:saveattachments --server:"imap.gmail.com" --credential:$mailCred$ --id:$message.Id$ --destination:"C:\Inbox" --filter:"*.pdf" --output:files
mail --action:move --server:"imap.gmail.com" --credential:$mailCred$ --id:$message.Id$ --target:"Processed"
mail --action:markread --server:"imap.gmail.com" --credential:$mailCred$ --id:$message.Id$
mail --action:delete --server:"imap.gmail.com" --credential:$mailCred$ --id:$message.Id$

restapi REST API

Makes an HTTP request; the response is stored as a record variable.

Parameters of every variant

ParameterValueDefaultDescription
--url requiredtext
--querytextQuery string as comma-separated name=value pairs, e.g. page=1,search=$term$ (URL-encoded for you)
--headerstextComma-separated Key=Value pairs
--bodyany value
--bodytypeone of json, xml, text, formdata, urlencodedjson
--filetextFile to upload (formdata) A file on the agent machine.
--savetotextDownload: save the response to this file instead of reading it (the record then has File; an error answer stays in Body) A file on the agent machine.
--credential$variable$
--authtypeone of basic, bearer, apikey
--apikeytextX-API-KeyAPI key header name
--outputvariable nameVariable that receives the result
--timeoutnumber30Timeout in seconds
--retrynumberNumber of retry attempts. When not set, screen and file commands try once more after a passing problem (a page still loading, a covered element, a locked file); 0 turns that off
--retryintervalnumber1Seconds between retries
--followredirectstrue / falsetrue
--ignoresslerrorstrue / falsefalse

Actions (--action)

--action:get

No further parameters.

--action:post

No further parameters.

--action:put

No further parameters.

--action:delete

No further parameters.

--action:patch

No further parameters.

--action:head

No further parameters.

--action:options

No further parameters.

Examples

restapi --action:get --url:"https://api.example.com/orders" --query:"status=open,page=1" --output:response
json --action:getvalue --source:$response.Json$ --path:"data.orders[0].customer.name" --output:name
json --action:getvalue --source:$response.Json$ --path:"data.total" --default:0 --output:total
json --action:count --source:$response.Json$ --path:"data.orders" --output:orderCount
json --action:todatatable --source:$response.Json$ --path:"data.orders" --output:orders
json --action:parse --text:$response.Body$ --output:doc
json --action:readfile --file:"C:\config.json" --output:config
json --action:setvalue --name:request --path:"customer.id" --value:42
json --action:setvalue --name:request --path:"items[0].sku" --value:"A-1"
json --action:remove --name:request --path:"draft"
json --action:stringify --source:$request$ --output:body
json --action:writefile --source:$request$ --file:"C:\out\request.json"
json --action:keys --source:$config$ --output:names
restapi --action:get --url:"https://api.example.com/users" --headers:"Content-Type=application/json,Authorization=Bearer $token$" --output:response
restapi --action:post --url:"https://api.example.com/users" --headers:"Content-Type=application/json" --body:$jsonBody$ --output:response
restapi --action:put --url:"https://api.example.com/users/1" --headers:"Content-Type=application/json" --body:$updateData$ --output:response
restapi --action:delete --url:"https://api.example.com/users/1" --headers:"Authorization=Bearer $token$" --output:response
restapi --action:patch --url:"https://api.example.com/users/1" --headers:"Content-Type=application/json" --body:$patchData$ --output:response
restapi --action:post --url:"https://api.example.com/upload" --bodytype:formdata --file:"C:\report.pdf" --output:response
restapi --action:post --url:"https://secure-api.com/data" --credential:$apiCred$ --authtype:basic --body:$payload$ --output:response
Botream 0.1.1 · Generated 2026-10-14