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

# Get Cron

> Retrieve a single cron job by ID

## Overview

Get a single cron job by its unique identifier.

<RequestExample>
  ```typescript Get cron by ID theme={null}
  import { cuey } from "cuey";

  const cron = await cuey.crons.get("cron-uuid-here");
  ```
</RequestExample>

## Parameters

<ParamField path="id" type="string" required>
  The UUID of the cron job to retrieve.
</ParamField>

## Response

<ResponseField name="cron" type="Cron" required>
  The cron job object.

  <Expandable title="Cron properties">
    <ResponseField name="id" type="string" required>
      Unique identifier for the cron job (UUID).
    </ResponseField>

    <ResponseField name="cron_expression" type="string" required>
      Cron expression defining the schedule (e.g., `0 9 * * *`).
    </ResponseField>

    <ResponseField name="timezone" type="string | null">
      Timezone for the cron schedule (e.g., `America/New_York`). `null` for UTC.
    </ResponseField>

    <ResponseField name="webhook_url" type="string" required>
      The webhook URL that will be called.
    </ResponseField>

    <ResponseField name="method" type="HttpMethod" required>
      HTTP method used for the webhook request. Defaults to `POST`.
    </ResponseField>

    <ResponseField name="headers" type="object | null">
      Custom headers to include in the webhook request. `null` if not set.
    </ResponseField>

    <ResponseField name="payload" type="object | null">
      Payload to send with the webhook request. `null` if not set.
    </ResponseField>

    <ResponseField name="retry_config" type="object | null">
      Retry configuration for failed webhooks.

      <Expandable title="RetryConfig properties">
        <ResponseField name="maxRetries" type="number" required>
          Maximum number of retry attempts (1-10).
        </ResponseField>

        <ResponseField name="backoffMs" type="number" required>
          Backoff delay in milliseconds (100-5000).
        </ResponseField>

        <ResponseField name="backoffType" type="string" required>
          Backoff strategy. Values: `exponential`, `linear`.
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="is_active" type="boolean | null">
      Whether the cron job is active. `null` defaults to `true`.
    </ResponseField>

    <ResponseField name="created_at" type="string | null">
      ISO 8601 timestamp when the cron job was created.
    </ResponseField>

    <ResponseField name="updated_at" type="string | null">
      ISO 8601 timestamp when the cron job was last updated.
    </ResponseField>

    <ResponseField name="team_id" type="string | null">
      Team ID associated with the cron job.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseExample>
  ```json Success response theme={null}
  {
    "id": "cron-uuid-here",
    "cron_expression": "0 9 * * *",
    "timezone": "America/New_York",
    "webhook_url": "https://api.example.com/webhook",
    "method": "POST",
    "headers": {
      "Authorization": "Bearer token"
    },
    "payload": {
      "report_type": "daily"
    },
    "retry_config": {
      "maxRetries": 3,
      "backoffMs": 1000,
      "backoffType": "exponential"
    },
    "is_active": true,
    "created_at": "2024-01-15T10:30:00Z",
    "updated_at": "2024-01-15T10:30:00Z",
    "team_id": "team-uuid-here"
  }
  ```
</ResponseExample>

## Errors

* `NotFoundError`: If the cron job doesn't exist
* `UnauthorizedError`: If API key is invalid or missing

## Examples

### Check Cron Status

```typescript theme={null}
import { cuey } from "cuey";

const cron = await cuey.crons.get("cron-uuid-here");

console.log("Cron expression:", cron.cron_expression);
console.log("Timezone:", cron.timezone);
console.log("Is active:", cron.is_active);
```

### List Events Created by Cron

```typescript theme={null}
import { cuey } from "cuey";

const cron = await cuey.crons.get("cron-uuid-here");
const { data: events } = await cuey.events.list({
  cron_id: cron.id,
});

console.log(`Found ${events.length} events for this cron`);
```
