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

# Rothlaigh rún

> Athsholáthair rún sínithe crúca gréasáin

Cruthaigh rún sínithe nua do webhook. Leanann an seanrún ag síniú ar feadh 24 uair an chloig, go dtí
`previous_secret_expires_at`. Stopann an dara rothlú laistigh den am sin an rún is sine láithreach.

> [!NOTE]
>
> Tá an raon feidhme `webhooks_manage` ag teastáil.

## Iarratas

### Paraiméadair chosáin

**id** `string` *required*

Aitheantóir an chrúca gréasáin (UUID).

### Paraiméadair choirp

Tá an corp roghnach.

**revoke\_current\_secret\_now** `boolean` (default: false)

Stopann `true` an rún reatha láithreach, mar shampla tar éis sceite.

## Freagra

Má éiríonn leis, tugann an API `200 OK` ar ais leis an webhook agus a rún nua.

**secret** `string` *required*

An rún sínithe, `whsec_` móide base64. Ní thaispeánann Aniva é ach sa fhreagra seo. Féach [Fíoraigh an
síniú](https://docs.anivahealth.com/ga/concepts/webhooks.md#fioraigh-an-siniu).

**id** `string` *required*

Aitheantóir an chrúca gréasáin (UUID).

**url** `string` *required*

An URL HTTPS a bpostálann Aniva imeachtaí chuige.

**description** `string`

Saorthéacs mar thagairt duit féin. D'fhéadfadh sé a bheith `null`.

**enabled\_events** `string[]` *required*

[Cineálacha imeachta](https://docs.anivahealth.com/ga/concepts/webhooks.md#imeachtai) a fhaigheann an crúca gréasáin seo. Ciallaíonn `*` gach cineál.

**alert\_emails** `string[]` *required*

Seoltaí a gcuireann Aniva ríomhphost chucu nuair a theipeann ar sheachadtaí go leanúnach.

**status** `string` *required*

`enabled` nó `disabled`.

**disabled\_at** `string`

Pointe ama ISO 8601 UTC nuair a díchumasaíodh an crúca gréasáin. `null` fad atá sé cumasaithe.

**disabled\_reason** `string`

An chúis ar díchumasaíodh an crúca gréasáin. Féach [Fógraí teipe](https://docs.anivahealth.com/ga/concepts/webhooks.md#fograi-teipe). `null`
fad atá sé cumasaithe.

**failing\_since** `string`

Pointe ama ISO 8601 UTC nuair a thosaigh an tsraith teipeanna reatha. `null` nuair a d'éirigh leis an seachadadh deireanach.

**previous\_secret\_expires\_at** `string`

Pointe ama ISO 8601 UTC nuair a scoireann an rún roimhe seo de shíniú. `null` nuair nach bhfuil aon rothlú ar siúl.

**created\_at** `string` *required*

Pointe ama ISO 8601 UTC nuair a cruthaíodh an crúca gréasáin.

**updated\_at** `string` *required*

Pointe ama ISO 8601 UTC don athrú deireanach.

## Freagraí earráide

| Stádas | Cur síos |
| - | - |
| `400` | Iarratas neamhbhailí. Féach an teachtaireacht `error`. |
| `401` | Gan eochair API, nó eochair API neamhbhailí. |
| `403` | Níl an scóip `webhooks_manage` ag d'eochair API. |
| `404` | Níor aimsíodh an webhook, nó is le heochair API eile é. |
| `500` | Earráid inmheánach freastalaí. |

```bash cURL theme={null}
curl --request POST \
  --url https://anivahealth.com/api/v1/webhooks/4a6c8e0f-2b4d-4f6a-8c0e-2a4c6e8f0b1d/rotate-secret \
  --header 'x-api-key: YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
    "revoke_current_secret_now": false
  }'
```

```json 200 theme={null}
{
  "id": "4a6c8e0f-2b4d-4f6a-8c0e-2a4c6e8f0b1d",
  "url": "https://partner.example.com/webhooks/aniva",
  "description": "Production",
  "enabled_events": [
    "appointment.confirmed",
    "appointment.results.completed",
    "home_kit_order.results.completed"
  ],
  "alert_emails": ["ops@partner.example.com"],
  "status": "enabled",
  "disabled_at": null,
  "disabled_reason": null,
  "failing_since": null,
  "previous_secret_expires_at": "2026-10-17T10:00:00.000Z",
  "created_at": "2026-10-15T08:00:00.000Z",
  "updated_at": "2026-10-16T10:00:00.000Z",
  "secret": "whsec_MfKQ9r8GKYqrTwjUPD8ILPZIo2LaLaSw8L0qsE2bkS4="
}
```

```json 404 theme={null}
{
  "error": "Webhook not found"
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.