openemail files
Bu ad alanındaki her komut; argümanları, bayrakları ve örnekleriyle.
Komutlar
Every attachment the mailbox holds, sent and received, and the files uploaded to it, with their bytes, the download links they went out as and whether each can be deleted.
Buradaki her komut --json, --profile ve --dry-run gibi genel bayrakları da alır. Genel bayraklara bakın
openemail files list
List one page of the files the mailbox holds
lsKullanım
openemail files list [flags]
Resolves one page of the Files page: every attachment the mailbox holds, sent and received, and every file uploaded to it, with its name, type, size, the address it came to, the thread it belongs to and whether it can be deleted.
Only an upload that nothing depends on can be deleted, and its deletable is true. Every other row has a usage saying what keeps it: received, sent, linked for an upload that went out as a download link that still works, or scheduled for one attached to a message that has not gone out yet.
A key limited to particular addresses or domains sees only the files that arrived at them, the same boundary the thread list uses, so it does not see files uploaded for the whole workspace. A deleted file is not listed.
The index starts from the day it shipped, so an older mailbox lists what has arrived since. Older attachments are still on their messages, where threads.listAttachments reads them.
Add --all to walk every page: a table on a terminal, one JSON object per line when piped or with --ndjson, and one { items, hasMore, nextCursor } document with --json. --max <n> stops after that many items.
Bayraklar
--q <value>Searches the file name and its type. Words match loosely, and a close spelling is tried when nothing matches exactly.
--kind <value>Keeps one kind:
image,pdf,audio,videoortext, the choices of the filter on the Files page.--direction <value>Keeps one direction:
inboundfor files that arrived on a message,outboundfor files that went out on one,uploadedfor files put on the Files page.--address <value>Keeps the files of one address, the
deliveredToof the file, compared without regard to case.--since <when>Keeps files added at or after this moment. A
Dateor an ISO 8601 string.--until <when>Keeps files added before this moment. A
Dateor an ISO 8601 string.--sort <value>newest(the default),oldest,largestorname. A cursor carries on in the order it was handed out in.Varsayılan"newest"--limit <n>Page size, from 1 to 100. The server defaults to 25.
Varsayılan25--cursor <value>The
nextCursorof the previous page. Leave it out for the first page.--allFetch every page and stream the items as they arrive.
--max <n>Stop after this many items. Implies
--all.--ndjsonPrint every item as one JSON object per line. Implies
--all
Örnekler
openemail files listopenemail files list --kind pdf --sort largestopenemail files list --all --max 100openemail files list --all > files.ndjsonŞurada da var
- API
GET /files- SDK
files.list()
openemail files get
Read one file by id
showviewKullanım
openemail files get <id> [flags]
Resolves one file: its name, type, size, whether it was sent, received or uploaded, the address it came to, the thread and message it belongs to, and whether it can be deleted. download fetches its bytes.
deletable is true only for an upload that nothing depends on. Otherwise usage says what keeps it: received or sent for a file that came in or went out on a message, linked for an upload that went out as a download link that still works, and scheduled for one attached to a message that has not gone out yet.
Argümanlar
<id>ZorunluThe id from
list,file_and 24 hex.
Örnekler
openemail files get file_6bb640f5b99e47deb758f1f5openemail files get file_6bb640f5b99e47deb758f1f5 --jsonŞurada da var
openemail files stats
Count the files and the space they take
Kullanım
openemail files stats [flags]
Returns the numbers on the Analytics tab of the Files page in one request: how many files the mailbox holds and how many bytes they take, in all and split into received, sent and uploaded, the file types and the addresses taking the most space, how many files arrived on each of the last 30 days, and the download links still working with how often they were fetched.
Deleted files are not counted. A key limited to particular addresses or domains counts only the files that arrived at them, so files uploaded for the whole workspace are left out of its numbers.
Örnekler
openemail files statsopenemail files stats --jsonŞurada da var
openemail files download
Fetch the bytes of a file
Kullanım
openemail files download <id> [flags]
Resolves with the file exactly as it is stored, the same bytes the Download action on the Files page saves. The response carries the file's own Content-Type and name.
Argümanlar
<id>ZorunluThe id from
list.
Bayraklar
-o, --out <file>Write the file here. Required on a terminal. Without it, piped output gets the raw bytes
Örnekler
openemail files download file_6bb640f5b99e47deb758f1f5openemail files download file_6bb640f5b99e47deb758f1f5 --out report.pdfŞurada da var
openemail files list-links
List the download links a file went out as
Kullanım
openemail files list-links <id> [flags]
Resolves one page of the download links made for this file, newest first. A large attachment sent from OpenEmail travels as a link rather than inside the message, and each send makes a link of its own. Every row says how often it was fetched, when last, and whether it was revoked. While one of its links still works, an upload cannot be deleted.
A file attached inside a message has no links, because nothing records when those are opened.
Add --all to walk every page: a table on a terminal, one JSON object per line when piped or with --ndjson, and one { items, hasMore, nextCursor } document with --json. --max <n> stops after that many items.
Argümanlar
<id>ZorunluThe file id from
list.
Bayraklar
--limit <n>Page size, from 1 to 100. The server defaults to 25.
Varsayılan25--cursor <value>The
nextCursorof the previous page. Leave it out for the first page.--allFetch every page and stream the items as they arrive.
--max <n>Stop after this many items. Implies
--all.--ndjsonPrint every item as one JSON object per line. Implies
--all
Örnekler
openemail files list-links file_6bb640f5b99e47deb758f1f5openemail files list-links file_6bb640f5b99e47deb758f1f5 --all --max 100openemail files list-links file_6bb640f5b99e47deb758f1f5 --all > files.ndjsonŞurada da var
openemail files create-link
Publish a file at a public link
Kullanım
openemail files create-link <id> [flags]
Makes a public download link for the file and resolves with it. Anybody holding url can open the file without signing in, which is how an image or a document is referenced from an email or a web page. Each call makes a new link with its own download count, and a link keeps working until it is revoked with revokeLink or the file is deleted.
The link lives on the files host of --domain when that domain has one set up, such as files.acme.com, else on the files host of the address the file belongs to, else on the OpenEmail API address. A file that came in or went out on a message is copied to public storage first. Programs and scripts are refused with 422 file_unshareable.
Argümanlar
<id>ZorunluThe file id from
list.
Bayraklar
--domain <value>The domain whose files host serves the link, such as
acme.com.
Örnekler
openemail files create-link file_6bb640f5b99e47deb758f1f5openemail files create-link file_6bb640f5b99e47deb758f1f5 --domain acme.comŞurada da var
openemail files revoke-link
Revoke a public link
Kullanım
openemail files revoke-link <id> <link-id> [flags]
Stops a public link from working, for good, including in mail that already went out with it, and resolves with the link, revokedAt set. Revoking a link that is already revoked resolves with it unchanged, so the call is safe to repeat. An unknown link is a 404.
Argümanlar
<id>ZorunluThe file id from
list.<link-id>ZorunluThe link id from
listLinksorcreateLink.
Örnekler
openemail files revoke-link file_6bb640f5b99e47deb758f1f5 shr_2f9c4a1e7b3dopenemail files revoke-link file_6bb640f5b99e47deb758f1f5 shr_2f9c4a1e7b3d --yesŞurada da var
openemail files revoke-all-links
Revoke every link to a file
Kullanım
openemail files revoke-all-links <id> [flags]
Makes the file private, as Make private on the Files page does: every public download link to it stops working at once, including the ones in mail that already went out. Resolves with revoked, how many links were still working. The file itself stays, and createLink can publish it again at a new link.
A key limited to particular addresses reaches only the files that arrived at them, and any other file is a 404.
Argümanlar
<id>ZorunluThe file id from
list.
Örnekler
openemail files revoke-all-links file_6bb640f5b99e47deb758f1f5openemail files revoke-all-links file_6bb640f5b99e47deb758f1f5 --yesŞurada da var
openemail files upload
Upload a file to the Files page
Kullanım
openemail files upload <data> [flags]
Stores the bytes as a new file, the way the Upload button on the Files page does, and resolves with it: direction is uploaded, usage is null and deletable is true. Attach it to a send as { fileId } in emails.send, which is how a file larger than the inline cap goes out.
data is a Blob, an ArrayBuffer or a Uint8Array, sent as the request body. The name travels as the filename query parameter, and it is cleaned rather than refused: characters a file name cannot hold become _, and a name longer than 255 characters is cut, keeping its extension. The type is --content-type, or a Blob's own type when that is left out, and application/octet-stream without either. A value that is not shaped like a MIME type is stored as application/octet-stream too.
A key limited to particular addresses or domains uploads to the first address it holds, which becomes deliveredTo. An unlimited key uploads for the whole workspace and deliveredTo is null, so a narrowed key never reaches that file afterwards.
Argümanlar
<data>ZorunluThe file: a
Blob,ArrayBufferorUint8Array, not empty and at most 100 MB.
Bayraklar
--filename <value>The name the file is stored and downloaded under, such as
report.pdf. A missing or blank name throws before anything is sent.--content-type <value>The MIME type, such as
application/pdf. Left out, aBlob's own type is used, elseapplication/octet-stream.--timeout-ms <n>How long the upload may take, in milliseconds. Left out, it is 10 minutes, or the client
--timeout-mswhen that is longer.0waits as long as it takes.
Örnekler
openemail files upload ./photo.jpgopenemail files upload ./photo.jpg --filename report.pdf --content-type application/pdfŞurada da var
openemail files delete
Delete an uploaded file for good
rmdelremoveKullanım
openemail files delete <id> [flags]
Removes an uploaded file: its bytes are deleted from storage and it leaves the Files page. The row stays, marked deleted, so the index knows the file existed. There is no undo.
Only an upload that nothing depends on can be deleted, the files whose deletable is true. A file that was received or sent stays with its message, and so does an upload that went out as a download link that still works or is attached to a message that has not gone out yet. Those are refused with 409 file_in_use, and the message names the file and says why. An upload that was sent inside a message can still be deleted, because the message keeps its own copy, which is listed as a separate sent file.
deleteMany deletes up to 100 in one call and reports the ones it kept instead of failing.
Argümanlar
<id>ZorunluThe id from
list.
Örnekler
openemail files delete file_6bb640f5b99e47deb758f1f5openemail files delete file_6bb640f5b99e47deb758f1f5 --yesŞurada da var
openemail files delete-many
Delete up to 100 files in one call
Kullanım
openemail files delete-many <ids...> [flags]
Deletes every file in ids that can be deleted, the way delete deletes one, and reports the rest instead of failing. It is what selecting several files on the Files page and pressing Delete does.
Only an uploaded file that nothing depends on can be deleted. A file that was received or sent stays with its message, and so does an upload that went out as a download link that still works or is attached to a message that has not gone out yet. Each of those comes back in kept with its usage and a reason in plain words. An id that is unknown, already deleted or outside the addresses a narrowed key holds comes back in missing. The rule is checked again at the moment of deleting, so a file that became used in between is kept.
There is no undo.
Argümanlar
<ids...>ZorunluBir veya daha fazla1 to 100 file ids from
list. More than 100, or none, is a 422 onids. A repeated id counts once.
Örnekler
openemail files delete-many file_6bb640f5b99e47deb758f1f5openemail files delete-many file_6bb640f5b99e47deb758f1f5 --yes