Skip to content

Contacts

GET /v1/accounts/{a}/avatars/{id}

Get the cached avatar picture of a contact or group. It does not download a new one.

Scope: media

ParameterInTypeDescription
a (required)pathstringAccount ID or alias.
id (required)pathstringContact ID.

POST /v1/accounts/{a}/avatars/{id}/refresh

Ask WeChat for the latest avatar of one contact, with optional group context for an OpenIM member. Poll the returned operation.

Scope: media, read

ParameterInTypeDescription
a (required)pathstringAccount ID or alias.
id (required)pathstringContact ID.

Request body: RefreshAvatarRequest

GET /v1/accounts/{a}/contact-mutations/by-idempotency-key

Inspect a contact operation using its original idempotency key.

Scope: admin

ParameterInTypeDescription
a (required)pathstringAccount ID or alias.
keyquerystringOriginal submitted idempotency key.

Response: NativeOperation

GET /v1/accounts/{a}/contact-requests

List saved incoming and outgoing request conversations.

Scope: read

ParameterInTypeDescription
a (required)pathstringAccount ID or alias.
actionablequeryboolean, nullableInclude only current acceptance candidates when true.
cursorquerystring, nullableExact continuation from the same query.
directionquerystring, nullableIncoming or outgoing direction.
limitqueryinteger, nullablePage size, from 1 to 200; default 50.
searchquerystring, nullableMatch saved labels, peer identities or verification text.

Response: NativeContactRequestPage

POST /v1/accounts/{a}/contact-requests

Send one friend request with an account-bound discovery reference.

Scope: admin

ParameterInTypeDescription
a (required)pathstringAccount ID or alias.
Idempotency-Key (required)headerstringRepeating a request with the same key returns the original result instead of repeating the work.

Request body: NativeContactRequestSend

Response: NativeOperation

DELETE /v1/accounts/{a}/contact-requests/{id}

Delete local request history; does not reject or cancel on the server.

Scope: admin

ParameterInTypeDescription
a (required)pathstringAccount ID or alias.
id (required)pathstringOpaque friend request conversation ID from list/get.
Idempotency-Key (required)headerstringRepeating a request with the same key returns the original result instead of repeating the work.

Request body: NativeContactRequestVersion

Response: NativeOperation

GET /v1/accounts/{a}/contact-requests/{id}

Read a request conversation and its current version.

Scope: read

ParameterInTypeDescription
a (required)pathstringAccount ID or alias.
id (required)pathstringOpaque friend request conversation ID from list/get.

Response: NativeContactRequest

POST /v1/accounts/{a}/contact-requests/{id}/accept

Accept the exact inspected incoming request.

Scope: admin

ParameterInTypeDescription
a (required)pathstringAccount ID or alias.
id (required)pathstringOpaque friend request conversation ID from list/get.
Idempotency-Key (required)headerstringRepeating a request with the same key returns the original result instead of repeating the work.

Request body: NativeContactRequestAccept

Response: NativeOperation

POST /v1/accounts/{a}/contact-sync

Start syncing the contact catalog from WeChat. Poll the returned operation.

Scope: read

ParameterInTypeDescription
a (required)pathstringAccount ID or alias.

GET /v1/accounts/{a}/contacts

List contacts and their relationship privacy when available.

Scope: read

ParameterInTypeDescription
a (required)pathstringAccount ID or alias.
cursorquerystring, nullableThe nextCursor of the previous page, up to 8192 characters. Send it with the same query.
kindquerystring, nullableOnly list chats of this kind: direct, group or system.
limitqueryinteger, nullableItems per page, from 1 to 200.
relationquerystring, nullableContact lists only: friend (default), non_contact, unknown, or all cached people.
searchquerystring, nullableText to search for, up to 256 characters. The name query is accepted too.

Response: NativeContactPage

POST /v1/accounts/{a}/contacts/lookup

Look up one or two contacts by ID live on WeChat, without saving the result.

Scope: read

ParameterInTypeDescription
a (required)pathstringAccount ID or alias.

Request body: ContactLookupRequest

DELETE /v1/accounts/{a}/contacts/{id}

