> ## Documentation Index
> Fetch the complete documentation index at: https://docs.clix.so/llms.txt
> Use this file to discover all available pages before exploring further.

# Skills

> Payload shapes, artifacts, and usage notes for the four built-in Clix A2A skills.

Clix currently exposes four built-in A2A skills. For production integrations, always specify the skill explicitly in a `data` part.

## Canonical Request Pattern

```json theme={null}
{
  "jsonrpc": "2.0",
  "id": "req-1",
  "method": "SendMessage",
  "params": {
    "message": {
      "messageId": "msg-1",
      "role": "user",
      "parts": [
        {
          "data": {
            "skill": "create-user"
          }
        }
      ]
    }
  }
}
```

<Tip>
  Clix can infer a skill from text-only requests, but that routing is best-effort. Use `data.skill` when correctness matters.
</Tip>

## Skill Summary

| Skill                    | Purpose                                                  | Artifact           |
| ------------------------ | -------------------------------------------------------- | ------------------ |
| `create-user`            | Create or update a Clix user by project user ID          | `user-result`      |
| `track-event`            | Track a custom event for a device                        | `event-result`     |
| `send-push-notification` | Send an app push notification to one target              | `delivery-results` |
| `trigger-campaign`       | Create a campaign trigger with optional explicit targets | `trigger-result`   |

## create-user

Creates or updates a user and writes a `user-result` artifact.

### Parameters

| Field           | Type   | Required | Description               |
| --------------- | ------ | -------- | ------------------------- |
| `skill`         | string | Yes      | Must be `create-user`     |
| `projectUserId` | string | Yes      | Your application user ID  |
| `properties`    | object | No       | Arbitrary user properties |

### Artifact

```json theme={null}
{
  "artifactId": "art-uuid",
  "name": "user-result",
  "parts": [
    {
      "data": {
        "userId": "uuid",
        "projectUserId": "user_123"
      }
    }
  ]
}
```

## track-event

Tracks one event for one device and writes an `event-result` artifact.

### Parameters

| Field        | Type   | Required | Description                                |
| ------------ | ------ | -------- | ------------------------------------------ |
| `skill`      | string | Yes      | Must be `track-event`                      |
| `eventName`  | string | Yes      | Event name such as `purchase` or `sign_up` |
| `deviceId`   | string | Yes      | Device identifier                          |
| `properties` | object | No       | Custom event properties                    |

### Artifact

```json theme={null}
{
  "artifactId": "art-uuid",
  "name": "event-result",
  "parts": [
    {
      "data": {
        "trackedEvents": 1.0,
        "eventName": "purchase"
      }
    }
  ]
}
```

## send-push-notification

Sends one push notification request and writes a `delivery-results` artifact.

### Parameters

| Field           | Type   | Required      | Description                      |
| --------------- | ------ | ------------- | -------------------------------- |
| `skill`         | string | Yes           | Must be `send-push-notification` |
| `deviceId`      | string | Conditionally | One valid target selector        |
| `userId`        | string | Conditionally | One valid target selector        |
| `projectUserId` | string | Conditionally | One valid target selector        |
| `title`         | string | No            | Notification title               |
| `body`          | string | No            | Notification body                |
| `imageUrl`      | string | No            | Rich notification image URL      |
| `landingUrl`    | string | No            | Deep link or URL opened on tap   |

At least one of `deviceId`, `userId`, or `projectUserId` must be present.

### Artifact

```json theme={null}
{
  "artifactId": "art-uuid",
  "name": "delivery-results",
  "parts": [
    {
      "data": {
        "totalSent": 1.0,
        "results": [
          {
            "messageId": "msg-uuid",
            "status": "DELIVERY_RESULT_STATUS_SUCCEED"
          }
        ]
      }
    }
  ]
}
```

<Note>
  `results[].status` is the raw delivery result enum string produced by Clix, such as `DELIVERY_RESULT_STATUS_SUCCEED` or `DELIVERY_RESULT_STATUS_FAILED`.
</Note>

## trigger-campaign

Creates a trigger for an existing campaign and writes a `trigger-result` artifact.

### Parameters

| Field        | Type   | Required | Description                                                         |
| ------------ | ------ | -------- | ------------------------------------------------------------------- |
| `skill`      | string | Yes      | Must be `trigger-campaign`                                          |
| `campaignId` | string | Yes      | Campaign identifier                                                 |
| `targets`    | array  | No       | Explicit target list using `deviceId`, `userId`, or `projectUserId` |
| `properties` | object | No       | Trigger properties                                                  |

`targets` can be omitted or empty. In that case, Clix creates the trigger without an explicit target list.

### Artifact

```json theme={null}
{
  "artifactId": "art-uuid",
  "name": "trigger-result",
  "parts": [
    {
      "data": {
        "triggerId": "trigger-uuid"
      }
    }
  ]
}
```

## Example Payloads

### create-user

```json theme={null}
{
  "skill": "create-user",
  "projectUserId": "user_123",
  "properties": {
    "email": "user@example.com",
    "plan": "premium"
  }
}
```

### track-event

```json theme={null}
{
  "skill": "track-event",
  "eventName": "purchase",
  "deviceId": "device_abc",
  "properties": {
    "amount": 29.99,
    "currency": "USD"
  }
}
```

### send-push-notification

```json theme={null}
{
  "skill": "send-push-notification",
  "projectUserId": "user_123",
  "title": "Welcome",
  "body": "Thanks for signing up.",
  "landingUrl": "myapp://welcome"
}
```

### trigger-campaign

```json theme={null}
{
  "skill": "trigger-campaign",
  "campaignId": "camp_abc123",
  "targets": [
    {
      "projectUserId": "user_123"
    }
  ],
  "properties": {
    "promo_code": "WELCOME10"
  }
}
```
