### Writing Domain Attribute Values (JSON) Source: https://docs.attio.com/docs/attribute-types/attribute-types-domain Illustrates how to write domain attribute values. It shows examples using single strings, multiple strings, and an object format, all within an array as the 'domains' attribute is multi-select. ```json { "domains": ["app.attio.com"] } ``` ```json { "domains": ["app.attio.com", "attio.com"] } ``` ```json { "domains": [ { "domain": "app.attio.com" } ] } ``` -------------------------------- ### Write Phone Number as String JSON Example Source: https://docs.attio.com/docs/attribute-types/attribute-types-phone-number Shows how to write a phone number value as a simple string in JSON format for the `phone_numbers` attribute. The string must be prefixed with the country code, starting with '+'. ```json { "phone_numbers": ["+447777777777"] } ``` -------------------------------- ### Example Timestamp JSON Structure Source: https://docs.attio.com/docs/attribute-types/attribute-types-timestamp Demonstrates the structure of a Timestamp attribute as stored in Attio, including its value and other metadata. The `value` field represents the timestamp in ISO 8601 format. ```json { "active_from": "2023-04-03T15:21:06.447000000Z", "active_until": null, "created_by_actor": {}, "attribute_type": "date", "value": "2023-11-24T15:17:48.000000000Z" } ``` -------------------------------- ### Read Currency Attribute Values (JSON) Source: https://docs.attio.com/docs/attribute-types/attribute-types-currency Example of how currency attribute values are returned from the API, showing the currency_value (number) and currency_code (string) properties. Null values are not supported. ```json { "active_from": "2023-04-03T15:21:06.447000000Z", "active_until": null, "created_by_actor": {}, "attribute_type": "currency", "currency_value": "499.00", "currency_code": "USD" } ``` -------------------------------- ### Filter by Exact Phone Number JSON Example Source: https://docs.attio.com/docs/attribute-types/attribute-types-phone-number Provides a JSON example for filtering records by an exact phone number. The `phone_numbers` attribute is used in the filter, and Attio internally uses the normalized phone number for this comparison. ```json { "filter": { "phone_numbers": "+15558675309" } } ``` -------------------------------- ### Example Actor Representation in JSON Source: https://docs.attio.com/docs/actors This JSON snippet demonstrates the structure of an actor object as it appears in Attio API responses. It includes the actor's type and a unique ID, showcasing how actions are attributed to specific entities within the system. ```json { "created_by_actor": { "type": "workspace-member", "id": "175bec0c-f06a-4c45-9962-7a7a6be28b8a" } } ``` -------------------------------- ### Write Phone Number with Null Country Code JSON Example Source: https://docs.attio.com/docs/attribute-types/attribute-types-phone-number Demonstrates writing a phone number as a JSON object where `country_code` is set to `null`. This is permissible if the `original_phone_number` already includes the area code prefix starting with '+'. ```json { "phone_numbers": [ { "original_phone_number": "+44 7777777777", "country_code": null } ] } ``` -------------------------------- ### Read Phone Number JSON Example Source: https://docs.attio.com/docs/attribute-types/attribute-types-phone-number Demonstrates the JSON structure for a US telephone number attribute as stored in Attio. It includes fields like `original_phone_number`, `normalized_phone_number`, and `country_code`. ```json { "active_from": "2023-04-03T15:21:06.447000000Z", "active_until": null, "created_by_actor": {}, "attribute_type": "phone-number", "original_phone_number": "+15558675309", "normalized_phone_number": "+15558675309", "country_code": "US" } ``` -------------------------------- ### Reading Text Attribute Values (JSON) Source: https://docs.attio.com/docs/attribute-types/attribute-types-text Demonstrates how to read the value of a text attribute. Text attribute values typically have a single 'value' property containing the text content. This example shows the structure of a retrieved text attribute. ```json { "active_from": "2023-04-03T15:21:06.447000000Z", "active_until": null, "created_by_actor": {}, "attribute_type": "text", "value": "A long time ago in a galaxy far, far away..." } ``` -------------------------------- ### Filtering Domain Attributes by Domain (JSON) Source: https://docs.attio.com/docs/attribute-types/attribute-types-domain Provides JSON examples for filtering domain attributes. It shows how to filter by an exact domain match and how to use the '$contains' operator to find domains that include a specific string. ```json { "filter": { "domain": "app.attio.com" } } ``` ```json { "filter": { "domains": { "domain": { "$contains": "attio" } } } } ``` -------------------------------- ### Reading Email Address Values (JSON Example) Source: https://docs.attio.com/docs/attribute-types/attribute-types-email-address Demonstrates the structure of an email address attribute when read from Attio. It includes properties like the normalized email, original email, and parsed domain components. This is useful for understanding the data format returned by the API. ```json { "active_from": "2023-04-03T15:21:06.447000000Z", "active_until": null, "created_by_actor": {}, "attribute_type": "email-address", "email_address": "[email protected]", "original_email_address": "[email protected]", "email_domain": "company.com", "email_root_domain": "company.com", "email_local_specifier": "person" } ``` -------------------------------- ### Filter Currency Values (JSON) Source: https://docs.attio.com/docs/attribute-types/attribute-types-currency Examples of filtering currency attributes by their value. This includes finding records with an exact currency value and using comparison operators like '$gte' for greater than or equal to. ```json { "filter": { "amount_owed": "399.00" } } ``` ```json { "filter": { "amount_owed": { "currency_value": { "$gte": 500 } } } } ``` -------------------------------- ### Filtering Timestamp Values (Date Range) Source: https://docs.attio.com/docs/attribute-types/attribute-types-timestamp Demonstrates filtering timestamp values within a date range using the '$gte' and '$lt' operators. This is useful for filtering records created on a specific day, by setting the lower bound to the start of the day and the upper bound to the start of the next day. ```json { "filter": { "created_at": { "$gte": "2023-11-24T00:00:00Z", "$lt": "2023-11-25T00:00:00Z" } } } ``` -------------------------------- ### Filter by Country Code JSON Example Source: https://docs.attio.com/docs/attribute-types/attribute-types-phone-number Shows how to filter records to find those with a specific country code, using the `$eq` operator on the `country_code` property within the `phone_numbers` attribute. ```json { "filter": { "phone_numbers": { "country_code": { "$eq": "US" } } } } ``` -------------------------------- ### Filter Number Attributes by Equality (JSON) Source: https://docs.attio.com/docs/attribute-types/attribute-types-number An example of filtering records where a number attribute matches an exact value. This uses the implicit exact equality check. ```json { "filter": { "twitter_follower_count": 14 } } ``` -------------------------------- ### Filtering Timestamp Values (Generic Greater Than or Equal) Source: https://docs.attio.com/docs/attribute-types/attribute-types-timestamp An example of filtering timestamp values that occurred on or after a specific date. It uses the '$gte' operator to set a minimum timestamp for the filter. ```json { "filter": { "created_at": { "value": { "$gte": "2000-01-01T00:00:00Z" } } } } ``` -------------------------------- ### Read Location Data Example (JSON) Source: https://docs.attio.com/docs/attribute-types/attribute-types-location Demonstrates the structure of a location attribute as returned by the Attio API. It includes fields like line_1, locality, region, postcode, country_code, and coordinates. This format is used when reading location information. ```json { "active_from": "2023-04-03T15:21:06.447000000Z", "active_until": null, "created_by_actor": {}, "attribute_type": "location", "line_1": "1 Infinite Loop", "line_2": null, "line_3": null, "line_4": null, "locality": "Cupertino", "region": "CA", "postcode": "95014", "country_code": "US", "latitude": "37.331741", "longitude": "-122.030333" } ``` -------------------------------- ### Filtering Date Attribute Values (JSON) Source: https://docs.attio.com/docs/attribute-types/attribute-types-date Shows how to filter date attributes. The first example filters for companies founded on an exact date. The second uses the '$gte' operator to find companies formed after a specific date, demonstrating explicit filtering syntax. ```json { "filter": { "foundation_date": "2023-11-24" } } ``` ```json { "filter": { "foundation_date": { "value": { "$gte": "2000-01-01" } } } } ``` -------------------------------- ### Filtering Text Attributes with Operators (JSON) Source: https://docs.attio.com/docs/attribute-types/attribute-types-text Shows how to filter text attributes using various operators. This includes exact matches ($eq, implicit), checking if a string starts with a prefix ($starts_with), if it contains a keyword ($contains), and filtering by a list of record IDs ($in). ```json { "filter": { "description": "An exact match" } } ``` ```json { "filter": { "description": { "value": { "$starts_with": "Headquartered in New York City" } } } } ``` ```json { "filter": { "description": { "value": { "$contains": "New York City" } } } } ``` ```json { "filter": { "record_id": { "$in": ["000e8881-37cc-41d2-bc22-39fe35e76e6b", "592dc9d8-548b-4148-813f-1259055ca83c"] } } } ``` -------------------------------- ### Writing Select Attribute Values (JSON) Source: https://docs.attio.com/docs/attribute-types/attribute-types-select Illustrates various ways to write values for select attributes using JSON. This includes single string values, arrays for multi-select, and objects referencing either the option title or option ID. These examples are crucial for updating select attribute data via the API. ```json { "categories": ["3D Printing"] } ``` ```json { "categories": ["3D Printing", "Architecture"] } ``` ```json { "categories": [ { "option": "3D Printing" } ] } ``` ```json { "categories": [ { "option": "14938464-cae9-4e50-8856-0fb584844f24" } ] } ``` -------------------------------- ### Writing Email Address Values (JSON) Source: https://docs.attio.com/docs/attribute-types/attribute-types-email-address Illustrates how to write email address values to Attio. It shows examples for multi-select and single email address attributes, including how to use an object for more complex assignments. Attio automatically infers derived properties. ```json { "email_addresses": ["[email protected]", "[email protected]"] } ``` ```json { "email_address": "[email protected]" } ``` ```json { "email_addresses": [ { "email_address": "[email protected]" } ] } ``` -------------------------------- ### Reading Email Interaction Example (JSON) Source: https://docs.attio.com/docs/attribute-types/attribute-types-interaction Demonstrates the structure of a last email interaction object, showing properties like `active_from`, `interacted_at`, and `owner_actor`. This is a read-only attribute provided by the Attio system. ```json { "active_from": "2023-11-25T15:21:06.447000000Z", "active_until": null, "created_by_actor": { "type": "system", "id": null }, "attribute_type": "interaction", "interaction_type": "email", "interacted_at": "2023-11-25T15:21:06.447000000Z", "owner_actor": { "type": "workspace-member", "id": "50cf242c-7fa3-4cad-87d0-75b1af71c57b" // Tom } } ``` -------------------------------- ### Filtering Select Attributes by Category (JSON) Source: https://docs.attio.com/docs/attribute-types/attribute-types-select Provides examples of filtering records based on select attributes using JSON. It shows how to filter by a specific category title using implicit syntax, by an option ID using explicit syntax, and how to combine multiple categories using the `$or` operator. ```json { "filter": { "categories": "Aerospace & Defense" } } ``` ```json { "filter": { "categories": { "option": { "$eq": "Aerospace & Defense" } } } } ``` ```json { "filter": { "$or": [ {"categories": "Aerospace & Defense"}, {"categories": "Biotechnology"} ] } } ``` -------------------------------- ### Filter Records by Exact Match (JSON) Source: https://docs.attio.com/docs/attribute-types/attribute-types-record-reference This snippet demonstrates how to filter records using exact equality matches on `target_object` and `target_record_id`. It shows examples for filtering people by company and workspaces by user. Dependencies include the Attio API. Inputs are JSON objects representing filter criteria. Outputs are filtered record sets. ```json { "filter": { "company": { "target_object": "companies", "target_record_id": "99a03ff3-0435-47da-95cc-76b2caeb4dab" } } } ``` ```json { "filter": { "users": { "target_object": "97052eb9-e65e-443f-a297-f2d9a4a7f795", "target_record_id": "5e3fb280-007b-495a-a530-9354bde01de1" } } } ``` -------------------------------- ### Reading Date Attribute Value (JSON) Source: https://docs.attio.com/docs/attribute-types/attribute-types-date Demonstrates how to read the value of a date attribute. The 'value' property holds the date as an ISO 8601 string. This example shows a date attribute with a set value and a null active_until date. ```json { "active_from": "2023-04-03T15:21:06.447000000Z", "active_until": null, "created_by_actor": {...}, "attribute_type": "date", "value": "2023-11-24" } ``` -------------------------------- ### Attio Record Reference Value Example (JSON) Source: https://docs.attio.com/docs/attribute-types/attribute-types-record-reference This JSON object represents a record reference value in Attio. It contains 'target_object' to identify the type of record being referenced (e.g., 'people') and 'target_record_id' for the specific ID of that record. ```json { "active_from": "2023-04-03T15:21:06.447000000Z", "active_until": null, "created_by_actor": {...}, "attribute_type": "record-reference", "target_object": "people", "target_record_id": "891dcbfc-9141-415d-9b2a-2238a6cc012d" } ``` -------------------------------- ### Write Phone Number as Object with Country Code JSON Example Source: https://docs.attio.com/docs/attribute-types/attribute-types-phone-number Illustrates writing a phone number as a JSON object, providing both `original_phone_number` and `country_code`. This is useful when the country code is not explicitly part of the original number string. ```json { "phone_numbers": [ { "original_phone_number": "+447777777777", "country_code": "GB" } ] } ``` -------------------------------- ### Filter Location Data by Exact Match (JSON) Source: https://docs.attio.com/docs/attribute-types/attribute-types-location An example of filtering location data for people located in Cupertino, California, US. This uses exact match operators for locality, region, and country_code. ```json { "filter": { "primary_location": { "locality": "Cupertino", "region": "CA", "country_code": "US" } } } ``` -------------------------------- ### Filtering for Recent Calendar Interactions with a Member (JSON) Source: https://docs.attio.com/docs/attribute-types/attribute-types-interaction Provides a JSON filter example to find companies with whom a specific workspace member (Tom) had a calendar interaction on or after a given date. It uses `owner_member_id` and `interacted_at` with a `$gte` operator. ```json { "filter": { "last_calendar_interaction": { "owner_member_id": "50cf242c-7fa3-4cad-87d0-75b1af71c57b", "interacted_at": { "$gte": "2023-11-01" } } } } ``` -------------------------------- ### Filter by Partial Phone Number JSON Example Source: https://docs.attio.com/docs/attribute-types/attribute-types-phone-number Illustrates filtering records based on a substring of a phone number using the `$contains` operator on the `phone_number` property (which refers to the normalized number) within the `phone_numbers` attribute. ```json { "filter": { "phone_numbers": { "phone_number": { "$contains": "67530" } } } } ``` -------------------------------- ### Filtering Email Address Attributes (JSON) Source: https://docs.attio.com/docs/attribute-types/attribute-types-email-address Provides examples of filtering records based on email address properties. It demonstrates exact matches, domain-specific queries, and filtering by the local part of the email address using various operators like $eq and $contains. ```json { "filter": { "email_addresses": "[email protected]" } } ``` ```json { "filter": { "email_addresses": { "email_domain": { "$eq": "attio.com" } } } } ``` ```json { "filter": { "email_addresses": { "email_local_specifier": { "$contains": "person" } } } } ``` -------------------------------- ### Create Currency Attribute Configuration (HTTP) Source: https://docs.attio.com/docs/attribute-types/attribute-types-currency This snippet demonstrates how to specify configuration properties like default_currency_code and display_type when creating a new currency attribute via an HTTP POST request. ```http POST /v2/objects/:object/attributes HTTP/1.1 Authorization: Bearer <> Content-Type: application/json { "title": "Amount owed", "api_slug": "amount_owed", "type": "currency", "config": { "currency": { "default_currency_code": "USD", "display_type": "symbol" } } } ``` -------------------------------- ### Attio REST API Overview Source: https://docs.attio.com/docs/overview The Attio REST API allows developers to build applications that interact with Attio workspaces, enabling data manipulation and real-time event subscriptions via webhooks. ```APIDOC ## Attio REST API ### Description This API allows developers to build apps that read and write information to and from Attio workspaces. You can also subscribe to events in realtime using webhooks. ### Method All ### Endpoint `/rest-api/overview` ### Parameters None ### Request Example None ### Response #### Success Response (200) - **documentation_url** (string) - URL to the REST API documentation. #### Response Example ```json { "documentation_url": "/rest-api/overview" } ``` ``` -------------------------------- ### Attio App SDK Overview Source: https://docs.attio.com/docs/overview The App SDK enables developers to embed Typescript React applications directly within the Attio interface and execute server functions with access to the Attio REST API. ```APIDOC ## Attio App SDK ### Description This SDK allows developers to embed Typescript React applications within the Attio interface and run server functions with access to our REST API. ### Method N/A ### Endpoint `/sdk/guides/creating-an-app` ### Parameters None ### Request Example None ### Response #### Success Response (200) - **guide_url** (string) - URL to the App SDK guide. #### Response Example ```json { "guide_url": "/sdk/guides/creating-an-app" } ``` ``` -------------------------------- ### Writing Name Values (JSON) Source: https://docs.attio.com/docs/attribute-types/attribute-types-personal-name Shows two syntaxes for writing name values in Attio: object syntax (recommended for full control, requires all properties) and string syntax ('Last name(s), First name(s)'). ```json { "name": { "first_name": "John", "last_name": "Smith", "full_name": "John Smith" } } ``` ```json { "name": "Smith, John" } ``` -------------------------------- ### Write Currency Values (JSON) Source: https://docs.attio.com/docs/attribute-types/attribute-types-currency Demonstrates various ways to write currency values, including using floating-point numbers, strings that are automatically parsed, and an object format with a single 'currency_value' key. Integers are automatically converted to floats. ```json { "amount_owed": 4.99 } ``` ```json { "amount_owed": "4.99" } ``` ```json { "amount_owed": [ { "currency_value": "399.00" } ] } ``` -------------------------------- ### Writing Text Attribute Values (JSON) Source: https://docs.attio.com/docs/attribute-types/attribute-types-text Illustrates two methods for writing text attribute values: directly passing a string or providing an object with a 'value' property. Both methods achieve the same result of setting the text attribute's content. ```json { "description": "Headquartered in New York City, Waystar Royco was founded by Logan Roy and operates in 50 countries across 4 continents" } ``` ```json { "description": [ { "value": "Headquartered in New York City, Waystar Royco was founded by Logan Roy and operates in 50 countries across 4 continents" } ] } ``` -------------------------------- ### Referencing Standard Objects with Specific Attributes (JSON) Source: https://docs.attio.com/docs/attribute-types/attribute-types-record-reference Demonstrates how to write record references by specifying the target object and using specific attributes like `domains` for companies, `email_addresses` for people, `user_id` for users, and `workspace_id` for workspaces. This method ensures clear association with standard Attio objects. ```json { "associated_company": [ { "domains": [{"domain": "company.com"}], "target_object": "companies" } ] } ``` ```json { "team": [ { "email_addresses": [{"email_address": "[email protected]"}], "target_object": "people" } ] } ``` ```json { "user": [ { "user_id": [{"value": "my-user-id"}], "target_object": "users" } ] } ``` ```json { "workspace": [ { "workspace_id": [{"value": "my-workspace-id"}], "target_object": "workspaces" } ] } ``` -------------------------------- ### Writing Select Attribute Values Source: https://docs.attio.com/docs/attribute-types/attribute-types-select Explains how to set values for select attributes, supporting single string values, arrays for multi-select, and object references by title or ID. ```APIDOC ## Writing Select Attribute Values ### Description To write select values, pass the title of the select option as a string. If it's a multi-value select attribute, you'll need to pass an array. You can also pass an object with an `option` property, which references either the `option_id` or the `title` of the select option. ### Request Example (String) ```json { "categories": "3D Printing" } ``` ### Request Example (Multiple Values) ```json { "categories": ["3D Printing", "Architecture"] } ``` ### Request Example (Object with Title) ```json { "categories": [ { "option": "3D Printing" } ] } ``` ### Request Example (Object with Option ID) ```json { "categories": [ { "option": "14938464-cae9-4e50-8856-0fb584844f24" } ] } ``` ``` -------------------------------- ### Understanding Attio IDs Source: https://docs.attio.com/docs/slugs-and-ids Explains the structure of Attio's unique IDs, which are composed of sub-IDs (workspace_id, object_id, record_id) and how their combination ensures uniqueness. ```APIDOC ## Attio IDs and Uniqueness ### Description Entities in Attio's API are identified by an `id` property. This ID is a composite of one or more sub-IDs, typically including `workspace_id`, `object_id`, and `record_id`. Uniqueness of an entity is guaranteed only when considering the entire composite ID. ### Example ID Structure ```json { "data": { "id": { "workspace_id": "", "object_id": "", "record_id": "" } // ... other fields } } ``` ### Important Note on Uniqueness It is unsafe to assume uniqueness based on a single sub-ID (e.g., `record_id`). The combination of all sub-IDs (`workspace_id`, `object_id`, `record_id`) must be used to ensure uniqueness. For operations within a single workspace, `workspace_id` can often be disregarded. ``` -------------------------------- ### Records API - Assert a Record Source: https://docs.attio.com/docs/standard-objects/standard-objects The assert a Record API allows developers to interact with both standard and custom objects, enabling reading and writing of predefined system attributes and custom attributes. ```APIDOC ## POST /rest-api/endpoint-reference/records/assert-a-record ### Description This endpoint allows for asserting a record, enabling interaction with both standard and custom objects in Attio. You can read and write system attributes as well as custom attributes. ### Method POST ### Endpoint /rest-api/endpoint-reference/records/assert-a-record ### Parameters #### Query Parameters - **object_type** (string) - Required - The type of the object to assert (e.g., 'company', 'person'). #### Request Body - **record_id** (string) - Optional - The unique identifier for the record. If not provided, a new record will be created. - **attributes** (object) - Required - A key-value map of attributes to set or update on the record. - **attribute_name** (any) - Required - The name of the attribute. - **attribute_value** (any) - Required - The value of the attribute. ### Request Example ```json { "record_id": "a1b2c3d4-e5f6-7890-1234-567890abcdef", "attributes": { "name": "Example Company", "email": "contact@example.com" } } ``` ### Response #### Success Response (200) - **record_id** (string) - The unique identifier of the asserted record. - **attributes** (object) - A key-value map of the record's current attributes. #### Response Example ```json { "record_id": "a1b2c3d4-e5f6-7890-1234-567890abcdef", "attributes": { "name": "Example Company", "email": "contact@example.com", "created_at": "2023-10-27T10:00:00Z", "created_by": "actor-id-123" } } ``` ``` -------------------------------- ### Creating a Currency Attribute Source: https://docs.attio.com/docs/attribute-types/attribute-types-currency This endpoint allows you to create new currency attributes for your objects. You can configure default currency codes and display types. ```APIDOC ## POST /v2/objects/:object/attributes ### Description Specifies configuration when creating a currency attribute. ### Method POST ### Endpoint `/v2/objects/:object/attributes` ### Parameters #### Path Parameters - **object** (string) - Required - The ID of the object to which the attribute will be added. #### Request Body - **title** (string) - Required - The display name of the attribute. - **api_slug** (string) - Required - A unique identifier for the attribute. - **type** (string) - Required - Must be 'currency'. - **config** (object) - Optional - Configuration for the currency attribute. - **currency** (object) - Optional - Currency-specific configuration. - **default_currency_code** (string) - Optional - The ISO 4217 currency code (e.g., 'USD', 'EUR'). - **display_type** (string) - Optional - How the currency should be displayed (e.g., 'symbol'). ### Request Example ```json { "title": "Amount owed", "api_slug": "amount_owed", "type": "currency", "config": { "currency": { "default_currency_code": "USD", "display_type": "symbol" } } } ``` ### Response #### Success Response (200) - **attribute_type** (string) - The type of the attribute ('currency'). - **currency_code** (string) - The default currency code for the attribute. - **currency_value** (string) - The value of the currency. #### Response Example ```json { "active_from": "2023-04-03T15:21:06.447000000Z", "active_until": null, "created_by_actor": {}, "attribute_type": "currency", "currency_value": "499.00", "currency_code": "USD" } ``` ``` -------------------------------- ### Writing Currency Values Source: https://docs.attio.com/docs/attribute-types/attribute-types-currency This section details how to write values for currency attributes, including accepted formats like floats, strings, and objects. ```APIDOC ## Writing Currency Values ### Description Currency values can be written using floating point numbers (up to 4 decimal places), strings that can be parsed into numbers, or an object with a `currency_value` key. The `currency_code` is inherited from the attribute and cannot be specified during writing. ### Request Body Examples #### Using float ```json { "amount_owed": 4.99 } ``` #### Using string ```json { "amount_owed": "4.99" } ``` #### Using object (single-select attribute) ```json { "amount_owed": [ { "currency_value": "399.00" } ] } ``` ``` -------------------------------- ### Company Configuration Schema Source: https://docs.attio.com/docs/standard-objects/standard-objects-companies Defines the configuration schema for the 'companies' object in Attio. This YAML snippet specifies API-related details such as the API slug, singular noun, and plural noun for company records. ```yaml api_slug: companies singular_noun: Company plural_noun: Companies ``` -------------------------------- ### Archiving and Deleting Data via API Source: https://docs.attio.com/docs/archiving-vs-deleting This section details how to archive and delete data using the Attio API. Deleting is permanent, while archiving is a reversible soft delete. Specific behaviors for archiving depend on the object type. ```APIDOC ## Archiving and Deleting Data ### Description This section outlines the API approach for managing data through archiving and deletion. Deleting is a permanent action, while archiving is a reversible soft deletion. ### Method - **DELETE**: Used for permanent deletion. - **PUT/PATCH**: Used for archiving/unarchiving by updating the `is_archived` property. ### Endpoint - **DELETE**: Typically `/resource/{id}` - **PUT/PATCH**: Typically `/resource/{id}` ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the resource to be deleted or archived. #### Query Parameters None specified. #### Request Body - **is_archived** (boolean) - Required for archiving/unarchiving - Set to `true` to archive, `false` to restore. ### Request Example #### Archiving a Resource ```json { "is_archived": true } ``` #### Unarchiving a Resource ```json { "is_archived": false } ``` ### Response #### Success Response (200 OK) - **message** (string) - Confirmation of the action taken. #### Response Example ```json { "message": "Resource successfully archived." } ``` #### Error Response (e.g., 404 Not Found, 400 Bad Request) - **error** (string) - Description of the error. #### Error Example ```json { "error": "Resource not found." } ``` ``` -------------------------------- ### Attio Record Creation: Slug vs. ID Input (JSON) Source: https://docs.attio.com/docs/slugs-and-ids Demonstrates how the create record endpoint in Attio's API can accept attribute identifiers as either slugs (human-readable) or UUIDs. The response will always use slugs. ```json { "data": { "values": { "email_addresses": [ { "email_address": "[email protected]" } ] } // other values... } } // ID form { "data": { "values": { "8a8ad54f-9314-4bdb-b867-e62d02a7d333": [ { "email_address": "[email protected]" } ] } // other values... } } ``` -------------------------------- ### Writing Phone Numbers Source: https://docs.attio.com/docs/attribute-types/attribute-types-phone-number Details on how to set phone number values, either as strings or objects, for API requests. ```APIDOC ## Writing Phone Numbers ### Description Phone number values can be submitted as strings or objects. For both formats, the country code must be identifiable. All values are validated against E.164 format. Since the `phone_numbers` attribute is multi-select, values must be passed within an array. ### Writing as a String For string values, the phone number must be prefixed with the country code, starting with '+'. #### Example Request (String) ```json { "phone_numbers": ["+447777777777"] } ``` ### Writing as an Object Object values require both `original_phone_number` and `country_code` properties. `country_code` can be `null` if the area code prefix is included in `original_phone_number`. #### Example Request (Object with Country Code) ```json { "phone_numbers": [ { "original_phone_number": "+447777777777", "country_code": "GB" } ] } ``` #### Example Request (Object without Country Code) ```json { "phone_numbers": [ { "original_phone_number": "+44 7777777777", "country_code": null } ] } ``` ``` -------------------------------- ### Writing Date Attribute Values (JSON) Source: https://docs.attio.com/docs/attribute-types/attribute-types-date Illustrates two methods for writing date attribute values. The first uses a direct ISO 8601 date string for the 'foundation_date'. The second wraps the date string within an object containing a 'value' key, representing a single-select attribute. ```json { "foundation_date": "2004-07-29" } ``` ```json { "foundation_date": [ { "value": "2004-07-29" } ] } ``` -------------------------------- ### Writing Record References Using String Values (JSON) Source: https://docs.attio.com/docs/attribute-types/attribute-types-record-reference Shows how to write record references using simple string values, which Attio interprets based on the target object type. Strings are treated as domains for companies, email addresses for people, user IDs for users, and workspace IDs for workspaces. This supports both single and multiple values for multiselect attributes. ```json { "associated_company": "company.com" } ``` ```json { "associated_company": ["company.com", "company.net"] } ``` ```json { "team": ["[email protected]"] } ``` ```json { "team": ["[email protected]", "[email protected]"] } ``` ```json { "user": "my-user-id" } ``` ```json { "user": ["my-user-id", "another-user-id"] } ``` ```json { "workspace": "my-workspace-id" } ``` ```json { "workspace": ["my-workspace-id", "another-workspace-id"] } ``` -------------------------------- ### Attribute APIs Source: https://docs.attio.com/docs/attribute-types/attribute-types This section provides information about the Attio API endpoints related to attributes. It details the properties of attributes, how attribute values are represented, and the various types of attributes available within the Attio platform. ```APIDOC ## Attributes API ### Description Provides endpoints for managing and retrieving attributes within Attio. Attributes are used to model data on objects and lists. This API allows for the creation, modification, and retrieval of custom attributes. ### Method GET ### Endpoint /rest-api/endpoint-reference/attributes ### Parameters #### Query Parameters - **type** (string) - Optional - Filter attributes by their type. - **is_archived** (boolean) - Optional - Filter attributes by their archived status. ### Request Example ```json { "example": "GET /rest-api/endpoint-reference/attributes?type=text&is_archived=false" } ``` ### Response #### Success Response (200) - **id** (string) - Composite ID of the attribute `(workspace_id, object_id, attribute_id)`. - **title** (string) - The human-readable name of the attribute. - **description** (string) - An optional human-readable description of the attribute. - **api_slug** (string) - A shorthand identifier for the attribute. - **type** (string) - The type of the attribute (e.g., "text", "number", "date"). - **is_archived** (boolean) - Indicates if the attribute has been archived. - **is_required** (boolean) - Indicates if a value is required for this attribute. - **is_unique** (boolean) - Indicates if the value for this attribute must be unique. - **is_multiselect** (boolean) - Indicates if multiple values can be assigned to this attribute. - **is_default_value_enabled** (boolean) - Indicates if a default value is enabled for this attribute. - **default_value** (any) - The default value for the attribute, if enabled. - **created_at** (timestamp) - The timestamp when the attribute was created. - **config** (object) - Configuration object for specific attribute types like `currency` or `record_reference`. #### Response Example ```json { "example": [ { "id": "workspace123_object456_attr789", "title": "Name", "description": "The name as registered in our database", "api_slug": "name", "type": "text", "is_archived": false, "is_required": true, "is_unique": false, "is_multiselect": false, "is_default_value_enabled": false, "default_value": null, "created_at": "2023-10-27T10:00:00Z", "config": {} } ] } ``` ## Attribute Types ### Description Details the various types of attributes supported by Attio, each with unique behaviors and configurations. ### Method GET ### Endpoint /docs/attribute-types ### Parameters None ### Request Example ```json { "example": "GET /docs/attribute-types" } ``` ### Response #### Success Response (200) Lists all available attribute types and links to their detailed documentation. - **Actor reference** - **Checkbox** - **Currency** - **Date** - **Domain** - **Email address** - **Interaction** - **Location** - **(Personal) name** - **Number** - **Phone number** - **Rating** - **Record reference** - **Select** - **Status** - **Text** - **Timestamp** #### Response Example ```json { "example": [ { "name": "Actor reference", "url": "/docs/attribute-types/attribute-types-actor-reference" }, { "name": "Checkbox", "url": "/docs/attribute-types/attribute-types-checkbox" } // ... other attribute types ] } ``` ``` -------------------------------- ### Writing Actor References (Workspace Member) Source: https://docs.attio.com/docs/attribute-types/attribute-types-actor-reference Illustrates how to write actor references, specifically for workspace members, using email addresses or explicit actor type and ID. Supports single-select and multi-select attributes. ```json { "owner": ["[email protected]"] } ``` ```json { "owner": "[email protected]" } ``` ```json { "owner": [ { "workspace_member_email_address": "[email protected]" } ] } ``` ```json { "owner": [ { "referenced_actor_type": "workspace-member", "referenced_actor_id": "50cf242c-7fa3-4cad-87d0-75b1af71c57b" } ] } ``` -------------------------------- ### Attio Record Response with Slug Values (JSON) Source: https://docs.attio.com/docs/slugs-and-ids Shows the structure of a record response from Attio's API, where attribute values are keyed by their slugs and include detailed information about each attribute. ```json { "data": { "values": { "email_addresses": [ { "active_from": "2023-06-01T15:49:08.524000000Z", "active_until": null, "created_by_actor": { "type": "api-token", "id": "d475d597-2900-4c93-841c-9f83154f21dc" }, "original_email_address": "[email protected]", "email_address": "[email protected]", "email_domain": "bell-labs.com", "email_root_domain": "bell-labs.com", "email_local_specifier": "r.hamming", "attribute_type": "email-address" } ] // other values... } // other properties on data... } } ``` -------------------------------- ### Writable Company Attributes API Source: https://docs.attio.com/docs/standard-objects/standard-objects-companies This section details the attributes that can be read and written via the API for Company objects. ```APIDOC ## Writable Company Attributes API ### Description This endpoint allows for the modification of various attributes associated with Company objects. ### Method PUT ### Endpoint /websites/attio ### Parameters #### Request Body - **domains** (Domain) - Multiselect - The domains associated with the company. - **name** (Text) - The name of the company. - **description** (Text) - A description of the company. - **team** (Record reference) - A reference to the team associated with the company. This is the inverse of `Person -> company` and is multiselect. - **categories** (Select) - Multiselect - Categories assigned to the company. - **primary_location** (Location) - The primary location of the company. - **angellist** (Text) - The AngelList profile URL for the company. - **facebook** (Text) - The Facebook profile URL for the company. - **instagram** (Text) - The Instagram profile URL for the company. - **linkedin** (Text) - The LinkedIn profile URL for the company. - **twitter** (Text) - The Twitter profile URL for the company. - **associated_deals** (Record reference) - A reference to deals associated with the company. This is the inverse of `Deal -> associated_companies` and is only visible if Deals are activated. - **associated_workspaces** (Record reference) - A reference to workspaces associated with the company. This is the inverse of `Workspace -> company` and is only visible if Workspaces are activated. ### Request Example ```json { "domains": ["example.com", "another.com"], "name": "Example Company", "description": "A leading technology company.", "team": ["team-id-1", "team-id-2"], "categories": ["Technology", "SaaS"], "primary_location": {"city": "San Francisco", "country": "USA"}, "angellist": "https://angel.co/company/example", "facebook": "https://facebook.com/examplecompany", "instagram": "https://instagram.com/examplecompany", "linkedin": "https://linkedin.com/company/example", "twitter": "https://twitter.com/examplecompany", "associated_deals": ["deal-id-1"], "associated_workspaces": ["workspace-id-1"] } ``` ### Response #### Success Response (200) - **status** (string) - Indicates the success of the operation. #### Response Example ```json { "status": "success" } ``` ``` -------------------------------- ### Writing Domain Values Source: https://docs.attio.com/docs/attribute-types/attribute-types-domain Explains how to write domain values to an attribute. Values can be provided as simple strings, arrays of strings, or an array of objects with a 'domain' key. The 'root_domain' is inferred automatically. ```APIDOC ## Writing Domain Values ### Description This section describes how to write domain values to an attribute. Values can be provided as strings or objects, and are always wrapped in an array for multi-select attributes. ### Method POST ### Endpoint `/websites/attio/domain` ### Parameters #### Request Body - **domains** (array) - Required - An array containing domain values. - Each element can be a string (e.g., "app.attio.com") or an object with a single key 'domain' (e.g., {"domain": "app.attio.com"}). ### Request Example #### Using string (single value) ```json { "domains": ["app.attio.com"] } ``` #### Using string (multiple values) ```json { "domains": ["app.attio.com", "attio.com"] } ``` #### Using object ```json { "domains": [ { "domain": "app.attio.com" } ] } ``` ### Response #### Success Response (200) Indicates successful writing of domain values. #### Response Example (Typically returns the updated object or a success status) ``` -------------------------------- ### Writing Timestamp Values Source: https://docs.attio.com/docs/attribute-types/attribute-types-timestamp Shows how to set timestamp attribute values. Values can be provided as a simple string or an object with a 'value' property. Attio automatically coerces various string formats into the full ISO 8601 UTC format. ```text { "my_timestamp_attribute": "2019-01-17T15:17:48.000000000Z" } ``` ```json { "my_timestamp_attribute": [ { "value": "2019-01-17T15:17:48.000000000Z" } ] } ```