Remove this account contact relationship, preserving chat history.

Scope: admin

ParameterInTypeDescription
a (required)pathstringAccount ID or alias.
id (required)pathstringContact ID.
Idempotency-Key (required)headerstringRepeating a request with the same key returns the original result instead of repeating the work.

Response: NativeOperation

GET /v1/accounts/{a}/contacts/{id}

Show one contact and its relationship privacy when available.

Scope: read

ParameterInTypeDescription
a (required)pathstringAccount ID or alias.
id (required)pathstringContact ID.

Response: NativeContact

PATCH /v1/accounts/{a}/contacts/{id}

Change relationship privacy or the remark against the inspected version.

Scope: admin

ParameterInTypeDescription
a (required)pathstringAccount ID or alias.
id (required)pathstringContact ID.
Idempotency-Key (required)headerstringRepeating a request with the same key returns the original result instead of repeating the work.

Request body: NativeContactUpdate

Response: NativeOperation

POST /v1/accounts/{a}/contacts/{id}/refresh

Ask WeChat for the latest contact details and privacy. Poll the returned operation.

Scope: read

ParameterInTypeDescription
a (required)pathstringAccount ID or alias.
id (required)pathstringContact ID.

POST /v1/accounts/{a}/search/contacts

Discover a person on WeChat and return an opaque send reference.

Scope: read

ParameterInTypeDescription
a (required)pathstringAccount ID or alias.

Request body: NativeContactSearchRequest

Response: NativeContactSearch

Types

ContactLookupRequest

Request to look up one or two contacts live on WeChat.

FieldTypeDescription
ids (required)array of stringOne or two distinct contact IDs to look up.

NativeContact

A contact saved in the account’s profile.

FieldTypeDescription
alias (required)string, nullableThe custom WeChat ID the contact chose, which they can change. Null when none is saved.
classificationPeerClassification or , nullable
displayName (required)string, nullableName to show: the remark if set, else the nickname, else the username.
id (required)stringContact ID. It is the same as username.
nickname (required)string, nullableThe name the contact chose for themselves. Null when none is saved.
privacyNativeContactPrivacySettings or , nullableCurrent relationship settings, when available for this friend.
privacyPendingboolean, nullableTrue while an accepted relationship edit is awaiting contact sync.
privacyUnavailablestring, nullableWhy a friend has no privacy or privacyVersion, so it can’t be edited yet: contact_privacy_unresolved (refresh the contact), ordinary_contact_required (not supported for this contact), profile_identity_unavailable or contact_flags_unresolved.
privacyVersionstring, nullableVersion to send as expectedVersion when changing this contact’s privacy or remark. It changes when the privacy or the relationship changes.
relation (required)stringRelationship evidence: friend when membership is established, non_contact when known flags do not establish membership, or unknown when flags are unavailable.
remark (required)string, nullableYour private name for the contact. Null when none is saved.
remarkPendingboolean, nullableTrue while the remark is being fetched from WeChat after it changed, from this account or another device. Edits are still accepted meanwhile.
username (required)stringThe contact’s WeChat username.

NativeContactPage

One page of a list. items holds the resources, nextCursor continues the list, and the other fields describe the saved data the list was read from.

FieldTypeDescription
asOfEventCursor (required)string, nullableEvent cursor that was current when the list was first read. Resume the event stream from it to catch changes made after the read.
coverage (required)anyWhich saved databases the read covered, as partial (true when some could not be read) and databases (each one with its state). It describes local data, not completeness on WeChat’s servers.
items (required)array of NativePageItemOfNativeContactThe entries on this page, in list order.
nextCursor (required)string, nullablePass it as cursor with the same query to get the next page. Null on the last page.
sourceGeneration (required)stringFingerprint of the saved profile data the page was read from. It changes when the profile files change.

NativeContactPrivacySettings

Relationship privacy selected by the account owner.

FieldTypeDescription
chatsOnly (required)booleanRestrict this relationship to chats.
hideMyPosts (required)booleanHide this account’s Moments posts from this person.
hideTheirPosts (required)booleanHide this person’s Moments posts from this account.

NativeContactRequest

