Batch create records
Code Mode: praxis.crm.objects.batch.create
HTTP: POST /crm/v1/objects/{objectType}/batch/create
Create several records of one object type using inputs with properties and optional associations. Obtain property names from properties.list; each successful input creates a record, so inspect per-item errors before resubmitting failed inputs. Writes return refs (ResourceRef[]) for entity cards and optional property changes in conversations.
签名
praxis.crm.objects.batch.create(args:{path:{objectType:string};body:{/** Records to process in this batch, each using the identifiers and properties described by its item schema. */ inputs:Array<{/** Initial relationships to existing records; choose destination ids and association type ids before creating the record. */ associations:Array<{/** Destination record identifier for this relationship, using an id from objects.list or objects.search. */ to:{/** The unique ID of the object. */ id:string};/** Association specifications describing how the source record relates to the destination record. */ types:Array<{/** The category of the association, such as "HUBSPOT_DEFINED". e.g. "HUBSPOT_DEFINED" */ associationCategory:"HUBSPOT_DEFINED"|"INTEGRATOR_DEFINED"|"USER_DEFINED"|"WORK";/** The ID representing the specific type of association. e.g. 0 */ associationTypeId:number}>}>;/** An identifier used for tracing the creation or update request of the object. */ objectWriteTraceId?:string;/** Key value pairs representing the properties of the object. */ properties:{[key:string]:string}}>}}):Promise<({/** The timestamp when the batch processing was completed, in ISO 8601 format. e.g. "2026-10-29T12:00:00Z" */ completedAt:string;/** Per-input failures; correct the rejected inputs before submitting them again. */ errors?:Array<{/** The main category of the error. */ category:string;/** Additional context-specific information related to the error. */ context:{[key:string]:Array<string>};/** The detailed error objects. */ errors:Array<{/** The status code associated with the error detail */ code?:string;/** The context for the error. e.g. "{\"missingScopes\": [\"scope1\", \"scope2\"]}" */ context?:{[key:string]:Array<string>};/** The name of the field or parameter in which the error was found. */ in?:string;/** A human readable message describing the error along with remediation steps where appropriate */ message:string;/** A specific category that contains more specific detail about the error */ subCategory?:string}>;/** A unique ID for the error instance. */ id?:string;/** URLs linking to documentation or resources associated with the error. */ links:{[key:string]:string};/** A human-readable string describing the error and possible remediation steps. */ message:string;/** The HTTP status code associated with the error. */ status:string;/** A more specific error category within each main category. */ subCategory?:Record<string,unknown>}>;/** An object containing relevant links related to the batch request. */ links?:{[key:string]:string};/** The total number of errors that occurred during the batch operation. e.g. 0 */ numErrors?:number;/** The timestamp when the batch request was initially made, in ISO 8601 format. e.g. "2026-10-29T12:00:00Z" */ requestedAt?:string;/** Resources returned by this request; batch callers must also inspect per-input errors. */ results:Array<{/** Whether the object is archived. */ archived:boolean;/** The timestamp when the object was archived, in ISO 8601 format. e.g. "2026-10-29T12:00:00Z" */ archivedAt?:string;/** The timestamp when the object was created, in ISO 8601 format. e.g. "2026-10-29T12:00:00Z" */ createdAt:string;/** The unique ID of the object. */ id:string;/** An identifier used for tracing the write request for the object. */ objectWriteTraceId?:string;/** Key-value pairs representing the properties of the object. */ properties:{[key:string]:string|null};/** Key-value pairs representing the properties of the object along with their history. */ propertiesWithHistory?:{[key:string]:Array<{/** Identifier of the source that recorded this property value. */ sourceId?:string;/** A human-readable label. */ sourceLabel?:string;/** Source category that produced this historic property value. */ sourceType:string;/** The timestamp when the property was updated, in ISO 8601 format. e.g. "2026-10-29T12:00:00Z" */ timestamp:string;/** The ID of the user who last updated the property. e.g. 0 */ updatedByUserId?:number;/** Property value recorded at timestamp, represented as a string. */ value:string}>};/** The timestamp when the object was last updated, in ISO 8601 format. e.g. "2026-10-29T12:00:00Z" */ updatedAt:string;/** Direct URL for this object in the portal */ url?:string}>;/** The timestamp when the batch processing began, in ISO 8601 format. e.g. "2026-10-29T12:00:00Z" */ startedAt:string;/** The status of the batch processing request. e.g. "CANCELED" */ status:"CANCELED"|"COMPLETE"|"PENDING"|"PROCESSING"})&({/** Affected record references for rendering entity cards in conversations; may be empty for definition-only writes. */ refs:Array<{/** Object type containing the referenced record; use with objects.retrieve. e.g. "deals" */ object:string;/** Record identifier to retrieve with object; obtained from the write result. e.g. "rec_example" */ id:string;/** Console URL for opening the entity card in a conversation or viewing the record. e.g. "https://console.deepraxis.com/crm/deals/rec_example" */ viewer_url:string;/** Optional property changes to render alongside the entity card. */ changes?:Array<{/** Internal name of the property changed by this request. */ property:string;/** Value before the change; null means the property was empty. */ before:string|null;/** Value committed by the change; null means the property was cleared. */ after:string|null}>}>})>;参数
| 名称 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
| objectType | path | string | 是 | Object type name from schemas.list, such as contacts, companies, deals or a custom p_<name>. |
请求体
| 必填 | 内容类型 | 说明 |
|---|---|---|
| 是 | application/json | Values for batch create records; use internal property names and resource ids from the corresponding list operations. |
响应
| 状态码 | 内容类型 | 说明 |
|---|---|---|
| 201 | application/json | Batch create records succeeded; inspect the returned resource or result collection. |
| 400 | application/json | VALIDATION_ERROR rejects invalid properties or stage rules; supply errors[0].context.properties when requirements are missing, or choose an allowed stage. BAD_REQUEST rejects malformed input; correct the request before retrying. |
| 401 | application/json | The bearer credential is missing or invalid; provide a valid platform API key before retrying. |
| 404 | application/json | OBJECT_NOT_FOUND means an object type, record or definition is unavailable in your organization; select an accessible identifier from its list operation. |
| 409 | application/json | CONFLICT means a unique value is already used or a change-set reversal would overwrite a later value; read the current records and resolve the conflicting values before retrying. |