@lap v0.3
# Machine-readable API spec. Each @endpoint block is one API call.
@api Conversations Inbox & Messages
@base https://api.hubapi.com
@version v3
@auth OAuth2 | ApiKey private-app in header
@endpoints 18
@toc conversations(18)

@endpoint PUT /conversations/conversations/v3/threads/{threadId}/assignee
@required {threadId: int(int64), actorId: str}
@returns(200) {archived: bool, assignedTo: str, associatedContactId: str, closedAt: str(date-time), createdAt: str(date-time), id: str, inboxId: str, latestMessageReceivedTimestamp: str(date-time), latestMessageSentTimestamp: str(date-time), latestMessageTimestamp: str(date-time), originalChannelAccountId: str, originalChannelId: str, spam: bool, status: str, threadAssociations: map{associatedTicketId: str}}

@endpoint DELETE /conversations/conversations/v3/threads/{threadId}/assignee
@required {threadId: int(int64)}
@returns(204)

@endpoint POST /conversations/v3/conversations/actors/batch/read
@required {inputs: [str]}
@optional {property: str}
@returns(200) {completedAt: str(date-time), links: map, requestedAt: str(date-time), results: [any], startedAt: str(date-time), status: str}
@returns(207) {completedAt: str(date-time), errors: [map], links: map, numErrors: int(int32), requestedAt: str(date-time), results: [any], startedAt: str(date-time), status: str}

@endpoint GET /conversations/v3/conversations/actors/{actorId}
@required {actorId: str}
@optional {property: str}
@returns(200)

@endpoint GET /conversations/v3/conversations/channel-accounts
@optional {after: str, archived: bool, channelId: [int(int32)], defaultPageLength: int(int32), inboxId: [int(int32)], limit: int(int32), sort: [str]}
@returns(200) {paging: map{next: map{after: str, link: str}, prev: map{before: str, link: str}}, results: [map], total: int(int32)}

@endpoint GET /conversations/v3/conversations/channel-accounts/{channelAccountId}
@required {channelAccountId: int(int64)}
@optional {archived: bool=false}
@returns(200) {active: bool, archived: bool, archivedAt: str(date-time), authorized: bool, channelId: str, createdAt: str(date-time), deliveryIdentifier: map{type: str, value: str}, id: str, inboxId: str, name: str}

@endpoint GET /conversations/v3/conversations/channels
@optional {after: str, defaultPageLength: int(int32), limit: int(int32), sort: [str]}
@returns(200) {paging: map{next: map{after: str, link: str}, prev: map{before: str, link: str}}, results: [map], total: int(int32)}

@endpoint GET /conversations/v3/conversations/channels/{channelId}
@required {channelId: int(int32)}
@returns(200) {id: str, name: str}

@endpoint GET /conversations/v3/conversations/inboxes
@optional {after: str, archived: bool, defaultPageLength: int(int32), limit: int(int32), sort: [str]}
@returns(200) {paging: map{next: map{after: str, link: str}, prev: map{before: str, link: str}}, results: [map], total: int(int32)}

@endpoint GET /conversations/v3/conversations/inboxes/{inboxId}
@required {inboxId: int(int32)}
@optional {archived: bool=false}
@returns(200) {archived: bool, archivedAt: str(date-time), createdAt: str(date-time), id: str, name: str, type: str, updatedAt: str(date-time)}

@endpoint GET /conversations/v3/conversations/threads
@optional {after: str, archived: bool, associatedContactId: int(int64), associatedTicketId: int(int64), association: [str], inboxId: [int(int32)], latestMessageTimestampAfter: str(date-time), limit: int(int32), property: str, sort: [str], threadStatus: str(CLOSED/OPEN)}
@returns(200) {paging: map{next: map{after: str, link: str}}, results: [map]}

@endpoint GET /conversations/v3/conversations/threads/{threadId}
@required {threadId: int(int64)}
@optional {archived: bool, association: [str], property: str}
@returns(200) {archived: bool, assignedTo: str, associatedContactId: str, closedAt: str(date-time), createdAt: str(date-time), id: str, inboxId: str, latestMessageReceivedTimestamp: str(date-time), latestMessageSentTimestamp: str(date-time), latestMessageTimestamp: str(date-time), originalChannelAccountId: str, originalChannelId: str, spam: bool, status: str, threadAssociations: map{associatedTicketId: str}}

@endpoint DELETE /conversations/v3/conversations/threads/{threadId}
@required {threadId: int(int64)}
@returns(204)

@endpoint PATCH /conversations/v3/conversations/threads/{threadId}
@required {threadId: int(int64)}
@optional {archived: bool, archived: bool, status: str(CLOSED/OPEN)}
@returns(200) {archived: bool, assignedTo: str, associatedContactId: str, closedAt: str(date-time), createdAt: str(date-time), id: str, inboxId: str, latestMessageReceivedTimestamp: str(date-time), latestMessageSentTimestamp: str(date-time), latestMessageTimestamp: str(date-time), originalChannelAccountId: str, originalChannelId: str, spam: bool, status: str, threadAssociations: map{associatedTicketId: str}}

@endpoint GET /conversations/v3/conversations/threads/{threadId}/messages
@required {threadId: int(int64)}
@optional {after: str, archived: bool, limit: int(int32), property: str, sort: [str]}
@returns(200) {paging: map{next: map{after: str, link: str}}, results: [any]}

@endpoint POST /conversations/v3/conversations/threads/{threadId}/messages
@required {threadId: int(int64)}
@returns(201)

@endpoint GET /conversations/v3/conversations/threads/{threadId}/messages/{messageId}
@required {messageId: str, threadId: int(int64)}
@optional {property: str}
@returns(200)

@endpoint GET /conversations/v3/conversations/threads/{threadId}/messages/{messageId}/original-content
@required {messageId: str, threadId: int(int64)}
@optional {property: str}
@returns(200) {richText: str, text: str}

@end