One per-peer canonical request conversation with a current action/version.

FieldTypeDescription
actionable (required)booleanWhether the current incoming request can be accepted locally.
attention (required)booleanIncoming request needing attention in navigation badges.
direction (required)stringIncoming or outgoing current row direction.
displayName (required)stringSaved contact label or retained peer identity.
history (required)array of NativeContactRequestMessageRetained per-message verification history.
id (required)stringOpaque request identity.
isContact (required)booleanWhether current canonical membership establishes a contact.
message (required)stringCurrent verification text.
peerId (required)stringSaved peer identity; does not itself establish friendship.
state (required)stringcontact, request_received or request_sent; history is not server pending proof.
updatedAt (required)integerCurrent row time in Unix seconds.
version (required)stringExact version for accept/delete preconditions.

NativeContactRequestAccept

Accept the inspected request with optional initial relationship privacy.

FieldTypeDescription
expectedVersion (required)stringCurrent request version returned by get/list.
privacyNativeContactPrivacySettings or , nullableInitial relationship privacy; omission keeps the supported default.

NativeContactRequestMessage

One saved verification-history entry without protocol tickets or XML.

FieldTypeDescription
createdAt (required)integerOriginal event time in Unix seconds.
direction (required)stringIncoming or outgoing.
message (required)stringVerification text, treated as untrusted display data.
serverId (required)stringOriginal server ID as a decimal string; sent entries may use zero.

NativeContactRequestPage

One page of per-peer request conversations.

FieldTypeDescription
asOfEventCursor (required)stringEvent boundary of the retained list, for continuing the existing account event stream.
coverage (required)anyLocal profile coverage description.
items (required)array of NativePageItemOfNativeContactRequestCanonical request rows in update-time order.
nextCursor (required)string, nullableOpaque continuation, or null after the final page.
pendingIncomingCount (required)integerIncoming actionable rows needing attention across all filters.
sourceGeneration (required)stringVersion of this filtered result collection.

NativeContactRequestSend

Send one greeting to a resolved person.

FieldTypeDescription
message (required)stringGreeting supplied by the owner; no automatic default is inserted.
privacyNativeContactPrivacySettings or , nullableInitial relationship privacy; omission keeps the supported default.
recipientRef (required)stringExact reference returned by discovery on this account.

NativeContactRequestVersion

Precondition for accepting or locally deleting the inspected request.

FieldTypeDescription
expectedVersion (required)stringCurrent request version returned by get/list.

NativeContactSearch

Sanitized discovery preview with a short-lived account/session-bound send reference.

FieldTypeDescription
contactId (required)string, nullableCanonical saved contact ID when membership is established for this identity.
displayName (required)stringDisplay query for the discovered identity.
expiresAt (required)integerUnix seconds after which a new discovery is required.
recipientRef (required)string, nullableOpaque send reference when verification material is available; null for matches without it.
request (required)NativeContactRequest or , nullableExisting request conversation for the resolved identity, when retained locally.
source (required)stringAlways wechat for this endpoint.

NativeContactSearchRequest

Live WeChat contact discovery input. Email and broad nickname search are not supported.

FieldTypeDescription
query (required)stringExact WeChat ID query. Phone lookup has not been verified.

NativeContactUpdate

Update supported contact settings after inspecting their current version.

FieldTypeDescription
expectedVersion (required)stringVersion from the contact’s privacyVersion on this account.
privacyNativeContactPrivacySettings or , nullableDesired relationship settings; unrelated contact flags are preserved. Send either privacy or remark in one request.
remarkstring, nullableNew personal remark: a string sets it, null clears it, and omitting it keeps the current remark. Outer whitespace is removed.

NativeOperation

A background operation such as signing in or out, refreshing contacts or changing a group. Poll it by ID until it finishes.

FieldTypeDescription
accountId (required)stringID of the account the operation belongs to.
createdAt (required)stringWhen the operation was created, as an RFC 3339 time.
id (required)stringOperation ID.
kind (required)stringWhat the operation does, such as login, logout, sync, metadata, group_mutation, message_recall or media-writeback.
result (required)anyDetails of the outcome. Its fields depend on kind, and it is empty until the operation has something to report.
state (required)stringWhere the operation stands, such as queued, running, succeeded, failed or cancelled. Some kinds report more states, for example needs_review, or awaiting_scan and awaiting_approval during a login.
updatedAt (required)stringWhen the operation last changed, as an RFC 3339 time.

