Functions
assert-record
fn (object: Str, matching-attribute: Str, values: Map): Map
fn (object: Str, matching-attribute: Str, values: Map, opts: Map): Map
PUT /objects/{object}/records?matching_attribute= - Create-or-update keyed on a unique attribute (Attio's upsert). The idiomatic way to sync people/companies in.
Example
person ::attio::records/assert-record("people", "email_addresses", {
email_addresses: [{email_address: "ada@example.com"}],
name: [{first_name: "Ada", last_name: "Lovelace", full_name: "Ada Lovelace"}]
})
create-record
fn (object: Str, values: Map): Map
fn (object: Str, values: Map, opts: Map): Map
POST /objects/{object}/records - Create a record from attribute
values (Attio's value shapes, e.g.
{email_addresses: [{email_address: "a@b.c"}]}).
Example
company ::attio::records/create-record("companies", {name: [{value: "Example Inc"}], domains: [{domain: "example.com"}]})
company.id.record_id
delete-record
fn (object: Str, record-id: Str): Any
fn (object: Str, record-id: Str, opts: Map): Any
DELETE /objects/{object}/records/{id} - Delete a record.
Example
::attio::records/delete-record("people", ::attio::recordsEC)
get-object
fn (object: Str): Map
fn (object: Str, opts: Map): Map
GET /objects/{object} - One object's configuration (api_slug,
singular/plural nouns). Requires the Object Configuration scope.
Example
people ::attio::records/get-object("people")
people.api_slug
get-record
fn (object: Str, record-id: Str): Map
fn (object: Str, record-id: Str, opts: Map): Map
GET /objects/{object}/records/{id} - One record with all attribute values.
Example
person ::attio::records/get-record("people", ::attio::recordsEC)
person.values.email_addresses
list-attributes
fn (object: Str): Map
fn (object: Str, opts: Map): Map
GET /objects/{object}/attributes - An object's attributes (api_slug,
type, is_required, ...). Attribute slugs are the keys
create-record values use. Requires the Object Configuration scope.
Example
attributes ::attio::records/list-attributes("people")
map(attributes.data, %.api_slug)
list-objects
fn (): Map
fn (opts: Map): Map
GET /objects - The workspace's objects (system
people/companies/deals and custom ones) with their slugs.
Example
objects ::attio::records/list-objects()
map(objects.data, %.api_slug)
query-records
fn (object: Str): Map
fn (object: Str, options: Map): Map
fn (object: Str, options: Map, opts: Map): Map
POST /objects/{object}/records/query - Query records. options:
filter (https://docs.attio.com/rest-api/how-to/filtering-and-sorting),
sorts, limit (max 500), offset.
Example
hits ::attio::records/query-records("companies", {
filter: {domains: {domain: {"$contains": "example.com"}}},
limit: 10
})
hits.data
update-record
fn (object: Str, record-id: Str, values: Map): Map
fn (object: Str, record-id: Str, values: Map, opts: Map): Map
PATCH /objects/{object}/records/{id} - Update the given attribute values of a record.
Example
::attio::records/update-record("people", ::attio::recordsEC, {job_title: [{value: "CTO"}]})