Maintainers
Pricing
Enterprise
More
More
Documentation
Try Live
Rankings
Install
Blog
Docs7
Ask
New
Add Docs
Lightfield App API
https://docs.lightfield.app/api/
Admin
Documentation repository created by Site2MD.
Tokens:
271,455
Snippets:
1,975
Trust Score:
9.4
Update:
4 months ago
Context
Chat
Benchmark
59
Latest
Show doc for...
Code
Info
Show Results
Tokens:
Raw
Copy
Link
Tokens:
Raw
Copy
Link
### Install Lightfield Go Library Source: https://docs.lightfield.app/api Install the Lightfield Go library using the go get command. Ensure you specify the version for compatibility. ```bash go get -u 'github.com/Lightfld/lightfield-go@v0.9.0' ``` -------------------------------- ### Install Lightfield Go Library Source: https://docs.lightfield.app/api/go Import the Lightfield Go library into your project. You can also pin a specific version using go get. ```go import ( "github.com/Lightfld/lightfield-go" // imported as githubcomlightfldlightfieldgo ) ``` ```go go get -u 'github.com/Lightfld/lightfield-go@v0.9.0' ``` -------------------------------- ### Install Lightfield CLI with Go Source: https://docs.lightfield.app/api/cli Install the CLI locally using Go version 1.22 or later. The binary will be placed in your Go bin directory. ```bash go install 'github.com/Lightfld/lightfield-cli/cmd/lightfield@latest' ``` -------------------------------- ### Install Lightfield with aiohttp Support Source: https://docs.lightfield.app/api/python Install the Lightfield library with the 'aiohttp' extra for improved concurrency performance. ```bash # install from PyPI pip install lightfield[aiohttp] ``` -------------------------------- ### Install Lightfield CLI with Homebrew Source: https://docs.lightfield.app/api/cli Use this command to install the Lightfield CLI if you have Homebrew installed. ```bash brew install Lightfld/lightfield/lightfield ``` -------------------------------- ### List Opportunities HTTP Request Source: https://docs.lightfield.app/api/resources/opportunity/methods/list Example of an HTTP GET request to list opportunities. Ensure to include the 'Lightfield-Version' header and your 'Authorization' token. ```curl curl https://api.lightfield.app/v1/opportunities \ -H 'Lightfield-Version: 2026-03-01' \ -H "Authorization: Bearer $API_KEY" ``` -------------------------------- ### Account List Response Example Source: https://docs.lightfield.app/api/go/resources/account/methods/list This is an example of a successful response when listing accounts, showing the structure of the returned data. ```json { "data": [ { "id": "id", "createdAt": "createdAt", "fields": { "foo": { "value": "string", "valueType": "ADDRESS" } }, "httpLink": "httpLink", "relationships": { "foo": { "cardinality": "cardinality", "objectType": "objectType", "values": [ "string" ] } }, "updatedAt": "updatedAt", "externalId": "externalId" } ], "object": "object", "totalCount": 0 } ``` -------------------------------- ### List Opportunities Source: https://docs.lightfield.app/api/cli/resources/opportunity Lists all opportunities. This is useful for getting an overview of all potential deals. ```bash $ lightfield opportunity list GET/v1/opportunities ``` -------------------------------- ### 200 OK Response Example Source: https://docs.lightfield.app/api/go/resources/list/methods/create This is the expected JSON response when a list is successfully created. ```json { "id": "id", "createdAt": "createdAt", "fields": { "foo": { "value": "string", "valueType": "ADDRESS" } }, "httpLink": "httpLink" } ``` -------------------------------- ### Account Creation Example Source: https://docs.lightfield.app/api/go Demonstrates how to create a new account using the Lightfield Go client. It shows how to set required fields like name and optional fields like industry. ```APIDOC ## Account.New ### Description Creates a new account with the specified fields. ### Method POST ### Endpoint /accounts ### Parameters #### Request Body - **Fields** (map[string]AccountNewParamsFieldUnion) - Required - A map of field names to their values for the account. ### Request Example ```json { "Fields": { "$name": { "OfString": "Acme Corp" }, "$industry": { "OfStringArray": ["opt_01j0x6q3m9v2p4t7k8n5r1s2u"] } } } ``` ### Response #### Success Response (200) - **ID** (string) - The unique identifier of the newly created account. #### Response Example ```json { "ID": "acc_12345abcde" } ``` ``` -------------------------------- ### List Opportunities in Go Source: https://docs.lightfield.app/api/go/resources/opportunity/methods/list Demonstrates how to initialize the Lightfld client and call the Opportunity.List method to retrieve a list of opportunities. Ensure you have your API key configured. ```Go package main import ( "context" "fmt" "github.com/Lightfld/lightfield-go" "github.com/Lightfld/lightfield-go/option" ) func main() { client := githubcomlightfldlightfieldgo.NewClient( option.WithAPIKey("My API Key"), ) opportunityListResponse, err := client.Opportunity.List(context.TODO(), githubcomlightfldlightfieldgo.OpportunityListParams{ }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", opportunityListResponse.Data) } ``` -------------------------------- ### List Accounts in Go Source: https://docs.lightfield.app/api/go/resources/account/methods/list Demonstrates how to initialize the Lightfld client and call the Account.List method to retrieve a list of accounts. Ensure you have your API key configured. ```go package main import ( "context" "fmt" "github.com/Lightfld/lightfield-go" "github.com/Lightfld/lightfield-go/option" ) func main() { client := githubcomlightfldlightfieldgo.NewClient( option.WithAPIKey("My API Key"), ) accountListResponse, err := client.Account.List(context.TODO(), githubcomlightfldlightfieldgo.AccountListParams{ }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", accountListResponse.Data) } ``` -------------------------------- ### Override Per-Request Retries Source: https://docs.lightfield.app/api/go Configures the number of retries for a specific request, overriding the client's default. This example sets retries to 5 for a single `Get` operation. ```go // Override per-request: client.Opportunity.Get( context.TODO(), "opp_cm9uvw890xyz123", option.WithMaxRetries(5), ) ``` -------------------------------- ### List Tasks in Go Source: https://docs.lightfield.app/api/go/resources/task/methods/list Demonstrates how to initialize the Lightfld client and call the List method to retrieve tasks. Ensure you have your API key configured. ```go package main import ( "context" "fmt" "github.com/Lightfld/lightfield-go" "github.com/Lightfld/lightfield-go/option" ) func main() { client := githubcomlightfldlightfieldgo.NewClient( option.WithAPIKey("My API Key"), ) taskListResponse, err := client.Task.List(context.TODO(), githubcomlightfldlightfieldgo.TaskListParams{ }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", taskListResponse.Data) } ``` -------------------------------- ### Get Note Field Definitions in Go Source: https://docs.lightfield.app/api/go/resources/note/methods/definitions Use this Go code to retrieve note field definitions. Ensure you have the Lightfld Go SDK installed and an API key. ```go package main import ( "context" "fmt" "github.com/Lightfld/lightfield-go" "github.com/Lightfld/lightfield-go/option" ) func main() { client := githubcomlightfldlightfieldgo.NewClient( option.WithAPIKey("My API Key"), ) noteDefinitionsResponse, err := client.Note.Definitions(context.TODO()) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", noteDefinitionsResponse.FieldDefinitions) } ``` -------------------------------- ### Basic Lightfield CLI Usage Example Source: https://docs.lightfield.app/api/cli Demonstrates the basic command structure for the Lightfield CLI, showing how to create an account with an API key and specific fields. ```bash lightfield account create \ --api-key 'My API Key' \ --fields '{$name: Acme Corp}' ``` -------------------------------- ### Account Creation (Async) Source: https://docs.lightfield.app/api/python Example of creating a new account using the asynchronous client. It shows how to use `await` for the API call and run it within an asyncio event loop. ```APIDOC ## Account Creation (Asynchronous) ### Description Creates a new account asynchronously with specified fields. ### Method `await client.account.create()` ### Parameters #### Request Body - **fields** (dict) - Required - A dictionary containing fields for the new account. Example fields include `$name` and `$industry`. ### Request Example ```python import asyncio from lightfield import AsyncLightfield client = AsyncLightfield(api_key="My API Key") async def main() -> None: account_create_response = await client.account.create( fields={ "$name": "Acme Corp", "$industry": ["opt_01j0x6q3m9v2p4t7k8n5r1s2u"], }, ) print(account_create_response.id) asyncio.run(main()) ``` ### Response #### Success Response - **id** (string) - The unique identifier of the created account. ``` -------------------------------- ### Create Contact with Python SDK Source: https://docs.lightfield.app/api/python/resources/contact/methods/create Use this snippet to create a new contact record. Ensure you have the Lightfield SDK installed and your API key configured. This example demonstrates setting a basic field. ```python from lightfield import Lightfield client = Lightfield( api_key="My API Key", ) contact_create_response = client.contact.create( fields={ "foo": "string" }, ) print(contact_create_response.id) ``` -------------------------------- ### List Files in Go Source: https://docs.lightfield.app/api/go/resources/file/methods/list Demonstrates how to list files in a workspace using the Lightfld Go SDK. Ensure you have the SDK installed and your API key is configured. ```go package main import ( "context" "fmt" "github.com/Lightfld/lightfield-go" "github.com/Lightfld/lightfield-go/option" ) func main() { client := githubcomlightfldlightfieldgo.NewClient( option.WithAPIKey("My API Key"), ) fileListResponse, err := client.File.List(context.TODO(), githubcomlightfldlightfieldgo.FileListParams{ }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", fileListResponse.Data) } ``` -------------------------------- ### List Notes API Request Source: https://docs.lightfield.app/api/resources/note/methods/list Example of how to make a GET request to the List Notes API endpoint using curl. Ensure you replace $API_KEY with your actual API key and set the correct Lightfield-Version. ```bash curl https://api.lightfield.app/v1/notes \ -H 'Lightfield-Version: 2026-03-01' \ -H "Authorization: Bearer $API_KEY" ``` -------------------------------- ### Complete File Upload in Go Source: https://docs.lightfield.app/api/go/resources/file/methods/complete Finalizes a file upload by calling the `Complete` method on the `File` service. This example demonstrates basic usage with context and a file ID. Ensure you have the Lightfld Go SDK installed and configured with your API key. ```go package main import ( "context" "fmt" "github.com/Lightfld/lightfield-go" "github.com/Lightfld/lightfield-go/option" ) func main() { client := githubcomlightfldlightfieldgo.NewClient( option.WithAPIKey("My API Key"), ) fileCompleteResponse, err := client.File.Complete( context.TODO(), "id", githubcomlightfldlightfieldgo.FileCompleteParams{ }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", fileCompleteResponse.ID) } ``` -------------------------------- ### List Notes in Go Source: https://docs.lightfield.app/api/go/resources/note/methods/list Demonstrates how to initialize the Lightfld client and call the Note.List method to retrieve a list of notes. Ensure you have your API key configured. ```Go package main import ( "context" "fmt" "github.com/Lightfld/lightfield-go" "github.com/Lightfld/lightfield-go/option" ) func main() { client := githubcomlightfldlightfieldgo.NewClient( option.WithAPIKey("My API Key"), ) noteListResponse, err := client.Note.List(context.TODO(), githubcomlightfldlightfieldgo.NoteListParams{ }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", noteListResponse.Data) } ``` -------------------------------- ### Create a Note Source: https://docs.lightfield.app/api/go/resources/note/methods/create Demonstrates how to initialize the Lightfld client and create a new note with a title. Ensure you have your API key configured. ```go package main import ( "context" "fmt" "github.com/Lightfld/lightfield-go" "github.com/Lightfld/lightfield-go/option" ) func main() { client := githubcomlightfldlightfieldgo.NewClient( option.WithAPIKey("My API Key"), ) noteCreateResponse, err := client.Note.New(context.TODO(), githubcomlightfldlightfieldgo.NoteNewParams{ Fields: githubcomlightfldlightfieldgo.NoteNewParamsFields{ Title: "$title", }, }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", noteCreateResponse.ID) } ``` -------------------------------- ### Create a Task Source: https://docs.lightfield.app/api/go/resources/task/methods/create Demonstrates how to instantiate the Lightfld client and create a new task with specified fields and relationships. Ensure you have your API key configured. ```go package main import ( "context" "fmt" "github.com/Lightfld/lightfield-go" "github.com/Lightfld/lightfield-go/option" ) func main() { client := githubcomlightfldlightfieldgo.NewClient( option.WithAPIKey("My API Key"), ) taskCreateResponse, err := client.Task.New(context.TODO(), githubcomlightfldlightfieldgo.TaskNewParams{ Fields: githubcomlightfldlightfieldgo.TaskNewParamsFields{ Status: "$status", Title: "$title", }, Relationships: map[string]githubcomlightfldlightfieldgo.TaskNewParamsRelationshipUnion{ "foo": githubcomlightfldlightfieldgo.TaskNewParamsRelationshipUnion{ OfString: githubcomlightfldlightfieldgo.String("string"), }, }, }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", taskCreateResponse.ID) } ``` -------------------------------- ### Create Account with Go SDK Source: https://docs.lightfield.app/api/go/resources/account/methods/create Demonstrates how to create a new account using the Lightfield Go SDK. Requires API key authentication and specifies account fields. ```go package main import ( "context" "fmt" "github.com/Lightfld/lightfield-go" "github.com/Lightfld/lightfield-go/option" ) func main() { client := githubcomlightfldlightfieldgo.NewClient( option.WithAPIKey("My API Key"), ) accountCreateResponse, err := client.Account.New(context.TODO(), githubcomlightfldlightfieldgo.AccountNewParams{ Fields: map[string]githubcomlightfldlightfieldgo.AccountNewParamsFieldUnion{ "foo": githubcomlightfldlightfieldgo.AccountNewParamsFieldUnion{ OfString: githubcomlightfldlightfieldgo.String("string"), }, }, }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", accountCreateResponse.ID) } ``` -------------------------------- ### List Emails CLI Response Example Source: https://docs.lightfield.app/api/cli/resources/email/methods/list This is an example of a successful response when listing emails. It includes email details, relationships, and metadata. ```json { "data": [ { "id": "eml_cm0abc456def789", "accessLevel": "FULL", "createdAt": "2026-05-01T09:00:00.000Z", "fields": { "$subject": { "value": "Following up on our chat", "valueType": "TEXT" }, "$sentAt": { "value": "2026-05-01T08:30:00.000Z", "valueType": "DATETIME" }, "$from": { "value": [ "sales@acme.com" ], "valueType": "EMAIL" }, "$to": { "value": [ "lead@example.com" ], "valueType": "EMAIL" }, "$cc": { "value": [ "string" ], "valueType": "EMAIL" }, "$bcc": { "value": [ "string" ], "valueType": "EMAIL" }, "$privacySetting": { "value": "string", "valueType": "TEXT" } }, "httpLink": null, "objectType": "email", "relationships": { "$account": { "cardinality": "has_many", "objectType": "account", "values": [ "acc_cm4stu901uvw234" ] }, "$contact": { "cardinality": "has_many", "objectType": "contact", "values": [ "con_cm2ghi789jkl012" ] } }, "updatedAt": "2026-05-01T10:00:00.000Z", "externalId": "externalId" }, { "id": "eml_cm1xyz123uvw456", "accessLevel": "METADATA", "createdAt": "2026-04-29T15:12:00.000Z", "fields": { "$subject": { "value": "string", "valueType": "TEXT" }, "$sentAt": { "value": "2026-04-29T15:11:30.000Z", "valueType": "DATETIME" }, "$from": { "value": [ "ceo@acme.com" ], "valueType": "EMAIL" }, "$to": { "value": [ "member@lightfield.com" ], "valueType": "EMAIL" }, "$cc": { "value": [ "string" ], "valueType": "EMAIL" }, "$bcc": { "value": [ "string" ], "valueType": "EMAIL" }, "$privacySetting": { "value": "string", "valueType": "TEXT" } }, "httpLink": null, "objectType": "email", "relationships": { "$account": { "cardinality": "has_many", "objectType": "account", "values": [ "acc_cm4stu901uvw234" ] } }, "updatedAt": "2026-04-29T15:12:00.000Z", "externalId": "externalId" } ], "object": "list", "totalCount": 2 } ``` -------------------------------- ### List Contacts Response Example Source: https://docs.lightfield.app/api/cli/resources/contact/methods/list A 200 OK response example for the list contacts endpoint, showing the structure of the returned data. ```json { "data": [ { "id": "id", "createdAt": "createdAt", "fields": { "foo": { "value": "string", "valueType": "ADDRESS" } }, "httpLink": "httpLink", "relationships": { "foo": { "cardinality": "cardinality", "objectType": "objectType", "values": [ "string" ] } }, "updatedAt": "updatedAt", "externalId": "externalId" } ], "object": "object", "totalCount": 0 } ``` -------------------------------- ### Install Lightfield TypeScript Library Source: https://docs.lightfield.app/api Install the Lightfield TypeScript library using npm. This is the first step to integrating Lightfield into your TypeScript projects. ```bash npm install lightfield ``` -------------------------------- ### Create Account with Optional Fields and Relationships Source: https://docs.lightfield.app/api/typescript/resources/account/methods/create This example demonstrates creating an account with additional fields like `$website` and setting up relationships, such as assigning an owner. The `$website` field triggers background enrichment. ```typescript import { AccountCreateParams, AccountCreateResponse, } from "@lightfield/sdk"; const accountCreateParams: AccountCreateParams = { fields: { $name: "Beta Industries", $website: "https://beta.industries.com", tier: "Gold", // Custom attribute }, relationships: { $owner: "user-123", // Assign a user as the owner $contact: ["contact-abc", "contact-xyz"], // Associate multiple contacts }, }; const response: AccountCreateResponse = await client.account.create( accountCreateParams ); console.log(response.id); console.log(response.createdAt); console.log(response.fields); console.log(response.relationships); console.log(response.updatedAt); console.log(response.externalId); ``` -------------------------------- ### List Files API Response Example Source: https://docs.lightfield.app/api/cli/resources/file/methods/list This is an example of a successful (200) response when listing files. It includes file metadata and pagination information. ```json { "data": [ { "id": "id", "completedAt": "completedAt", "createdAt": "createdAt", "expiresAt": "expiresAt", "filename": "filename", "mimeType": "mimeType", "sizeBytes": -9007199254740991, "status": "PENDING" } ], "object": "object", "totalCount": 0 } ``` -------------------------------- ### List Meetings in Go Source: https://docs.lightfield.app/api/go/resources/meeting/methods/list Demonstrates how to initialize the Lightfld client and call the List method to retrieve a list of meetings. Ensure you have your API key configured. ```Go package main import ( "context" "fmt" "github.com/Lightfld/lightfield-go" "github.com/Lightfld/lightfield-go/option" ) func main() { client := githubcomlightfldlightfieldgo.NewClient( option.WithAPIKey("My API Key"), ) meetingListResponse, err := client.Meeting.List(context.TODO(), githubcomlightfldlightfieldgo.MeetingListParams{ }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", meetingListResponse.Data) } ``` -------------------------------- ### Workflow Run Status Response Example Source: https://docs.lightfield.app/api/cli/resources/workflowRun/methods/status Example of a successful response when querying the status of a workflow run. The response contains the current status of the run. ```json { "status": "status" } ``` -------------------------------- ### List Opportunities via CLI Source: https://docs.lightfield.app/api/cli/resources/opportunity/methods/list Use this CLI command to list opportunities. Ensure you provide your API key. ```bash lightfield opportunity list \ --api-key 'My API Key' ``` -------------------------------- ### Create and Use Lightfield Client Source: https://docs.lightfield.app/api/go Instantiate the Lightfield client with an API key and make a request to create an account. Handles errors by panicking. ```go package main import ( "context" "fmt" "github.com/Lightfld/lightfield-go" "github.com/Lightfld/lightfield-go/option" ) func main() { client := githubcomlightfldlightfieldgo.NewClient( option.WithAPIKey("My API Key"), ) accountCreateResponse, err := client.Account.New(context.TODO(), githubcomlightfldlightfieldgo.AccountNewParams{ Fields: map[string]githubcomlightfldlightfieldgo.AccountNewParamsFieldUnion{ "$name": { OfString: githubcomlightfldlightfieldgo.String("Acme Corp"), }, "$industry": { OfStringArray: []string{"opt_01j0x6q3m9v2p4t7k8n5r1s2u"}, }, }, }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", accountCreateResponse.ID) } ``` -------------------------------- ### Example response for cancelling a file upload Source: https://docs.lightfield.app/api/cli/resources/file/methods/cancel This is an example of the JSON response received after successfully cancelling a file upload. It includes file details and its status. ```json { "id": "id", "completedAt": "completedAt", "createdAt": "createdAt", "expiresAt": "expiresAt", "filename": "filename", "mimeType": "mimeType", "sizeBytes": -9007199254740991, "status": "PENDING" } ``` -------------------------------- ### Send Email API Response Example Source: https://docs.lightfield.app/api/cli/resources/email/methods/send This is an example of a successful response when sending an email via the API. It includes the timestamp when the send operation was completed. ```json { "sentAt": "sentAt" } ``` -------------------------------- ### Account Creation Source: https://docs.lightfield.app/api/python Example of creating a new account using the synchronous client. It demonstrates how to pass fields for the new account and retrieve the account ID from the response. ```APIDOC ## Account Creation (Synchronous) ### Description Creates a new account with specified fields. ### Method `client.account.create()` ### Parameters #### Request Body - **fields** (dict) - Required - A dictionary containing fields for the new account. Example fields include `$name` and `$industry`. ### Request Example ```python from lightfield import Lightfield client = Lightfield(api_key="My API Key") account_create_response = client.account.create( fields={ "$name": "Acme Corp", "$industry": ["opt_01j0x6q3m9v2p4t7k8n5r1s2u"], }, ) print(account_create_response.id) ``` ### Response #### Success Response - **id** (string) - The unique identifier of the created account. ``` -------------------------------- ### Install Lightfield Python Library Source: https://docs.lightfield.app/api Install the Lightfield Python library using pip. This command is used to add Lightfield's Python package to your project. ```bash pip install lightfield ``` -------------------------------- ### List Files Request Source: https://docs.lightfield.app/api/resources/file/methods/list Demonstrates how to make a GET request to list files in your workspace. Ensure you include the necessary authorization headers. ```bash curl https://api.lightfield.app/v1/files \ -H 'Lightfield-Version: 2026-03-01' \ -H "Authorization: Bearer $API_KEY" ``` -------------------------------- ### List Members API Response Example Source: https://docs.lightfield.app/api/cli/resources/member/methods/list This is a successful (200) response example for the list members API call, showing the structure of paginated member data. ```json { "data": [ { "id": "id", "createdAt": "createdAt", "fields": { "$email": { "value": "value", "valueType": "EMAIL" }, "$name": { "value": { "firstName": "firstName", "lastName": "lastName" }, "valueType": "FULL_NAME" }, "$profileImage": { "value": "value", "valueType": "URL" }, "$role": { "value": "value", "valueType": "TEXT" } }, "httpLink": "httpLink", "relationships": {}, "updatedAt": "updatedAt" } ], "object": "object", "totalCount": 0 } ``` -------------------------------- ### File Download URL Response Example Source: https://docs.lightfield.app/api/cli/resources/file/methods/url This is an example of the JSON response when successfully retrieving a file download URL. The response includes the expiration time and the URL itself. ```json { "expiresAt": "expiresAt", "url": "url" } ``` -------------------------------- ### List Members in Go Source: https://docs.lightfield.app/api/go/resources/member/methods/list Demonstrates how to initialize the Lightfield client and call the Member.List method to retrieve a paginated list of members. Ensure you have the correct API key and necessary imports. ```go package main import ( "context" "fmt" "github.com/Lightfld/lightfield-go" "github.com/Lightfld/lightfield-go/option" ) func main() { client := githubcomlightfldlightfieldgo.NewClient( option.WithAPIKey("My API Key"), ) memberListResponse, err := client.Member.List(context.TODO(), githubcomlightfldlightfieldgo.MemberListParams{ }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", memberListResponse.Data) } ``` -------------------------------- ### List Lists using Go SDK Source: https://docs.lightfield.app/api/go/resources/list/methods/list Demonstrates how to fetch a paginated list of lists using the Lightfield Go SDK. Ensure you have initialized the client with your API key. ```go package main import ( "context" "fmt" "github.com/Lightfld/lightfield-go" "github.com/Lightfld/lightfield-go/option" ) func main() { client := githubcomlightfldlightfieldgo.NewClient( option.WithAPIKey("My API Key"), ) listListResponse, err := client.List.List(context.TODO(), githubcomlightfldlightfieldgo.ListListParams{ }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", listListResponse.Data) } ``` -------------------------------- ### Contact Retrieve Response Example Source: https://docs.lightfield.app/api/cli/resources/contact/methods/retrieve This is an example of a successful (200) response when retrieving a contact. It includes details like ID, creation timestamp, fields, and relationships. ```json { "id": "id", "createdAt": "createdAt", "fields": { "foo": { "value": "string", "valueType": "ADDRESS" } }, "httpLink": "httpLink", "relationships": { "foo": { "cardinality": "cardinality", "objectType": "objectType", "values": [ "string" ] } }, "updatedAt": "updatedAt", "externalId": "externalId" } ``` -------------------------------- ### Delete a Note - HTTP Request Example Source: https://docs.lightfield.app/api/cli/resources/note/methods/delete This example demonstrates the structure of a successful HTTP DELETE request to remove a note. The response includes details of the deleted note. ```http DELETE /v1/notes/{id} HTTP/1.1 Host: api.lightfield.com Content-Type: application/json ``` -------------------------------- ### List Opportunities Source: https://docs.lightfield.app/api/python/resources/opportunity/methods/list Demonstrates how to initialize the Lightfield client and call the opportunity list method to retrieve a paginated list of opportunities. The response data is then printed. ```Python from lightfield import Lightfield client = Lightfield( api_key="My API Key", ) opportunity_list_response = client.opportunity.list() print(opportunity_list_response.data) ``` -------------------------------- ### Contact Field Definitions Response Example Source: https://docs.lightfield.app/api/cli/resources/contact/methods/definitions This is an example of a successful response when retrieving contact field definitions. It includes detailed information about field types, configurations, and relationships. ```json { "fieldDefinitions": { "foo": { "description": "description", "label": "label", "typeConfiguration": { "currency": "currency", "handleService": "TWITTER", "multipleValues": true, "options": [ { "id": "id", "label": "label", "description": "description" } ], "unique": true }, "valueType": "ADDRESS", "id": "id", "readOnly": true } }, "objectType": "objectType", "relationshipDefinitions": { "foo": { "cardinality": "HAS_ONE", "description": "description", "label": "label", "objectType": "objectType", "id": "id" } } } ``` -------------------------------- ### Create Contact in Go Source: https://docs.lightfield.app/api/go/resources/contact/methods/create Demonstrates how to create a new contact using the Lightfld Go SDK. Ensure you have initialized the client with your API key. ```Go package main import ( "context" "fmt" "github.com/Lightfld/lightfield-go" "github.com/Lightfld/lightfield-go/option" ) func main() { client := githubcomlightfldlightfieldgo.NewClient( option.WithAPIKey("My API Key"), ) contactCreateResponse, err := client.Contact.New(context.TODO(), githubcomlightfldlightfieldgo.ContactNewParams{ Fields: map[string]githubcomlightfldlightfieldgo.ContactNewParamsFieldUnion{ "foo": githubcomlightfldlightfieldgo.ContactNewParamsFieldUnion{ OfString: githubcomlightfldlightfieldgo.String("string"), }, }, }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", contactCreateResponse.ID) } ``` -------------------------------- ### Get File Download URL via CLI Source: https://docs.lightfield.app/api/cli/resources/file/methods/url Use the Lightfield CLI to get a temporary download URL for a file. Ensure you have the file ID and your API key. ```bash lightfield file url \ --api-key 'My API Key' \ --id id ``` -------------------------------- ### Create Account via CLI Source: https://docs.lightfield.app/api/cli/resources/account/methods/create Use the Lightfield CLI to create a new account. Ensure you provide the required --api-key and --fields parameters, including the mandatory $name. ```bash lightfield account create \ --api-key 'My API Key' \ --fields '{$name: $name}' ``` -------------------------------- ### Send Email with Lightfld Go Client Source: https://docs.lightfield.app/api/go/resources/email/methods/send Demonstrates how to send a basic email using the Lightfld Go client. Ensure you have the correct API key and necessary imports. This example sends an email with HTML content. ```Go package main import ( "context" "fmt" "github.com/Lightfld/lightfield-go" "github.com/Lightfld/lightfield-go/option" ) func main() { client := githubcomlightfldlightfieldgo.NewClient( option.WithAPIKey("My API Key"), ) emailSendResponse, err := client.Email.Send(context.TODO(), githubcomlightfldlightfieldgo.EmailSendParams{ From: "sales@acme.com", MessageBody: githubcomlightfldlightfieldgo.EmailSendParamsMessageBody{ Content: "<p>Hi there,</p><p>Following up on our chat earlier this week.</p>", }, Subject: "Following up on our chat", To: []string{"lead@example.com"}, }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", emailSendResponse.SentAt) } ``` -------------------------------- ### List Custom Object Types Response Example Source: https://docs.lightfield.app/api/cli/resources/object/methods/listDefinitions Example of a successful response when listing custom object types. The response contains an array of object definitions, each with a label and objectType. ```json { "data": [ { "label": "label", "objectType": "objectType" } ] } ``` -------------------------------- ### Retrieve Email Example Source: https://docs.lightfield.app/api/cli/resources/email/methods/retrieve This example shows the structure of a successful response when retrieving email details. It includes fields like subject, sender, recipients, body, and associated relationships. ```APIDOC ## GET /emails/{id} ### Description Retrieves the details of a specific email by its unique identifier. ### Method GET ### Endpoint /emails/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the email to retrieve. ### Response #### Success Response (200) - **id** (string) - The unique identifier of the email. - **accessLevel** (string) - The access level granted for the email. - **createdAt** (string) - The timestamp when the email was created. - **fields** (object) - Contains the email's content and metadata. - **$subject** (object) - The subject of the email. - **value** (string) - The subject line. - **valueType** (string) - The type of the value, e.g., "TEXT". - **$sentAt** (object) - The timestamp when the email was sent. - **value** (string) - The sent timestamp. - **valueType** (string) - The type of the value, e.g., "DATETIME". - **$from** (object) - The sender's email address. - **value** (array) - An array of sender email addresses. - **valueType** (string) - The type of the value, e.g., "EMAIL". - **$to** (object) - The primary recipients' email addresses. - **value** (array) - An array of recipient email addresses. - **valueType** (string) - The type of the value, e.g., "EMAIL". - **$cc** (object) - The CC recipients' email addresses. - **value** (array) - An array of CC email addresses. - **valueType** (string) - The type of the value, e.g., "EMAIL". - **$bcc** (object) - The BCC recipients' email addresses. - **value** (array) - An array of BCC email addresses. - **valueType** (string) - The type of the value, e.g., "EMAIL". - **$privacySetting** (object) - The privacy setting for the email. - **value** (string) - The privacy setting value. - **valueType** (string) - The type of the value, e.g., "TEXT". - **$body** (object) - The main content of the email. - **value** (string) - The email body content. - **valueType** (string) - The type of the value, e.g., "HTML". - **httpLink** (null) - Placeholder for HTTP link, currently null. - **objectType** (string) - The type of the object, "email". - **relationships** (object) - Contains relationships to other objects. - **$account** (object) - Relationship to the account. - **cardinality** (string) - The cardinality of the relationship. - **objectType** (string) - The type of the related object. - **values** (array) - An array of associated account IDs. - **$contact** (object) - Relationship to the contact. - **cardinality** (string) - The cardinality of the relationship. - **objectType** (string) - The type of the related object. - **values** (array) - An array of associated contact IDs. - **updatedAt** (string) - The timestamp when the email was last updated. - **externalId** (string) - An external identifier for the email. #### Response Example ```json { "id": "eml_cm0abc456def789", "accessLevel": "FULL", "createdAt": "2026-05-01T09:00:00.000Z", "fields": { "$subject": { "value": "Following up on our chat", "valueType": "TEXT" }, "$sentAt": { "value": "2026-05-01T08:30:00.000Z", "valueType": "DATETIME" }, "$from": { "value": [ "sales@acme.com" ], "valueType": "EMAIL" }, "$to": { "value": [ "lead@example.com" ], "valueType": "EMAIL" }, "$cc": { "value": [ "string" ], "valueType": "EMAIL" }, "$bcc": { "value": [ "string" ], "valueType": "EMAIL" }, "$privacySetting": { "value": "string", "valueType": "TEXT" }, "$body": { "value": "<p>Hi there,</p><p>Following up on our chat earlier this week.</p>", "valueType": "HTML" } }, "httpLink": null, "objectType": "email", "relationships": { "$account": { "cardinality": "has_many", "objectType": "account", "values": [ "acc_cm4stu901uvw234" ] }, "$contact": { "cardinality": "has_many", "objectType": "contact", "values": [ "con_cm2ghi789jkl012" ] } }, "updatedAt": "2026-05-01T10:00:00.000Z", "externalId": "externalId" } ``` ``` -------------------------------- ### Retrieve Member Response Example Source: https://docs.lightfield.app/api/cli/resources/member/methods/retrieve Example of a successful (200) response when retrieving a member. This JSON structure details the member's ID, creation timestamp, fields, and other relevant information. ```json { "id": "id", "createdAt": "createdAt", "fields": { "$email": { "value": "value", "valueType": "EMAIL" }, "$name": { "value": { "firstName": "firstName", "lastName": "lastName" }, "valueType": "FULL_NAME" }, "$profileImage": { "value": "value", "valueType": "URL" }, "$role": { "value": "value", "valueType": "TEXT" } }, "httpLink": "httpLink", "relationships": {}, "updatedAt": "updatedAt" } ``` -------------------------------- ### List Accounts via CLI Source: https://docs.lightfield.app/api/cli/resources/account/methods/list Use the Lightfield CLI to list accounts. Ensure you provide your API key. ```bash lightfield account list \ --api-key 'My API Key' ``` -------------------------------- ### Get a custom object record Source: https://docs.lightfield.app/api/cli/resources/object/methods/retrieve Retrieves a single record by ID for the specified custom object type. This operation uses a GET request to the /v1/objects/{entitySlug}/values/{id} endpoint. ```APIDOC ## GET /v1/objects/{entitySlug}/values/{id} ### Description Retrieves a single record by ID for the specified custom object type. ### Method GET ### Endpoint /v1/objects/{entitySlug}/values/{id} ### Parameters #### Path Parameters - **entitySlug** (string) - Required - The slug of the custom object type. - **id** (string) - Required - The ID of the record to retrieve. #### Query Parameters None #### Request Body None ### Response #### Success Response (200) - **id** (string) - Unique identifier for the entity. - **createdAt** (string) - ISO 8601 timestamp of when the entity was created. - **fields** (map[object { value, valueType } ]) - Map of field names to their typed values. System fields are prefixed with `$` (e.g. `$name`, `$email`); custom attributes use their bare slug. - **value** (string or number or boolean or array of string) - The field value, or null if unset. - **valueType** (string) - The data type of the field. Possible values include: "ADDRESS", "CHECKBOX", "CURRENCY", "DATETIME", "EMAIL", "FULL_NAME", "MARKDOWN", "MULTI_SELECT", "NUMBER", "SINGLE_SELECT", "SOCIAL_HANDLE", "TELEPHONE", "TEXT", "URL", "HTML". - **httpLink** (string) - URL to view the entity in the Lightfield web app, or null. - **relationships** (map[object { cardinality, objectType, values } ]) - Map of relationship names to their associated entities. System relationships are prefixed with `$` (e.g. `$owner`, `$contact`). - **cardinality** (string) - Whether the relationship is `has_one` or `has_many`. - **objectType** (string) - The type of the related object (e.g. `account`, `contact`). - **values** (array of string) - IDs of the related entities. - **updatedAt** (string) - ISO 8601 timestamp of when the entity was last updated, or null. - **externalId** (string) - Optional - External identifier for the entity, or null if unset. ### Response Example ```json { "id": "id", "createdAt": "createdAt", "fields": { "foo": { "value": "string", "valueType": "ADDRESS" } }, "httpLink": "httpLink", "relationships": { "foo": { "cardinality": "cardinality", "objectType": "objectType", "values": [ "string" ] } }, "updatedAt": "updatedAt", "externalId": "externalId" } ``` ``` -------------------------------- ### List Notes via CLI Source: https://docs.lightfield.app/api/cli/resources/note/methods/list Use the Lightfield CLI to list notes. Ensure you provide your API key. ```bash lightfield note list \ --api-key 'My API Key' ``` -------------------------------- ### Account Delete Response Example Source: https://docs.lightfield.app/api/go/resources/account/methods/delete Example JSON response for a successful account deletion. It includes the account ID, creation timestamp, fields, HTTP link, relationships, update timestamp, and external ID. ```json { "id": "id", "createdAt": "createdAt", "fields": { "foo": { "value": "string", "valueType": "ADDRESS" } }, "httpLink": "httpLink", "relationships": { "foo": { "cardinality": "cardinality", "objectType": "objectType", "values": [ "string" ] } }, "updatedAt": "updatedAt", "externalId": "externalId" } ``` -------------------------------- ### Initialize Lightfield Client and Create Account Source: https://docs.lightfield.app/api/typescript Initialize the Lightfield client with an API key and create a new account. ```typescript import Lightfield from 'lightfield'; const client = new Lightfield({ apiKey: 'My API Key', }); const accountCreateResponse = await client.account.create({ fields: { $name: 'Acme Corp', $industry: ['opt_01j0x6q3m9v2p4t7k8n5r1s2u'] }, }); console.log(accountCreateResponse.id); ```