# Private Messages

## Get private messages token

> Generates a LiveKit token for accessing private messages.\
> This endpoint checks user privacy settings and generates appropriate credentials.\
> Requires Signed Fetch authentication from dcl:explorer.\
> Must include the complete identity header chain: x-identity-auth-chain-0, x-identity-auth-chain-1, x-identity-auth-chain-2, x-identity-timestamp, and x-identity-metadata.<br>

```json
{"openapi":"3.0.0","info":{"title":"Comms Gatekeeper API","version":"1.0.0"},"servers":[{"url":"https://comms-gatekeeper.decentraland.org","description":"Production server"},{"url":"https://comms-gatekeeper.decentraland.zone","description":"Development server"}],"security":[{"SignedFetchExplorer":[]}],"components":{"securitySchemes":{"SignedFetchExplorer":{"type":"apiKey","in":"header","name":"x-identity","description":"Signed Fetch authentication for Explorer-based requests.\nRequires a chain of identity headers:\n- x-identity-auth-chain-0: Signer information\n- x-identity-auth-chain-1: Ephemeral key information  \n- x-identity-auth-chain-2: Signed entity information\n- x-identity-timestamp: Request timestamp\n- x-identity-metadata: Request metadata\nUsed for authentication from dcl:explorer.\n"}}},"paths":{"/private-messages/token":{"get":{"operationId":"getPrivateMessagesToken","summary":"Get private messages token","description":"Generates a LiveKit token for accessing private messages.\nThis endpoint checks user privacy settings and generates appropriate credentials.\nRequires Signed Fetch authentication from dcl:explorer.\nMust include the complete identity header chain: x-identity-auth-chain-0, x-identity-auth-chain-1, x-identity-auth-chain-2, x-identity-timestamp, and x-identity-metadata.\n","responses":{"200":{"description":"Private messages token generated successfully","content":{"application/json":{"schema":{"type":"object","required":["adapter"],"properties":{"adapter":{"type":"string","description":"LiveKit connection URL for private messages"}}}}}},"401":{"description":"Unauthorized - Invalid authentication or blacklisted user","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","description":"Error message describing what went wrong"}}}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","description":"Error message describing what went wrong"}}}}}}},"tags":["Private Messages"]}}}}
```

## Update user private messages privacy

> Updates the privacy settings for a user's private messages.\
> This affects who can send private messages to the user.\
> Requires Bearer Token authentication.<br>

```json
{"openapi":"3.0.0","info":{"title":"Comms Gatekeeper API","version":"1.0.0"},"servers":[{"url":"https://comms-gatekeeper.decentraland.org","description":"Production server"},{"url":"https://comms-gatekeeper.decentraland.zone","description":"Development server"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","description":"Bearer token authentication for service-to-service communication.\n"}}},"paths":{"/users/{address}/private-messages-privacy":{"patch":{"operationId":"updatePrivateMessagesPrivacy","summary":"Update user private messages privacy","description":"Updates the privacy settings for a user's private messages.\nThis affects who can send private messages to the user.\nRequires Bearer Token authentication.\n","parameters":[{"name":"address","in":"path","required":true,"schema":{"type":"string"},"description":"ETH address of the user"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["private_messages_privacy"],"properties":{"private_messages_privacy":{"type":"string","enum":["all","only_friends"],"description":"Privacy setting for private messages"}}}}}},"responses":{"204":{"description":"Privacy settings updated successfully"},"400":{"description":"Invalid request - Invalid address or privacy setting","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","description":"Error message describing what went wrong"}}}}}},"401":{"description":"Unauthorized - Invalid token","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","description":"Error message describing what went wrong"}}}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string","description":"Error message describing what went wrong"}}}}}}},"tags":["Private Messages"]}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.decentraland.org/apis/apis/comms-gatekeeper/private-messages.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
