### TypeScript Example Usage Source: https://github.com/d-stoll/attio-js/blob/main/docs/models/operations/postv2targetidentifierattributesattributeoptionsrequestbody.md Demonstrates how to import and instantiate the PostV2TargetIdentifierAttributesAttributeOptionsRequestBody in TypeScript. Ensure the 'attio-js' library is installed. ```typescript import { PostV2TargetIdentifierAttributesAttributeOptionsRequestBody } from "attio-js/models/operations/postv2targetidentifierattributesattributeoptions.js"; let value: PostV2TargetIdentifierAttributesAttributeOptionsRequestBody = { data: { title: "Medium", }, }; ``` -------------------------------- ### TypeScript: PostV2ObjectsRequest Example Source: https://github.com/d-stoll/attio-js/blob/main/docs/models/operations/postv2objectsrequest.md Demonstrates how to instantiate and use the PostV2ObjectsRequest model in TypeScript. Ensure the 'attio-js' library is installed. ```typescript import { PostV2ObjectsRequest } from "attio-js/models/operations/postv2objects.js"; let value: PostV2ObjectsRequest = { data: { apiSlug: "people", singularNoun: "Person", pluralNoun: "People", }, }; ``` -------------------------------- ### GetV2NotesRequest Example Source: https://github.com/d-stoll/attio-js/blob/main/docs/models/operations/getv2notesrequest.md Demonstrates how to instantiate the GetV2NotesRequest object with specific parameters. Ensure the attio-js library is installed and imported. ```typescript import { GetV2NotesRequest } from "attio-js/models/operations/getv2notes.js"; let value: GetV2NotesRequest = { limit: 10, offset: 5, parentObject: "people", parentRecordId: "891dcbfc-9141-415d-9b2a-2238a6cc012d", }; ``` -------------------------------- ### TypeScript Example Usage Source: https://github.com/d-stoll/attio-js/blob/main/docs/models/operations/getv2targetidentifierattributesattributeoptionsresponse.md Demonstrates how to import and initialize the GetV2TargetIdentifierAttributesAttributeOptionsResponse object in TypeScript. Ensure the 'attio-js' library is installed. ```typescript import { GetV2TargetIdentifierAttributesAttributeOptionsResponse } from "attio-js/models/operations/getv2targetidentifierattributesattributeoptions.js"; let value: GetV2TargetIdentifierAttributesAttributeOptionsResponse = { data: [], }; ``` -------------------------------- ### Instantiate PostV2TargetIdentifierAttributesAttributeStatusesData Source: https://github.com/d-stoll/attio-js/blob/main/docs/models/operations/postv2targetidentifierattributesattributestatusesdata.md Example of how to import and create an instance of the PostV2TargetIdentifierAttributesAttributeStatusesData model. Ensure the 'attio-js' library is installed. ```typescript import { PostV2TargetIdentifierAttributesAttributeStatusesData } from "attio-js/models/operations/postv2targetidentifierattributesattributestatuses.js"; let value: PostV2TargetIdentifierAttributesAttributeStatusesData = { title: "In Progress", celebrationEnabled: true, targetTimeInStatus: "P0Y0M1DT0H0M0S", }; ``` -------------------------------- ### Example PostV2ListsListEntriesQueryResponse Usage Source: https://github.com/d-stoll/attio-js/blob/main/docs/models/operations/postv2listslistentriesqueryresponse.md Demonstrates how to define a PostV2ListsListEntriesQueryResponse object with sample data. Ensure the 'attio-js' library is installed and imported. ```typescript import { PostV2ListsListEntriesQueryResponse } from "attio-js/models/operations/postv2listslistentriesquery.js"; let value: PostV2ListsListEntriesQueryResponse = { data: [ { id: { workspaceId: "14beef7a-99f7-4534-a87e-70b564330a4c", listId: "33ebdbe9-e529-47c9-b894-0ba25e9c15c0", entryId: "2e6e29ea-c4e0-4f44-842d-78a891f8c156", }, parentRecordId: "891dcbfc-9141-415d-9b2a-2238a6cc012d", parentObject: "people", createdAt: "2022-11-21T13:22:49.061281000Z", entryValues: {}, }, ], }; ``` -------------------------------- ### Example Usage of GetV2ThreadsThreadIdResponse Source: https://github.com/d-stoll/attio-js/blob/main/docs/models/operations/getv2threadsthreadidresponse.md Demonstrates how to import and instantiate the GetV2ThreadsThreadIdResponse type with sample data. Ensure the 'attio-js' library is installed. ```typescript import { GetV2ThreadsThreadIdResponse } from "attio-js/models/operations/getv2threadsthreadid.js"; let value: GetV2ThreadsThreadIdResponse = { data: { id: { workspaceId: "14beef7a-99f7-4534-a87e-70b564330a4c", threadId: "a649e4d9-435c-43fb-83ba-847b4876f27a", }, comments: [], createdAt: "2023-01-01T15:00:00.000000000Z", }, }; ``` -------------------------------- ### PatchV2ListsListRequest Example Source: https://github.com/d-stoll/attio-js/blob/main/docs/models/operations/patchv2listslistrequest.md Demonstrates how to instantiate and populate a PatchV2ListsListRequest object. Ensure the 'attio-js' library is installed and imported. ```typescript import { PatchV2ListsListRequest } from "attio-js/models/operations/patchv2listslist.js"; let value: PatchV2ListsListRequest = { list: "33ebdbe9-e529-47c9-b894-0ba25e9c15c0", requestBody: { data: { name: "Enterprise Sales", apiSlug: "enterprise_sales", workspaceAccess: "read-and-write", workspaceMemberAccess: [ { workspaceMemberId: "50cf242c-7fa3-4cad-87d0-75b1af71c57b", level: "read-and-write", }, ], }, }, }; ``` -------------------------------- ### TypeScript Example Usage Source: https://github.com/d-stoll/attio-js/blob/main/docs/models/operations/getv2objectsobjectrecordsrecordidattributesattributevaluescurrencycode.md Demonstrates how to import and use the currency code type in TypeScript. Ensure the 'attio-js' library is installed. ```typescript import { GetV2ObjectsObjectRecordsRecordIdAttributesAttributeValuesCurrencyCode } from "attio-js/models/operations/getv2objectsobjectrecordsrecordidattributesattributevalues.js"; let value: GetV2ObjectsObjectRecordsRecordIdAttributesAttributeValuesCurrencyCode = "USD"; ``` -------------------------------- ### TypeScript Example Usage Source: https://github.com/d-stoll/attio-js/blob/main/docs/models/operations/getv2targetidentifierattributesattributerequest.md Demonstrates how to import and instantiate the GetV2TargetIdentifierAttributesAttributeRequest model in TypeScript. Ensure the 'attio-js' library is installed. ```typescript import { GetV2TargetIdentifierAttributesAttributeRequest } from "attio-js/models/operations/getv2targetidentifierattributesattribute.js"; let value: GetV2TargetIdentifierAttributesAttributeRequest = { target: "lists", identifier: "33ebdbe9-e529-47c9-b894-0ba25e9c15c0", attribute: "41252299-f8c7-4b5e-99c9-4ff8321d2f96", }; ``` -------------------------------- ### PostV2WebhooksRequest Usage Example Source: https://github.com/d-stoll/attio-js/blob/main/docs/models/operations/postv2webhooksrequest.md Demonstrates how to instantiate and use the PostV2WebhooksRequest model in TypeScript. Ensure the 'attio-js' library is installed and imported. ```typescript import { PostV2WebhooksRequest } from "attio-js/models/operations/postv2webhooks.js"; let value: PostV2WebhooksRequest = { data: { targetUrl: "https://example.com/webhook", subscriptions: [], }, }; ``` -------------------------------- ### TypeScript Example Usage Source: https://github.com/d-stoll/attio-js/blob/main/docs/models/operations/patchv2webhookswebhookidresponse.md Demonstrates how to define and assign a PatchV2WebhooksWebhookIdResponse object in TypeScript. Ensure the 'attio-js' library is installed and imported. ```typescript import { PatchV2WebhooksWebhookIdResponse } from "attio-js/models/operations/patchv2webhookswebhookid.js"; let value: PatchV2WebhooksWebhookIdResponse = { data: { targetUrl: "https://example.com/webhook", subscriptions: [], id: { workspaceId: "14beef7a-99f7-4534-a87e-70b564330a4c", webhookId: "23e42eaf-323a-41da-b5bb-fd67eebda553", }, status: "active", createdAt: "2023-04-27T13:22:49.061281000Z", }, }; ``` -------------------------------- ### TypeScript Example Usage Source: https://github.com/d-stoll/attio-js/blob/main/docs/models/operations/getv2listslistentriesentryidattributesattributevaluescreatedbyactortype5.md Demonstrates how to import and assign a value to the CreatedByActorType5 type in TypeScript. Ensure the attio-js library is installed. ```typescript import { GetV2ListsListEntriesEntryIdAttributesAttributeValuesCreatedByActorType5 } from "attio-js/models/operations/getv2listslistentriesentryidattributesattributevalues.js"; let value: GetV2ListsListEntriesEntryIdAttributesAttributeValuesCreatedByActorType5 = "workspace-member"; ``` -------------------------------- ### Example Usage of Currency Code Type Source: https://github.com/d-stoll/attio-js/blob/main/docs/models/operations/getv2listslistentriesentryidattributesattributevaluescurrencycode.md Demonstrates how to import and assign a currency code value. Ensure the 'attio-js' library is installed. ```typescript import { GetV2ListsListEntriesEntryIdAttributesAttributeValuesCurrencyCode } from "attio-js/models/operations/getv2listslistentriesentryidattributesattributevalues.js"; let value: GetV2ListsListEntriesEntryIdAttributesAttributeValuesCurrencyCode = "USD"; ``` -------------------------------- ### PatchV2ObjectsObjectRecordsRecordIdResponse Example Source: https://github.com/d-stoll/attio-js/blob/main/docs/models/operations/patchv2objectsobjectrecordsrecordidresponse.md Demonstrates how to define and initialize a PatchV2ObjectsObjectRecordsRecordIdResponse object with sample data. Ensure the 'attio-js' library is installed and imported. ```typescript import { PatchV2ObjectsObjectRecordsRecordIdResponse } from "attio-js/models/operations/patchv2objectsobjectrecordsrecordid.js"; let value: PatchV2ObjectsObjectRecordsRecordIdResponse = { data: { id: { workspaceId: "14beef7a-99f7-4534-a87e-70b564330a4c", objectId: "97052eb9-e65e-443f-a297-f2d9a4a7f795", recordId: "bf071e1f-6035-429d-b874-d83ea64ea13b", }, createdAt: "2022-11-21T13:22:49.061281000Z", values: { "key": "", }, }, }; ``` -------------------------------- ### TypeScript Example Usage Source: https://github.com/d-stoll/attio-js/blob/main/docs/models/operations/getv2listslistentriesentryidattributesattributevaluesattributetypeemailaddress.md Demonstrates how to import and use the EmailAddress attribute type in TypeScript. Ensure the 'attio-js' library is installed. ```typescript import { GetV2ListsListEntriesEntryIdAttributesAttributeValuesAttributeTypeEmailAddress } from "attio-js/models/operations/getv2listslistentriesentryidattributesattributevalues.js"; let value: GetV2ListsListEntriesEntryIdAttributesAttributeValuesAttributeTypeEmailAddress = "email-address"; ``` -------------------------------- ### PostV2ListsResponse Example Usage Source: https://github.com/d-stoll/attio-js/blob/main/docs/models/operations/postv2listsresponse.md Demonstrates how to import and use the PostV2ListsResponse type to define a successful response object. Ensure the 'attio-js' library is installed. ```typescript import { PostV2ListsResponse } from "attio-js/models/operations/postv2lists.js"; let value: PostV2ListsResponse = { data: { id: { workspaceId: "14beef7a-99f7-4534-a87e-70b564330a4c", listId: "33ebdbe9-e529-47c9-b894-0ba25e9c15c0", }, apiSlug: "hiring-engineering", name: "Hiring Engineering", parentObject: [ "people", ], workspaceAccess: "read-and-write", workspaceMemberAccess: [ { workspaceMemberId: "50cf242c-7fa3-4cad-87d0-75b1af71c57b", level: "read-and-write", }, ], createdByActor: { id: "50cf242c-7fa3-4cad-87d0-75b1af71c57b", type: "workspace-member", }, createdAt: "2022-11-21T13:22:49.061281000Z", }, }; ``` -------------------------------- ### TypeScript Example of PostV2ListsListEntriesQueryRequestBody Source: https://github.com/d-stoll/attio-js/blob/main/docs/models/operations/postv2listslistentriesqueryrequestbody.md Demonstrates how to construct a request body for querying list entries with filter, sort, limit, and offset parameters. Ensure the 'attio-js' library is installed. ```typescript import { PostV2ListsListEntriesQueryRequestBody } from "attio-js/models/operations/postv2listslistentriesquery.js"; let value: PostV2ListsListEntriesQueryRequestBody = { filter: { "name": "Ada Lovelace", }, sorts: [ { direction: "asc", attribute: "name", field: "last_name", }, ], limit: 500, offset: 0, }; ``` -------------------------------- ### SDK Example Usage Source: https://github.com/d-stoll/attio-js/blob/main/README.md Basic example demonstrating how to initialize the SDK and list objects. ```typescript import { Attio } from "attio-js"; const attio = new Attio({ apiKey: process.env["ATTIO_API_KEY"] ?? "", }); async function run() { const result = await attio.objects.list(); console.log(result); } run(); ``` -------------------------------- ### Install SDK with Bun Source: https://github.com/d-stoll/attio-js/blob/main/README.md Install the Attio SDK using the Bun package manager. ```bash bun add attio-js ``` -------------------------------- ### Install attio-js SDK Source: https://context7.com/d-stoll/attio-js/llms.txt Install the attio-js SDK using npm, pnpm, bun, or yarn. ```bash npm add attio-js # or pnpm add attio-js # or bun add attio-js # or yarn add attio-js ``` -------------------------------- ### NoteCreatedByActor Example Usage Source: https://github.com/d-stoll/attio-js/blob/main/docs/models/components/notecreatedbyactor.md Demonstrates how to import and define a NoteCreatedByActor object. Ensure you have the 'attio-js' library installed. ```typescript import { NoteCreatedByActor } from "attio-js/models/components/note.js"; let value: NoteCreatedByActor = { id: "50cf242c-7fa3-4cad-87d0-75b1af71c57b", type: "workspace-member", }; ``` -------------------------------- ### Build and Run Example Source: https://github.com/d-stoll/attio-js/blob/main/examples/README.md Build the project and execute an example TypeScript file using tsx. ```bash npm run build && npx tsx example.ts ``` -------------------------------- ### SDK Initialization Source: https://context7.com/d-stoll/attio-js/llms.txt Instantiate the main Attio client with your API key. The tree-shakeable core client is recommended for serverless/browser bundles. You can also specify a custom server URL. ```APIDOC ## SDK Initialization Instantiate the main `Attio` client with your API key. ```typescript import { Attio } from "attio-js"; // Standard class-based client const attio = new Attio({ apiKey: process.env["ATTIO_API_KEY"] ?? "", }); // Tree-shakeable core client (recommended for serverless/browser bundles) import { AttioCore } from "attio-js/core.js"; const core = new AttioCore({ apiKey: process.env["ATTIO_API_KEY"] ?? "", }); // Custom server URL const attioCustom = new Attio({ serverURL: "https://api.attio.com", apiKey: process.env["ATTIO_API_KEY"] ?? "", }); ``` ``` -------------------------------- ### SDK Installation Source: https://github.com/d-stoll/attio-js/blob/main/README.md Install the Attio SDK using your preferred package manager. ```bash npm add attio-js # or pnpm add attio-js # or bun add attio-js # or yarn add attio-js ``` -------------------------------- ### PatchV2ListsListRequestBody Example Source: https://github.com/d-stoll/attio-js/blob/main/docs/models/operations/patchv2listslistrequestbody.md Demonstrates how to create a PatchV2ListsListRequestBody object for updating a list. Ensure the 'attio-js' library is installed and imported. ```typescript import { PatchV2ListsListRequestBody } from "attio-js/models/operations/patchv2listslist.js"; let value: PatchV2ListsListRequestBody = { data: { name: "Enterprise Sales", apiSlug: "enterprise_sales", workspaceAccess: "read-and-write", workspaceMemberAccess: [ { workspaceMemberId: "50cf242c-7fa3-4cad-87d0-75b1af71c57b", level: "read-and-write", }, ], }, }; ``` -------------------------------- ### Install SDK with PNPM Source: https://github.com/d-stoll/attio-js/blob/main/README.md Install the Attio SDK using the pnpm package manager. ```bash pnpm add attio-js ``` -------------------------------- ### Install SDK with NPM Source: https://github.com/d-stoll/attio-js/blob/main/README.md Install the Attio SDK using the npm package manager. ```bash npm add attio-js ``` -------------------------------- ### Install SDK with Yarn Source: https://github.com/d-stoll/attio-js/blob/main/README.md Install the Attio SDK using the Yarn package manager. ```bash yarn add attio-js ``` -------------------------------- ### TypeScript Example Usage Source: https://github.com/d-stoll/attio-js/blob/main/docs/models/operations/getv2objectsobjectrecordsrecordidattributesattributevaluesreferencedactortype.md Demonstrates how to import and assign a value to the ReferencedActorType in TypeScript. Ensure you have the 'attio-js' library installed. ```typescript import { GetV2ObjectsObjectRecordsRecordIdAttributesAttributeValuesReferencedActorType } from "attio-js/models/operations/getv2objectsobjectrecordsrecordidattributesattributevalues.js"; let value: GetV2ObjectsObjectRecordsRecordIdAttributesAttributeValuesReferencedActorType = "workspace-member"; ``` -------------------------------- ### TypeScript Example for OwnerActor Source: https://github.com/d-stoll/attio-js/blob/main/docs/models/operations/getv2objectsobjectrecordsrecordidattributesattributevaluesowneractor.md Demonstrates how to import and define an OwnerActor object in TypeScript. Ensure you have the 'attio-js' library installed. ```typescript import { GetV2ObjectsObjectRecordsRecordIdAttributesAttributeValuesOwnerActor } from "attio-js/models/operations/getv2objectsobjectrecordsrecordidattributesattributevalues.js"; let value: GetV2ObjectsObjectRecordsRecordIdAttributesAttributeValuesOwnerActor = { id: "50cf242c-7fa3-4cad-87d0-75b1af71c57b", type: "workspace-member", }; ``` -------------------------------- ### Create Task (Client Instance) Source: https://github.com/d-stoll/attio-js/blob/main/docs/sdks/tasks/README.md Demonstrates how to create a task using the `attio.tasks.create` method on an Attio client instance. ```APIDOC ## POST /v2/tasks ### Description Creates a new task. ### Method POST ### Endpoint /v2/tasks ### Request Body - **data** (object) - Required - The task data. - **content** (string) - Required - The main content of the task. - **format** (string) - Required - The format of the content (e.g., "plaintext"). - **deadlineAt** (string) - Required - The deadline for the task in ISO 8601 format. - **isCompleted** (boolean) - Required - Indicates if the task is completed. - **linkedRecords** (array) - Optional - A list of records linked to the task. - **assignees** (array) - Optional - A list of users assigned to the task. ### Request Example ```json { "data": { "content": "Follow up on current software solutions", "format": "plaintext", "deadlineAt": "2023-01-01T15:00:00.000000000Z", "isCompleted": false, "linkedRecords": [], "assignees": [] } } ``` ### Response #### Success Response (200) - **result** (object) - The created task object. ``` -------------------------------- ### Initialize Attio Client Source: https://context7.com/d-stoll/attio-js/llms.txt Instantiate the main Attio client with your API key. The tree-shakeable core client is recommended for serverless/browser bundles. Supports custom server URLs. ```typescript import { Attio } from "attio-js"; // Standard class-based client const attio = new Attio({ apiKey: process.env["ATTIO_API_KEY"] ?? "", }); // Tree-shakeable core client (recommended for serverless/browser bundles) import { AttioCore } from "attio-js/core.js"; const core = new AttioCore({ apiKey: process.env["ATTIO_API_KEY"] ?? "", }); // Custom server URL const attioCustom = new Attio({ serverURL: "https://api.attio.com", apiKey: process.env["ATTIO_API_KEY"] ?? "", }); ``` -------------------------------- ### TypeScript Example for CreatedByActor11 Source: https://github.com/d-stoll/attio-js/blob/main/docs/models/operations/getv2objectsobjectrecordsrecordidattributesattributevaluescreatedbyactor11.md Demonstrates how to define and initialize a GetV2ObjectsObjectRecordsRecordIdAttributesAttributeValuesCreatedByActor11 object in TypeScript. Ensure the attio-js library is installed. ```typescript import { GetV2ObjectsObjectRecordsRecordIdAttributesAttributeValuesCreatedByActor11 } from "attio-js/models/operations/getv2objectsobjectrecordsrecordidattributesattributevalues.js"; let value: GetV2ObjectsObjectRecordsRecordIdAttributesAttributeValuesCreatedByActor11 = { id: "50cf242c-7fa3-4cad-87d0-75b1af71c57b", type: "workspace-member", }; ``` -------------------------------- ### Example Usage Source: https://github.com/d-stoll/attio-js/blob/main/docs/models/operations/postv2targetidentifierattributesattributestatusesrequest.md Demonstrates how to import and instantiate the PostV2TargetIdentifierAttributesAttributeStatusesRequest with sample data. ```APIDOC ## PostV2TargetIdentifierAttributesAttributeStatusesRequest ### Description This model represents the request structure for updating the status of an attribute associated with a specific target identifier. ### Usage ```typescript import { PostV2TargetIdentifierAttributesAttributeStatusesRequest } from "attio-js/models/operations/postv2targetidentifierattributesattributestatuses.js"; let value: PostV2TargetIdentifierAttributesAttributeStatusesRequest = { target: "lists", identifier: "33ebdbe9-e529-47c9-b894-0ba25e9c15c0", attribute: "41252299-f8c7-4b5e-99c9-4ff8321d2f96", requestBody: { data: { title: "In Progress", celebrationEnabled: true, targetTimeInStatus: "P0Y0M1DT0H0M0S", }, }, }; ``` ### Properties - **target** (string) - Required - The type of target (e.g., "lists"). - **identifier** (string) - Required - The unique identifier of the target. - **attribute** (string) - Required - The unique identifier of the attribute. - **requestBody** (object) - Required - The body of the request containing the attribute status data. - **data** (object) - Required - The attribute status data. - **title** (string) - Required - The new status title. - **celebrationEnabled** (boolean) - Optional - Whether to enable celebration for this status. - **targetTimeInStatus** (string) - Optional - The duration for which the attribute should remain in this status, formatted as an ISO 8601 duration string (e.g., "P0Y0M1DT0H0M0S"). ``` -------------------------------- ### Example Usage of InteractionType Source: https://github.com/d-stoll/attio-js/blob/main/docs/models/operations/getv2listslistentriesentryidattributesattributevaluesinteractiontype.md Demonstrates how to import and assign a value to the InteractionType type. Ensure the 'attio-js' library is installed. ```typescript import { GetV2ListsListEntriesEntryIdAttributesAttributeValuesInteractionType } from "attio-js/models/operations/getv2listslistentriesentryidattributesattributevalues.js"; let value: GetV2ListsListEntriesEntryIdAttributesAttributeValuesInteractionType = "email"; ``` -------------------------------- ### Example Usage Source: https://github.com/d-stoll/attio-js/blob/main/docs/models/operations/getv2listslistentriesentryidattributesattributevaluesdataemailaddress.md Demonstrates how to instantiate and populate the GetV2ListsListEntriesEntryIdAttributesAttributeValuesDataEmailAddress object. ```APIDOC ## GetV2ListsListEntriesEntryIdAttributesAttributeValuesDataEmailAddress ### Description Represents an email address attribute value within the Attio API. ### Usage ```typescript import { GetV2ListsListEntriesEntryIdAttributesAttributeValuesDataEmailAddress } from "attio-js/models/operations/getv2listslistentriesentryidattributesattributevalues.js"; let value: GetV2ListsListEntriesEntryIdAttributesAttributeValuesDataEmailAddress = { activeFrom: new Date("2023-01-01T15:00:00.000000000Z"), activeUntil: new Date("2023-01-01T15:00:00.000000000Z"), createdByActor: { id: "50cf242c-7fa3-4cad-87d0-75b1af71c57b", type: "workspace-member", }, originalEmailAddress: "alice@app.attio.com", emailAddress: "alice@app.attio.com", emailDomain: "app.attio.com", emailRootDomain: "attio.com", emailLocalSpecifier: "alice", attributeType: "email-address", }; ``` ### Properties - **activeFrom** (Date) - The date and time when the attribute value became active. - **activeUntil** (Date) - The date and time when the attribute value becomes inactive. - **createdByActor** (object) - Information about the actor who created this attribute value. - **id** (string) - The ID of the actor. - **type** (string) - The type of the actor (e.g., "workspace-member"). - **originalEmailAddress** (string) - The original email address provided. - **emailAddress** (string) - The normalized email address. - **emailDomain** (string) - The domain part of the email address. - **emailRootDomain** (string) - The root domain of the email address. - **emailLocalSpecifier** (string) - The local part of the email address. - **attributeType** (string) - The type of the attribute, must be "email-address". ``` -------------------------------- ### Create Webhook Source: https://github.com/d-stoll/attio-js/blob/main/docs/sdks/webhooks/README.md This snippet demonstrates how to create a new webhook using the Attio SDK. It shows the necessary imports, client initialization, and the call to the `create` method with the required `targetUrl` and `subscriptions`. ```APIDOC ## POST /v2/webhooks ### Description Creates a new webhook subscription. ### Method POST ### Endpoint /v2/webhooks ### Request Body - **data** (object) - Required - The webhook data. - **targetUrl** (string) - Required - The URL to send webhook events to. - **subscriptions** (array) - Required - A list of subscriptions for the webhook. ### Request Example ```json { "data": { "targetUrl": "https://example.com/webhook", "subscriptions": [] } } ``` ### Response #### Success Response (200) - **result** (object) - The created webhook object. ``` -------------------------------- ### Instantiate GetV2WebhooksData Model Source: https://github.com/d-stoll/attio-js/blob/main/docs/models/operations/getv2webhooksdata.md Demonstrates how to create an instance of the GetV2WebhooksData model with sample data. Ensure the 'attio-js' library is installed and imported. ```typescript import { GetV2WebhooksData } from "attio-js/models/operations/getv2webhooks.js"; let value: GetV2WebhooksData = { targetUrl: "https://example.com/webhook", subscriptions: [], id: { workspaceId: "14beef7a-99f7-4534-a87e-70b564330a4c", webhookId: "23e42eaf-323a-41da-b5bb-fd67eebda553", }, status: "active", createdAt: "2023-04-27T13:22:49.061281000Z", }; ``` -------------------------------- ### TypeScript Example Usage of PostV2WebhooksDollarOrNotEqualsRequest Source: https://github.com/d-stoll/attio-js/blob/main/docs/models/operations/postv2webhooksdollarornotequalsrequest.md Demonstrates how to import and instantiate the PostV2WebhooksDollarOrNotEqualsRequest object in TypeScript. Ensure the 'attio-js' library is installed. ```typescript import { PostV2WebhooksDollarOrNotEqualsRequest } from "attio-js/models/operations/postv2webhooks.js"; let value: PostV2WebhooksDollarOrNotEqualsRequest = { field: "", operator: "not_equals", value: "", }; ``` -------------------------------- ### Attribute Config Example Source: https://github.com/d-stoll/attio-js/blob/main/docs/models/components/config.md Demonstrates how to define configuration for currency and record reference attributes. Ensure the necessary imports are included. ```typescript import { Config } from "attio-js/models/components/attribute.js"; let value: Config = { currency: { defaultCurrencyCode: "USD", displayType: "code", }, recordReference: { allowedObjectIds: [ "97052eb9-e65e-443f-a297-f2d9a4a7f795", ], }, }; ``` -------------------------------- ### PostV2TasksAssigneeWorkspaceMember Example Source: https://github.com/d-stoll/attio-js/blob/main/docs/models/operations/postv2tasksassigneeworkspacemember.md This snippet demonstrates how to import and initialize the PostV2TasksAssigneeWorkspaceMember model with required fields. Ensure you have the 'attio-js' library installed. ```typescript import { PostV2TasksAssigneeWorkspaceMember } from "attio-js/models/operations/postv2tasks.js"; let value: PostV2TasksAssigneeWorkspaceMember = { referencedActorType: "workspace-member", referencedActorId: "50cf242c-7fa3-4cad-87d0-75b1af71c57b", }; ``` -------------------------------- ### List Objects with Attio JS SDK Source: https://github.com/d-stoll/attio-js/blob/main/USAGE.md Initialize the Attio client with an API key and list objects. Ensure the ATTIO_API_KEY environment variable is set. ```typescript import { Attio } from "attio-js"; const attio = new Attio({ apiKey: process.env["ATTIO_API_KEY"] ?? "", }); async function run() { const result = await attio.objects.list(); console.log(result); } run(); ``` -------------------------------- ### PostV2ListsWorkspaceMemberAccess Example Usage Source: https://github.com/d-stoll/attio-js/blob/main/docs/models/operations/postv2listsworkspacememberaccess.md This snippet demonstrates how to import and define a PostV2ListsWorkspaceMemberAccess object in TypeScript. Ensure the 'attio-js' library is installed. ```typescript import { PostV2ListsWorkspaceMemberAccess } from "attio-js/models/operations/postv2lists.js"; let value: PostV2ListsWorkspaceMemberAccess = { workspaceMemberId: "50cf242c-7fa3-4cad-87d0-75b1af71c57b", level: "read-and-write", }; ``` -------------------------------- ### Creating an OutputValueText Instance Source: https://github.com/d-stoll/attio-js/blob/main/docs/models/components/outputvaluetext.md Demonstrates how to import and instantiate the OutputValueText model with a sample text value and the 'text' attribute type. Values are limited to 10MB. ```typescript import { OutputValueText } from "attio-js/models/components/outputvalue.js"; let value: OutputValueText = { value: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.", attributeType: "text", }; ``` -------------------------------- ### PatchV2ObjectsObjectRecordsRecordIdId Example Usage Source: https://github.com/d-stoll/attio-js/blob/main/docs/models/operations/patchv2objectsobjectrecordsrecordidid.md Demonstrates how to import and define a PatchV2ObjectsObjectRecordsRecordIdId object with required fields. Ensure you have the 'attio-js' library installed. ```typescript import { PatchV2ObjectsObjectRecordsRecordIdId } from "attio-js/models/operations/patchv2objectsobjectrecordsrecordid.js"; let value: PatchV2ObjectsObjectRecordsRecordIdId = { workspaceId: "14beef7a-99f7-4534-a87e-70b564330a4c", objectId: "97052eb9-e65e-443f-a297-f2d9a4a7f795", recordId: "bf071e1f-6035-429d-b874-d83ea64ea13b", }; ``` -------------------------------- ### Instantiate PostV2NotesData Model Source: https://github.com/d-stoll/attio-js/blob/main/docs/models/operations/postv2notesdata.md Demonstrates how to import and create an instance of the PostV2NotesData model with sample data. Ensure all required fields are populated correctly. ```typescript import { PostV2NotesData } from "attio-js/models/operations/postv2notes.js"; let value: PostV2NotesData = { parentObject: "people", parentRecordId: "891dcbfc-9141-415d-9b2a-2238a6cc012d", title: "Initial Prospecting Call Summary", format: "plaintext", content: "Introduction\n" + "Date and time of the call\n" + "Participants\n" + "Purpose of the call\n" + "Customer Background\n" + "Company overview (industry, size, location)\n" + "Key business challenges\n" + "Current software solutions (if any) and pain points", createdAt: "2023-01-01T15:00:00.000000000Z", }; ``` -------------------------------- ### TypeScript Example for CreatedByActorType4 Source: https://github.com/d-stoll/attio-js/blob/main/docs/models/operations/getv2objectsobjectrecordsrecordidattributesattributevaluescreatedbyactortype4.md Demonstrates how to import and assign a value to the CreatedByActorType4 type in TypeScript. Ensure you have the 'attio-js' library installed. ```typescript import { GetV2ObjectsObjectRecordsRecordIdAttributesAttributeValuesCreatedByActorType4 } from "attio-js/models/operations/getv2objectsobjectrecordsrecordidattributesattributevalues.js"; let value: GetV2ObjectsObjectRecordsRecordIdAttributesAttributeValuesCreatedByActorType4 = "system"; ``` -------------------------------- ### Create RecordT Object Source: https://github.com/d-stoll/attio-js/blob/main/docs/models/operations/recordt.md Demonstrates how to create an instance of the RecordT model. Ensure the 'attio-js' library is installed and imported. ```typescript import { RecordT } from "attio-js/models/operations/postv2comments.js"; let value: RecordT = { object: "97052eb9-e65e-443f-a297-f2d9a4a7f795", recordId: "bf071e1f-6035-429d-b874-d83ea64ea13b", }; ``` -------------------------------- ### Instantiate List Model Source: https://github.com/d-stoll/attio-js/blob/main/docs/models/components/list.md Demonstrates how to create an instance of the List model with its required properties. Ensure the 'attio-js/models/components/list.js' module is imported. ```typescript import { List } from "attio-js/models/components/list.js"; let value: List = { id: { workspaceId: "14beef7a-99f7-4534-a87e-70b564330a4c", listId: "33ebdbe9-e529-47c9-b894-0ba25e9c15c0", }, apiSlug: "hiring-engineering", name: "Hiring Engineering", parentObject: [ "people", ], workspaceAccess: "read-and-write", workspaceMemberAccess: [ { workspaceMemberId: "50cf242c-7fa3-4cad-87d0-75b1af71c57b", level: "read-and-write", }, ], createdByActor: { id: "50cf242c-7fa3-4cad-87d0-75b1af71c57b", type: "workspace-member", }, createdAt: "2022-11-21T13:22:49.061281000Z", }; ``` -------------------------------- ### TypeScript Example Usage Source: https://github.com/d-stoll/attio-js/blob/main/docs/models/operations/getv2listslistentriesentryidattributesattributevaluescreatedbyactortype8.md Demonstrates how to import and assign a value to the GetV2ListsListEntriesEntryIdAttributesAttributeValuesCreatedByActorType8 type in TypeScript. Ensure the attio-js library is installed. ```typescript import { GetV2ListsListEntriesEntryIdAttributesAttributeValuesCreatedByActorType8 } from "attio-js/models/operations/getv2listslistentriesentryidattributesattributevalues.js"; let value: GetV2ListsListEntriesEntryIdAttributesAttributeValuesCreatedByActorType8 = "workspace-member"; ``` -------------------------------- ### TypeScript Example Usage Source: https://github.com/d-stoll/attio-js/blob/main/docs/models/operations/getv2listslistentriesentryidattributesattributevaluescreatedbyactortype9.md Demonstrates how to import and assign a value to the CreatedByActorType9 type in TypeScript. Ensure the 'attio-js' library is installed. ```typescript import { GetV2ListsListEntriesEntryIdAttributesAttributeValuesCreatedByActorType9 } from "attio-js/models/operations/getv2listslistentriesentryidattributesattributevalues.js"; let value: GetV2ListsListEntriesEntryIdAttributesAttributeValuesCreatedByActorType9 = "app"; ``` -------------------------------- ### Bearer Model Example Source: https://github.com/d-stoll/attio-js/blob/main/docs/models/operations/bearer.md Demonstrates how to import and instantiate the Bearer model with sample data. Ensure all required fields are populated correctly. ```typescript import { Bearer } from "attio-js/models/operations/getv2self.js"; let value: Bearer = { active: false, scope: "", clientId: "", tokenType: "Bearer", exp: 8372.17, iat: 9701.78, sub: "3a422077-1297-4444-92a7-38cea12c1fbc", aud: "", iss: "attio.com", authorizedByWorkspaceMemberId: "0a99c8d3-9dd1-4fa3-89a7-8c04964d82a6", workspaceId: "32a06ed1-c2e7-45fd-a6f7-b0f8a10821ce", workspaceName: "", workspaceSlug: "", workspaceLogoUrl: "https://glass-sightseeing.name/", }; ``` -------------------------------- ### TypeScript Example Usage Source: https://github.com/d-stoll/attio-js/blob/main/docs/models/operations/getv2objectsobjectrecordsrecordidentriesrequest.md Demonstrates how to instantiate and populate a GetV2ObjectsObjectRecordsRecordIdEntriesRequest object with required and optional fields. ```typescript import { GetV2ObjectsObjectRecordsRecordIdEntriesRequest } from "attio-js/models/operations/getv2objectsobjectrecordsrecordidentries.js"; let value: GetV2ObjectsObjectRecordsRecordIdEntriesRequest = { object: "people", recordId: "891dcbfc-9141-415d-9b2a-2238a6cc012d", limit: 10, offset: 5, }; ``` -------------------------------- ### TypeScript Example Usage Source: https://github.com/d-stoll/attio-js/blob/main/docs/models/operations/getv2listslistentriesentryidattributesattributevaluescreatedbyactortype17.md Demonstrates how to import and assign a value to the CreatedByActorType17 type in TypeScript. Ensure the 'attio-js' library is installed. ```typescript import { GetV2ListsListEntriesEntryIdAttributesAttributeValuesCreatedByActorType17 } from "attio-js/models/operations/getv2listslistentriesentryidattributesattributevalues.js"; let value: GetV2ListsListEntriesEntryIdAttributesAttributeValuesCreatedByActorType17 = "app"; ``` -------------------------------- ### TypeScript Usage Example Source: https://github.com/d-stoll/attio-js/blob/main/docs/models/operations/getv2listslistentriesentryidattributesattributevaluescreatedbyactortype15.md Demonstrates how to import and assign a value to the CreatedByActorType15 type in TypeScript. Ensure the 'attio-js' library is installed. ```typescript import { GetV2ListsListEntriesEntryIdAttributesAttributeValuesCreatedByActorType15 } from "attio-js/models/operations/getv2listslistentriesentryidattributesattributevalues.js"; let value: GetV2ListsListEntriesEntryIdAttributesAttributeValuesCreatedByActorType15 = "system"; ``` -------------------------------- ### TypeScript Example Usage Source: https://github.com/d-stoll/attio-js/blob/main/docs/models/operations/getv2listslistentriesentryidattributesattributevaluescreatedbyactortype4.md Demonstrates how to import and assign an actor type value in TypeScript. Ensure the 'attio-js' library is installed. ```typescript import { GetV2ListsListEntriesEntryIdAttributesAttributeValuesCreatedByActorType4 } from "attio-js/models/operations/getv2listslistentriesentryidattributesattributevalues.js"; let value: GetV2ListsListEntriesEntryIdAttributesAttributeValuesCreatedByActorType4 = "system"; ``` -------------------------------- ### PostV2TargetIdentifierAttributesConfig Example Source: https://github.com/d-stoll/attio-js/blob/main/docs/models/operations/postv2targetidentifierattributesconfig.md Demonstrates how to instantiate and configure the PostV2TargetIdentifierAttributesConfig object with currency and record reference settings. This is useful for setting up custom attributes. ```typescript import { PostV2TargetIdentifierAttributesConfig } from "attio-js/models/operations/postv2targetidentifierattributes.js"; let value: PostV2TargetIdentifierAttributesConfig = { currency: { defaultCurrencyCode: "USD", displayType: "symbol", }, recordReference: { allowedObjects: [ "people", ], }, }; ``` -------------------------------- ### Instantiate Task Model Source: https://github.com/d-stoll/attio-js/blob/main/docs/models/components/task.md Demonstrates how to create a new Task object with all its properties. Ensure all required fields like id, contentPlaintext, and createdAt are populated correctly. ```typescript import { Task } from "attio-js/models/components/task.js"; let value: Task = { id: { workspaceId: "14beef7a-99f7-4534-a87e-70b564330a4c", taskId: "649e34f4-c39a-4f4d-99ef-48a36bef8f04", }, contentPlaintext: "Follow up on current software solutions", deadlineAt: "2023-01-01", isCompleted: false, linkedRecords: [ { targetObjectId: "people", targetRecordId: "891dcbfc-9141-415d-9b2a-2238a6cc012d", }, ], assignees: [], createdByActor: { id: "50cf242c-7fa3-4cad-87d0-75b1af71c57b", type: "workspace-member", }, createdAt: "2022-11-21T13:22:49.061281000Z", }; ``` -------------------------------- ### TypeScript Example Usage Source: https://github.com/d-stoll/attio-js/blob/main/docs/models/operations/getv2listslistentriesentryidattributesattributevaluescreatedbyactortype2.md Demonstrates how to import and assign an actor type value in TypeScript. Ensure the 'attio-js' library is installed. ```typescript import { GetV2ListsListEntriesEntryIdAttributesAttributeValuesCreatedByActorType2 } from "attio-js/models/operations/getv2listslistentriesentryidattributesattributevalues.js"; let value: GetV2ListsListEntriesEntryIdAttributesAttributeValuesCreatedByActorType2 = "app"; ``` -------------------------------- ### TypeScript Usage Example Source: https://github.com/d-stoll/attio-js/blob/main/docs/models/operations/getv2listslistentriesentryidattributesattributevaluescreatedbyactortype13.md Demonstrates how to import and assign a value to the CreatedByActorType13 type in TypeScript. Ensure you have the 'attio-js' library installed. ```typescript import { GetV2ListsListEntriesEntryIdAttributesAttributeValuesCreatedByActorType13 } from "attio-js/models/operations/getv2listslistentriesentryidattributesattributevalues.js"; let value: GetV2ListsListEntriesEntryIdAttributesAttributeValuesCreatedByActorType13 = "workspace-member"; ``` -------------------------------- ### Instantiate WorkspaceMember Model Source: https://github.com/d-stoll/attio-js/blob/main/docs/models/components/workspacemember.md Demonstrates how to create an instance of the WorkspaceMember model with sample data. Ensure the 'attio-js' library is installed and imported correctly. ```typescript import { WorkspaceMember } from "attio-js/models/components/workspacemember.js"; let value: WorkspaceMember = { id: { workspaceId: "14beef7a-99f7-4534-a87e-70b564330a4c", workspaceMemberId: "50cf242c-7fa3-4cad-87d0-75b1af71c57b", }, firstName: "Susan", lastName: "Kare", avatarUrl: "https://lh3.googleusercontent.com/a/ABdFTp7z6OgAW9EqZx78wTqPfWClGCJCZXFjQfBG7rd9=s96-c", emailAddress: "susan.kare@apple.com", createdAt: "2022-11-21T13:22:49.061281000Z", accessLevel: "member", }; ``` -------------------------------- ### TypeScript Example Usage Source: https://github.com/d-stoll/attio-js/blob/main/docs/models/operations/getv2listslistentriesentryidattributesattributevaluescreatedbyactortype10.md Demonstrates how to import and assign a value to the CreatedByActorType10 type in TypeScript. Ensure the 'attio-js' library is installed. ```typescript import { GetV2ListsListEntriesEntryIdAttributesAttributeValuesCreatedByActorType10 } from "attio-js/models/operations/getv2listslistentriesentryidattributesattributevalues.js"; let value: GetV2ListsListEntriesEntryIdAttributesAttributeValuesCreatedByActorType10 = "workspace-member"; ``` -------------------------------- ### Instantiate PostV2WebhooksFilterResponse1 Source: https://github.com/d-stoll/attio-js/blob/main/docs/models/operations/postv2webhooksfilterresponse1.md Demonstrates how to import and create an instance of the PostV2WebhooksFilterResponse1 model. The `dollarOr` field is required and expects an array. ```typescript import { PostV2WebhooksFilterResponse1 } from "attio-js/models/operations/postv2webhooks.js"; let value: PostV2WebhooksFilterResponse1 = { dollarOr: [], }; ``` -------------------------------- ### PostV2TasksResponse Example Usage Source: https://github.com/d-stoll/attio-js/blob/main/docs/models/operations/postv2tasksresponse.md Demonstrates how to import and use the PostV2TasksResponse type to define a task object. Ensure the attio-js library is installed. ```typescript import { PostV2TasksResponse } from "attio-js/models/operations/postv2tasks.js"; let value: PostV2TasksResponse = { data: { id: { workspaceId: "14beef7a-99f7-4534-a87e-70b564330a4c", taskId: "649e34f4-c39a-4f4d-99ef-48a36bef8f04", }, contentPlaintext: "Follow up on current software solutions", deadlineAt: "2023-01-01", isCompleted: false, linkedRecords: [ { targetObjectId: "people", targetRecordId: "891dcbfc-9141-415d-9b2a-2238a6cc012d", }, ], assignees: [], createdByActor: { id: "50cf242c-7fa3-4cad-87d0-75b1af71c57b", type: "workspace-member", }, createdAt: "2022-11-21T13:22:49.061281000Z", }, }; ``` -------------------------------- ### Initialize Attio Client with Custom Server URL Source: https://github.com/d-stoll/attio-js/blob/main/README.md Override the default server URL by passing a `serverURL` to the `Attio` constructor. Ensure your `apiKey` is correctly set. ```typescript import { Attio } from "attio-js"; const attio = new Attio({ serverURL: "https://api.attio.com", apiKey: process.env["ATTIO_API_KEY"] ?? "", }); async function run() { const result = await attio.objects.list(); console.log(result); } run(); ``` -------------------------------- ### Example Usage of GetV2WebhooksWebhookIdEventType in TypeScript Source: https://github.com/d-stoll/attio-js/blob/main/docs/models/operations/getv2webhookswebhookideventtype.md Demonstrates how to import and assign a webhook event type to a variable in TypeScript. Ensure you have 'attio-js' installed. ```typescript import { GetV2WebhooksWebhookIdEventType } from "attio-js/models/operations/getv2webhookswebhookid.js"; let value: GetV2WebhooksWebhookIdEventType = "note.created"; ``` -------------------------------- ### Create a Webhook using Attio SDK Source: https://github.com/d-stoll/attio-js/blob/main/docs/sdks/webhooks/README.md Use this method to create a new webhook. Ensure your API key is set in the environment variables. ```typescript import { Attio } from "attio-js"; const attio = new Attio({ apiKey: process.env["ATTIO_API_KEY"] ?? "", }); async function run() { const result = await attio.webhooks.create({ data: { targetUrl: "https://example.com/webhook", subscriptions: [], }, }); console.log(result); } run(); ``` -------------------------------- ### TypeScript Webhook Event Type Example Source: https://github.com/d-stoll/attio-js/blob/main/docs/models/operations/getv2webhookseventtype.md Demonstrates how to import and assign a webhook event type in TypeScript. Ensure you have 'attio-js' installed. ```typescript import { GetV2WebhooksEventType } from "attio-js/models/operations/getv2webhooks.js"; let value: GetV2WebhooksEventType = "note.created"; ```