> Markdown versions of all pages of this connector library are available by appending `.md` to the page URL. For the full index of connectors, see [llms.txt](https://connectors.appmixer.com/llms.txt).

# appmixer.posthog.core.CaptureEvent

- Component: `appmixer.posthog.core.CaptureEvent`
- Kind: Action
- Version: 1.0.0
- Visibility: Public
- Connector: [appmixer.posthog 1.1.0](https://connectors.appmixer.com/connector/appmixer.posthog/1.1.0.md)
- Component page: <https://connectors.appmixer.com/connector/appmixer.posthog/1.1.0/component/appmixer.posthog.core.CaptureEvent>

Capture a single event in PostHog. The event is sent to the project's ingestion endpoint using the public Project API key.

## Input ports

### Port `in`

| Field | Type | Description |
| --- | --- | --- |
| Project (`projectId`) | text | Pick a project, or type the numeric Project ID directly. |
| Event Name (`event`) | text | Name of the event to capture, e.g. 'order_created'. |
| Distinct ID (`distinctId`) | text | Unique identifier of the user the event belongs to. |
| Properties (`properties`) | textarea | Optional event properties as a JSON object, e.g. {"plan": "premium", "amount": 42}. |
| Timestamp (`timestamp`) | date-time | Optional event timestamp. Defaults to the time PostHog receives the event. |

## Output ports

### Port `out`

| Field | Type | Description |
| --- | --- | --- |
| Status (`status`) | string | - |
| Event Name (`event`) | string | - |
| Distinct ID (`distinctId`) | string | - |

## Full metadata (component.json)

```json
{
  "name": "appmixer.posthog.core.CaptureEvent",
  "description": "Capture a single event in PostHog. The event is sent to the project's ingestion endpoint using the public Project API key.",
  "author": "Appmixer <info@appmixer.com>",
  "version": "1.0.0",
  "auth": {
    "service": "appmixer:posthog"
  },
  "quota": {
    "manager": "appmixer:posthog",
    "resources": "requests",
    "scope": {
      "userId": "{{userId}}"
    }
  },
  "inPorts": [
    {
      "name": "in",
      "schema": {
        "type": "object",
        "properties": {
          "projectId": {
            "type": "string"
          },
          "event": {
            "type": "string"
          },
          "distinctId": {
            "type": "string"
          },
          "properties": {
            "type": "string"
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "projectId",
          "event",
          "distinctId"
        ]
      },
      "inspector": {
        "inputs": {
          "projectId": {
            "type": "text",
            "index": 1,
            "label": "Project",
            "tooltip": "Pick a project, or type the numeric Project ID directly.",
            "source": {
              "url": "/component/appmixer/posthog/core/ListProjects?outPort=out",
              "data": {
                "properties": {
                  "isSource": true
                },
                "transform": "./ListProjects#toSelectArray"
              }
            }
          },
          "event": {
            "type": "text",
            "index": 2,
            "label": "Event Name",
            "tooltip": "Name of the event to capture, e.g. 'order_created'."
          },
          "distinctId": {
            "type": "text",
            "index": 3,
            "label": "Distinct ID",
            "tooltip": "Unique identifier of the user the event belongs to."
          },
          "properties": {
            "type": "textarea",
            "index": 4,
            "label": "Properties",
            "tooltip": "Optional event properties as a JSON object, e.g. {\"plan\": \"premium\", \"amount\": 42}."
          },
          "timestamp": {
            "type": "date-time",
            "index": 5,
            "label": "Timestamp",
            "tooltip": "Optional event timestamp. Defaults to the time PostHog receives the event."
          }
        }
      }
    }
  ],
  "outPorts": [
    {
      "name": "out",
      "schema": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "title": "Status",
            "example": "Ok"
          },
          "event": {
            "type": "string",
            "title": "Event Name",
            "example": "order_created"
          },
          "distinctId": {
            "type": "string",
            "title": "Distinct ID",
            "example": "user-42"
          }
        }
      }
    }
  ],
  "icon": "(data URI omitted)"
}
```
