Create default association
Code Mode: praxis.crm.associations.createDefault
HTTP: PUT /crm/v1/objects/{objectType}/{objectId}/associations/default/{toObjectType}/{toObjectId}
Link two existing records with the default unlabelled association. Obtain each record id from objects.list or objects.search for its type. No request body is required; use associations.create to choose explicit association labels. Writes return refs (ResourceRef[]) for entity cards and optional property changes in conversations.
签名
praxis.crm.associations.createDefault(args:{path:{objectId:string;objectType:string;toObjectId:string;toObjectType:string}}):Promise<({/** The timestamp when the batch process was completed, in ISO 8601 format. e.g. "2026-10-29T12:00:00Z" */ completedAt:string;/** An array of errors that occurred during the batch operation, if any. */ 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;/** Context about the error condition 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 number of errors encountered during the batch processing. e.g. 0 */ numErrors?:number;/** The timestamp when the batch process was initiated, in ISO 8601 format. e.g. "2026-10-29T12:00:00Z" */ requestedAt?:string;/** An array of results from the batch operation, each representing a default association created between objects. */ results:Array<{/** Category and numeric type identifier describing the default relationship between these records. */ associationSpec:{/** 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};/** Source record identifier for this relationship, using an id from objects.list or objects.search. */ from:{/** ID of the object */ id:string};/** Destination record identifier for this relationship, using an id from objects.list or objects.search. */ to:{/** ID of the object */ id:string}}>;/** The timestamp when the batch process began execution, in ISO 8601 format. e.g. "2026-10-29T12:00:00Z" */ startedAt:string;/** The status of the batch processing request: "PENDING", "PROCESSING", "CANCELLED", or "COMPLETE". 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}>}>})>;参数
| 名称 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
| objectId | path | string | 是 | Record id from objects.list, objects.search or objects.create for this objectType. |
| objectType | path | string | 是 | Object type name from schemas.list, such as contacts, companies, deals or a custom p_<name>. |
| toObjectId | path | string | 是 | Destination record identifier from objects.list or objects.search for toObjectType. |
| toObjectType | path | string | 是 | Destination object type from schemas.list; use the type of the record being linked. |
响应
| 状态码 | 内容类型 | 说明 |
|---|---|---|
| 200 | application/json | Create default association 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. |