Create an account
client.account.create(AccountCreateParams { fields, relationships } body, RequestOptionsoptions?): AccountCreateResponse { id, createdAt, fields, 4 more }
POST/v1/accounts
Creates a new account record. The $name field is required.
If a $website is provided, Lightfield automatically enriches the account in the background. The $howTheyMakeMoney and $accountStatus fields are read-only and cannot be set via the API. The $opportunity, $task, and $note relationships are also read-only — manage them via the $account relationship on the opportunity or task, or the $account/$opportunity note relationships instead.
Supports idempotency via the Idempotency-Key header.
To avoid duplicates, we recommend a find-or-create pattern — use list filtering to check if a record exists before creating.
Required scope: accounts:create
Rate limit category: Write
Parameters
Returns
Create an account
import Lightfield from 'lightfield';
const client = new Lightfield({
apiKey: 'My API Key',
});
const accountCreateResponse = await client.account.create({ fields: { foo: 'string' } });
console.log(accountCreateResponse.id);{
"id": "id",
"createdAt": "createdAt",
"fields": {
"foo": {
"value": "string",
"valueType": "ADDRESS"
}
},
"httpLink": "httpLink",
"relationships": {
"foo": {
"cardinality": "cardinality",
"objectType": "objectType",
"values": [
"string"
]
}
},
"updatedAt": "updatedAt",
"externalId": "externalId"
}Returns Examples
{
"id": "id",
"createdAt": "createdAt",
"fields": {
"foo": {
"value": "string",
"valueType": "ADDRESS"
}
},
"httpLink": "httpLink",
"relationships": {
"foo": {
"cardinality": "cardinality",
"objectType": "objectType",
"values": [
"string"
]
}
},
"updatedAt": "updatedAt",
"externalId": "externalId"
}