# Event

Vendor API v0.6.6 · 1 operation
Source: https://plasapi.com/vendor/v0.6.6/event/

This group is used by operations but is not declared in the specification’s tag list, so it has no description of its own.

## Receives events from an LMS

`POST` `/events/receiver` · `ReceiverEvents`

### Example request

**cURL**

```bash
curl -X POST "$PLAS_BASE_URL/events/receiver?version=0.6.6" \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -H "Authorization: Bearer $PLAS_TOKEN" \
  -d '{
  "eventId": "84410",
  "type": "consent_changed",
  "data": {
    "consent": {
      "available": [
        {
          "type": "loan_history",
          "version": "2025-01"
        }
      ],
      "evaluated": [
        {
          "given": true,
          "type": "loan_history",
          "version": "2025-01"
        }
      ]
    },
    "patronId": "40218873"
  }
}'
```

**JavaScript**

```javascript
const response = await fetch(`${process.env.PLAS_BASE_URL}/events/receiver?version=0.6.6`, {
  method: "POST",
  headers: {
    "Accept": "application/json",
    "Content-Type": "application/json",
    "Authorization": `Bearer ${process.env.PLAS_TOKEN}`,
  },
  body: JSON.stringify({
    "eventId": "84410",
    "type": "consent_changed",
    "data": {
      "consent": {
        "available": [
          {
            "type": "loan_history",
            "version": "2025-01"
          }
        ],
        "evaluated": [
          {
            "given": true,
            "type": "loan_history",
            "version": "2025-01"
          }
        ]
      },
      "patronId": "40218873"
    }
  }),
});
```

**Python**

```python
import os
import requests

response = requests.post(
    f"{os.environ['PLAS_BASE_URL']}/events/receiver",
    params={
        "version": "0.6.6",
    },
    headers={
        "Accept": "application/json",
        "Content-Type": "application/json",
        "Authorization": f"Bearer {os.environ['PLAS_TOKEN']}",
    },
    json={
        "eventId": "84410",
        "type": "consent_changed",
        "data": {
            "consent": {
                "available": [
                    {
                        "type": "loan_history",
                        "version": "2025-01",
                    },
                ],
                "evaluated": [
                    {
                        "given": True,
                        "type": "loan_history",
                        "version": "2025-01",
                    },
                ],
            },
            "patronId": "40218873",
        },
    },
)
response.raise_for_status()
```

The host and token are environment variables: `PLAS_BASE_URL` the provider’s base URL · `PLAS_TOKEN` an access token.

### Parameters

Shared across operations: `version`. [See the shared contract on the version page.](https://plasapi.com/vendor/v0.6.6/)

### Request body

`application/json` · required

[`EventReceiverRequest`](https://plasapi.com/vendor/v0.6.6/schemas/#EventReceiverRequest)

### Responses

#### `204` OK

No response body.

#### `400` The list of errors.

`Errors`

Shared response, defined once for the whole API. [See the shared contract on the version page.](https://plasapi.com/vendor/v0.6.6/)

Example (Generated from the schema):

```json
{
  "errors": [
    {
      "code": 500,
      "info": "500: System error"
    }
  ]
}
```

#### `401` Secret is invalid.

No response body.

Shared response, defined once for the whole API. [See the shared contract on the version page.](https://plasapi.com/vendor/v0.6.6/)
