---
title: "Turn a package cron job or subscription topic on for yourself."
method: POST
path: "/v1/enablements"
tags: ["packages"]
---

# Turn a package cron job or subscription topic on for yourself.

`POST /v1/enablements`

## Request

- Base URL: `https://api.kody.codes`
- URL: `https://api.kody.codes/v1/enablements`
- Auth: HTTP bearer

Turn a package cron job or subscription topic on for yourself. A webhook is different: its first turn-on needs a person to Approve it at the approval URL (webhookUrlMint or credentialMappingPropose returns it), so this refuses a webhook that is not already on, and only returns an existing enablement. email.message.received and email.message.quarantined are refused here too: those run only for a sender, so a person Approves them from the inbox (the approval link includes sender_kind and sender_value). Every run then acts as you: your access, your credentials, billed and audited to you. Publishing never turns a trigger on, and nobody can enable one for someone else. Needs package:execute on the package. If you lose access later, the enablement pauses and resumes by itself once access is back.

Org permission: `package:execute`.

## Request body

- object
  - `packageId` string: Saved-package UUID. Use when the scoped name is not known, or for a stable ref.
  - `kodyId` string: Package name (`@owner/leaf` or the name leaf). Prefer this when you know the name.
  - `triggerKind` 'cron' | 'subscription' | 'webhook', required: cron (a package.json#kody.jobs entry), subscription (a package.json#kody.subscriptions topic, inbound email included), or webhook (a minted package.json#kody.webhooks entry).
  - `triggerName` string, required: Job name, subscription topic, or webhook name.

## Response `200`

Success.

- object
  - `enablement` object, required
    - `id` string, required
    - `package_id` string, nullable, required
    - `trigger_kind` 'cron' | 'subscription' | 'webhook', required: cron (a package.json#kody.jobs entry), subscription (a package.json#kody.subscriptions topic, inbound email included), or webhook (a minted package.json#kody.webhooks entry).
    - `trigger_name` string, required: Job name, subscription topic, or webhook name.
    - `enabler_user_id` string, required: The person every run acts as, and who is billed.
    - `state` 'on' | 'paused' | 'off', required: paused: the enabler lost access; events are dropped until access is back, then it resumes by itself.
    - `paused_reason` 'org_access' | 'package_access' | 'credential_access', nullable, required
    - `paused_permission` string, nullable, required
    - `paused_resource` object, nullable, required
      - `type` string, required
      - `id` string, required
    - `origin` 'enabled' | 'migrated', required
    - `enabled_at` string, required
    - `disabled_at` string, nullable, required

## Other responses

- `400`: Error envelope `{ "error": { "code", "message", "details"? } }`.
- `401`: Error envelope `{ "error": { "code", "message", "details"? } }`.
- `403`: Error envelope `{ "error": { "code", "message", "details"? } }`.
- `404`: Error envelope `{ "error": { "code", "message", "details"? } }`.
- `409`: Error envelope `{ "error": { "code", "message", "details"? } }`.
- `413`: Error envelope `{ "error": { "code", "message", "details"? } }`.
- `429`: Too many requests (edge IP/token limit) or an entitlement / plan-cap limit. Wait at least `Retry-After` seconds before retrying.
- `500`: Error envelope `{ "error": { "code", "message", "details"? } }`.
- `503`: Error envelope `{ "error": { "code", "message", "details"? } }`.
- `default`: Error envelope `{ "error": { "code", "message", "details"? } }`.

---

[API](https://skmtc.dev/kody/apis/kody-api.md) · [All operations](https://skmtc.dev/kody/apis/kody-api/llms.txt) · [OpenAPI document](https://skmtc.dev/kody/apis/kody-api/revisions/705f4f022728?raw)
