@lap v0.3
# Machine-readable API spec. Each @endpoint block is one API call.
@api Associations
@base https://api.hubapi.com
@version v4
@auth OAuth2 | OAuth2 | ApiKey private-app-legacy in header | ApiKey private-app in header
@endpoints 10
@toc crm(10)

@endpoint POST /crm/v4/associations/usage/high-usage-report/{userId}
@required {userId: int(int32)}
@returns(200) {enqueueTime: map{dateOnly: bool, timeZoneShift: int(int32), value: int(int32)}, userEmail: str, userId: int(int32)}

@endpoint POST /crm/v4/associations/{fromObjectType}/{toObjectType}/batch/archive
@required {fromObjectType: str, toObjectType: str, inputs: [map{from!: map, to!: [map]}]}
@returns(204)

@endpoint POST /crm/v4/associations/{fromObjectType}/{toObjectType}/batch/associate/default
@required {fromObjectType: str, toObjectType: str, inputs: [map{from!: map, to!: map}]}
@returns(200) {completedAt: str(date-time), errors: [map], links: map, numErrors: int(int32), requestedAt: str(date-time), results: [map], startedAt: str(date-time), status: str}

@endpoint POST /crm/v4/associations/{fromObjectType}/{toObjectType}/batch/create
@required {fromObjectType: str, toObjectType: str, inputs: [map{from!: map, to!: map, types!: [map]}]}
@returns(201) {completedAt: str(date-time), links: map, requestedAt: str(date-time), results: [map], startedAt: str(date-time), status: str}
@returns(207) {completedAt: str(date-time), errors: [map], links: map, numErrors: int(int32), requestedAt: str(date-time), results: [map], startedAt: str(date-time), status: str}

@endpoint POST /crm/v4/associations/{fromObjectType}/{toObjectType}/batch/labels/archive
@required {fromObjectType: str, toObjectType: str, inputs: [map{from!: map, to!: map, types!: [map]}]}
@returns(204)

@endpoint POST /crm/v4/associations/{fromObjectType}/{toObjectType}/batch/read
@required {fromObjectType: str, toObjectType: str, inputs: [map{after: str, id!: str}]}
@returns(200) {completedAt: str(date-time), links: map, requestedAt: str(date-time), results: [map], startedAt: str(date-time), status: str}
@returns(207) {completedAt: str(date-time), errors: [map], links: map, numErrors: int(int32), requestedAt: str(date-time), results: [map], startedAt: str(date-time), status: str}

@endpoint PUT /crm/v4/objects/{fromObjectType}/{fromObjectId}/associations/default/{toObjectType}/{toObjectId}
@required {fromObjectId: str, fromObjectType: str, toObjectId: str, toObjectType: str}
@returns(200) {completedAt: str(date-time), errors: [map], links: map, numErrors: int(int32), requestedAt: str(date-time), results: [map], startedAt: str(date-time), status: str}

@endpoint GET /crm/v4/objects/{objectType}/{objectId}/associations/{toObjectType}
@required {objectId: str, objectType: str, toObjectType: str}
@optional {after: str, limit: int(int32)=500}
@returns(200) {paging: map{next: map{after: str, link: str}}, results: [map]}

@endpoint PUT /crm/v4/objects/{objectType}/{objectId}/associations/{toObjectType}/{toObjectId}
@required {objectId: str, objectType: str, toObjectId: str, toObjectType: str}
@returns(201) {fromObjectId: str, fromObjectTypeId: str, labels: [str], toObjectId: str, toObjectTypeId: str}

@endpoint DELETE /crm/v4/objects/{objectType}/{objectId}/associations/{toObjectType}/{toObjectId}
@required {objectId: str, objectType: str, toObjectId: str, toObjectType: str}
@returns(204)

@end
