跳转到内容
EN

Batch update records

Code Mode: praxis.crm.objects.batch.update

HTTP: POST /crm/v1/objects/{objectType}/batch/update

Apply distinct property patches to existing records identified by inputs[].id. Obtain ids from objects.list or objects.search and property names from properties.list. Omitted properties retain their values; inspect results and errors for each input. Writes return refs (ResourceRef[]) for entity cards and optional property changes in conversations.

签名

praxis.crm.objects.batch.update(args:{path:{objectType:string};body:{/** Records to process in this batch, each using the identifiers and properties described by its item schema. */ inputs:Array<{/** The id to be updated. */ id:string;/** The name of a property whose values are unique for this object e.g. "my_unique_property_name" */ idProperty?:string;/** A unique identifier for tracing the request. */ 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}>}>})>;

参数

名称位置类型必填说明
objectTypepathstring是Object type name from schemas.list, such as contacts, companies, deals or a custom p_<name>.

请求体

必填内容类型说明
是application/jsonValues for batch update records; use internal property names and resource ids from the corresponding list operations.

响应

状态码内容类型说明
200application/jsonBatch update records succeeded; inspect the returned resource or result collection.
400application/jsonVALIDATION_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.
401application/jsonThe bearer credential is missing or invalid; provide a valid platform API key before retrying.
404application/jsonOBJECT_NOT_FOUND means an object type, record or definition is unavailable in your organization; select an accessible identifier from its list operation.
409application/jsonCONFLICT 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.