NativePageItemOfNativeContact

One entry on a page: the resource itself, or a tombstone when the resource has been removed since the list was first read.

ValueDescription
NativeContact
NativeTombstone

NativePageItemOfNativeContactRequest

One entry on a page: the resource itself, or a tombstone when the resource has been removed since the list was first read.

ValueDescription
NativeContactRequest
NativeTombstone

NativeTombstone

Stands in for a resource that was in the list when it was first read but is no longer in the saved profile. It keeps the resource’s place in the list.

FieldTypeDescription
deleted (required)booleanAlways true, marking the resource as removed.
id (required)stringID of the removed resource.
version (required)stringFingerprint of the saved profile data in which the resource is missing, the same value as sourceGeneration on the page.

PeerApplication

Reference to an account type for one language, from the saved WeCom application data. The label of the account type is not included.

FieldTypeDescription
accountTypeCached (required)booleanTrue when the profile also holds the label for this account type and language. The label itself is not returned.
accountTypeId (required)string, nullableID of the account type for this language. Null when none is saved.
languageId (required)integerThe language this entry applies to, as the number WeChat stores.

PeerBusinessKind

Kind of business account, worked out from the numeric businessType.

ValueDescription
”official_account”An official account (business type 0).
“service_account”A service account (business type 1).
“enterprise”An enterprise account (business type 2).
“enterprise_child”An enterprise child account (business type 3).
“photo_account”A photo account (business type 5).

PeerCategory

What kind of peer this is. It is separate from the chat type and from whether the peer is in your contacts.

ValueDescription
”unknown”No category is established. Do not assume a personal account or a friend.
”system”A built-in peer such as File Transfer.
”group”A group chat.
”business”An official or business account.
”openim”A WeCom contact.
”openim_customer_service”A WeCom customer-service identity.

PeerClassification

What kind of peer this is, worked out from the saved profile each time it is read. Missing details do not mean the peer is an ordinary person or that you are not subscribed to it.

FieldTypeDescription
businessKind (required)PeerBusinessKind or , nullable
businessType (required)integer, nullableNumeric service type saved for a business account: 0 official account, 1 service account, 2 enterprise, 3 enterprise child, 5 photo account. Null for other peers and when the saved values conflict.
category (required)PeerCategory
namespace (required)PeerNamespace
openIm (required)PeerOpenIm or , nullableSaved WeCom details, present for openim and openim_customer_service peers when the profile has them. Null otherwise.

PeerNamespace

The family of IDs a peer’s ID belongs to, worked out from the ID itself. It does not grant any extra actions.

ValueDescription
”wechat”An ordinary WeChat ID, including groups ending with @chatroom.
”openim”An ID containing @openim, a WeCom contact.
”openim_customer_service”An ID containing @kefu.openim, a WeCom customer-service identity.
”im_chatroom”A group ID containing @im.chatroom.
”qy”An ID ending with @qy_u (a person) or @qy_g (a group).
“weclaw”An ID containing @weclaw.
”other”Any other ID containing @ that matches no known family.

PeerOpenIm

Saved WeCom (OpenIM) details for a peer.

FieldTypeDescription
appId (required)string, nullableID of the WeCom application the peer belongs to. Null when none is saved.
applications (required)array of PeerApplicationAccount type references, one per language.
wordingId (required)string, nullableID of the set of labels in wordings. Null when none is saved.
wordings (required)array of PeerWordingLocalized labels for the peer, one per language.

PeerWording

A label in one language.

FieldTypeDescription
languageId (required)integerThe language of the text, as the number WeChat stores. Choose the language to show in your app.
text (required)stringThe label text.

RefreshAvatarRequest

Optional group context for an OpenIM member’s avatar lookup.

FieldTypeDescription
roomIdstring, nullableGroup containing this known member, when context is required by WeChat.