Records
Read, search, write and delete records of any object, and attach a local file to one of them, from a terminal.
standards records covers CRUD and full-text search on every object your key can read, and records attach-document uploads a file onto a record in one call (see Files and documents).
List
standards records list contacts --limit 20 --sort createdAt:descThe response is { data, page }. Pipe it through jq .data to work on the rows.
| Flag | Description |
|---|---|
--limit <n> | Page size. |
--offset <n> | Rows to skip. |
--sort <rule> | One rule, attribute:direction. Direction defaults to asc. |
--filter <json> | The filter tree as JSON, passed as-is. |
--fields <names> | Comma-separated reference attributes to hydrate. "" hydrates none; omit the flag for all. |
--count <mode> | none, estimated or exact. Omit it and page.total is null. |
standards records list contacts --filter '{"combinator":"and","rules":[{"attribute":"status","operator":"is","value":"active"}]}' --count exactGet
standards records get contacts <recordId>Create
standards records create contacts --data '{"firstName":"Alice","email":"[email protected]"}'Single-quote the JSON so the shell keeps the double quotes.
Update
update sends a PUT. The API validates the merged record, so send only the attributes that change.
standards records update contacts <recordId> --data '{"firstName":"Alicia"}'Delete
standards records delete contacts <recordId>The command prints Record <id> deleted. and nothing else.
Search
--query is required. The other flags are the ones list takes.
standards records search contacts --query "alice" --limit 10standards records search contacts --query "alice" --sort updatedAt:desc --count estimatedAttach a document
Upload a local file and attach it to a record in one call.
standards records attach-document contacts <recordId> --file ./contract.pdf| Flag | Description |
|---|---|
--file <path> | Required. The local file to upload. |
--attribute <name> | The document attribute to attach to. |
--parent-id <folderId> | The folder to place the document in. |
--title <title> | Document title. Defaults to the file name. |
standards records attach-document contacts <recordId> --file ./contract.pdf --attribute contract --title "Signed contract"The response is the created document. Read its files and text with Documents and files.
Next steps
- Documents and files: manage the pack you just created.
- Objects and records: what a record is and how filters address attributes.
- CLI: output formats, exit codes and shell pitfalls.