> For the complete documentation index, see [llms.txt](https://docs.ruuvi.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ruuvi.com/communicate-with-ruuvi-cloud/cloud/user-api/share.md).

# Share

Sensor sharing and unsharing

## Share a sensor with another user

> Shares your sensor data with another user via their e-mail address. \
> This grants them access to the sensor data via the get endpoint.\
> \
> A notification e-mail will be sent to the target user about the new share.\
> If the target user does not exist yet, an invitation to create an account \
> will be sent and they will gain access upon sign up.\
> \
> The features share receiver gets are based on your account type - if you have\
> a Pro account, the share receiver also gets Pro features for this sensor.<br>

```json
{"openapi":"3.0.3","info":{"title":"Ruuvi Cloud - User API","version":"1.0.0"},"tags":[{"name":"Share","description":"Sensor sharing and unsharing"}],"servers":[{"url":"https://network.ruuvi.com"},{"url":"https://testnet.ruuvi.com"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"}},"schemas":{"Success":{"type":"object","required":["result","data"],"properties":{"result":{"type":"string","enum":["success"]},"data":{"description":"Endpoint-specific payload"}}},"ShareResult":{"type":"object","required":["sensor"],"properties":{"sensor":{"type":"string","description":"MAC address of the shared sensor","pattern":"^([0-9A-Fa-f]{2}:){5}[0-9A-Fa-f]{2}$"},"invited":{"type":"boolean","description":"True if the target user did not exist and an invitation email was sent. False if the target user already has an account.\n"}}},"Error":{"type":"object","required":["result","error","code"],"properties":{"result":{"type":"string","enum":["error"]},"error":{"type":"string","description":"Human-readable explanation"},"code":{"type":"string","description":"Machine-readable primary error code"},"sub_code":{"nullable":true,"type":"string","description":"Optional secondary code useful for client logic"}}}}},"paths":{"/share":{"post":{"summary":"Share a sensor with another user","description":"Shares your sensor data with another user via their e-mail address. \nThis grants them access to the sensor data via the get endpoint.\n\nA notification e-mail will be sent to the target user about the new share.\nIf the target user does not exist yet, an invitation to create an account \nwill be sent and they will gain access upon sign up.\n\nThe features share receiver gets are based on your account type - if you have\na Pro account, the share receiver also gets Pro features for this sensor.\n","operationId":"shareSensor","tags":["Share"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["sensor","user"],"properties":{"sensor":{"type":"string","description":"MAC address of the sensor to share (e.g. `C6:F1:E7:D3:DA:11`)","pattern":"^([0-9A-Fa-f]{2}:){5}[0-9A-Fa-f]{2}$"},"user":{"type":"string","format":"email","description":"E-mail address of the user to share the sensor with"}}}}}},"responses":{"200":{"description":"Sensor shared successfully","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Success"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ShareResult"}}}]}}}},"400":{"description":"INVALID - Missing or malformed fields   (`sensor` or `user` missing; sensor not valid MAC address; user not valid email)\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"UNAUTHORIZED - Auth token missing or expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"FORBIDDEN - User does not own this sensor or cannot share it","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"CONFLICT - Sensor is already shared to this user","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"INTERNAL SERVER ERROR - Unexpected error occurred","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## Unshare a sensor from a user

> Revokes access to the sensor from a target user.\
> \
> This can also be used to remove sensors that have been shared with your own user\
> (i.e., declining a share from someone else).<br>

```json
{"openapi":"3.0.3","info":{"title":"Ruuvi Cloud - User API","version":"1.0.0"},"tags":[{"name":"Share","description":"Sensor sharing and unsharing"}],"servers":[{"url":"https://network.ruuvi.com"},{"url":"https://testnet.ruuvi.com"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"}},"schemas":{"Success":{"type":"object","required":["result","data"],"properties":{"result":{"type":"string","enum":["success"]},"data":{"description":"Endpoint-specific payload"}}},"Error":{"type":"object","required":["result","error","code"],"properties":{"result":{"type":"string","enum":["error"]},"error":{"type":"string","description":"Human-readable explanation"},"code":{"type":"string","description":"Machine-readable primary error code"},"sub_code":{"nullable":true,"type":"string","description":"Optional secondary code useful for client logic"}}}}},"paths":{"/unshare":{"post":{"summary":"Unshare a sensor from a user","description":"Revokes access to the sensor from a target user.\n\nThis can also be used to remove sensors that have been shared with your own user\n(i.e., declining a share from someone else).\n","operationId":"unshareSensor","tags":["Share"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["sensor"],"properties":{"sensor":{"type":"string","description":"MAC address of the sensor to unshare (e.g. `C6:F1:E7:D3:DA:11`)","pattern":"^([0-9A-Fa-f]{2}:){5}[0-9A-Fa-f]{2}$"},"user":{"type":"string","format":"email","description":"E-mail address of the user to revoke access from.\nIf omitted, the share is removed from the authenticated user's account\n(useful for declining a share someone else made to you).\n"}}}}}},"responses":{"200":{"description":"Sensor unshared successfully","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Success"},{"type":"object","properties":{"data":{"type":"object","description":"Empty object on success"}}}]}}}},"400":{"description":"INVALID - Missing or malformed fields   (`sensor` missing or not valid MAC address)\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"UNAUTHORIZED - Auth token missing or expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"FORBIDDEN - User does not have permission to unshare this sensor","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"NOT FOUND - Shared sensor or target user not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"INTERNAL SERVER ERROR - Unexpected error occurred","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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.ruuvi.com/communicate-with-ruuvi-cloud/cloud/user-api/share.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.
