# Events

Event actions

## POST /v1/events/publish/{environmentId}

> Publish an event to a Virtual Environment

```json
{"openapi":"3.0.0","info":{"title":"Replica Butler","version":"4.4.0"},"tags":[{"name":"Events","description":"Event actions"}],"servers":[{"url":"/butler/api","description":"Replica Butler"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"EnvironmentEventRequest":{"type":"object","required":["name","data"],"properties":{"name":{"type":"string","description":"The event name (clipboard_sync, file_download, open_tab, etc.)","$ref":"#/components/schemas/EnvironmentEvent"},"data":{"type":"string","description":"The data to publish"}}},"EnvironmentEvent":{"type":"string","enum":["clipboard_sync","file_download","files_download_all","open_tab"]},"ReplicaMessageSuccess":{"type":"object","properties":{"statusCode":{"type":"integer"},"success":{"type":"boolean"},"message":{"type":"string"},"event":{"type":"string","$ref":"#/components/schemas/ReplicaEvent"},"items":{"type":"array"}}},"ReplicaEvent":{"type":"string","enum":["GET","POST","PUT","DELETE","ERROR"]},"ReplicaMessageFailure":{"type":"object","properties":{"statusCode":{"type":"integer"},"success":{"type":"boolean"},"message":{"type":"string"},"event":{"type":"string","$ref":"#/components/schemas/ReplicaEvent"},"items":{"type":"array"}}}}},"paths":{"/v1/events/publish/{environmentId}":{"post":{"summary":"Publish an event to a Virtual Environment","tags":["Events"],"parameters":[{"name":"environmentId","in":"path","required":true,"description":"The Environment Id","schema":{"type":"string"}}],"requestBody":{"description":"Environment Event request body","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnvironmentEventRequest"}}}},"responses":{"200":{"description":"Publish success","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ReplicaMessageSuccess"},{"type":"object","properties":{"message":{}}}]}}}},"500":{"description":"Publish failure","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ReplicaMessageFailure"},{"type":"object","properties":{"message":{}}}]}}}}}}}}}
```


---

# 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.replicacyber.com/developer-guide/butler-api-reference/events.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.
