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

# Get Redis Job Status

> Get Redis job status for debugging scheduled batch jobs. Verifies if job exists in Redis defer queue.

## Overview

Retrieves the Redis-side status of a scheduled batch job. This endpoint is primarily for **debugging and troubleshooting** scheduled jobs.

**Use this to:**

* Verify a scheduled job was created correctly
* Check if job still exists in Redis before cancellation
* Confirm job was removed after cancellation
* Debug scheduling issues

<Note>
  This endpoint is for **debugging purposes only**. For normal operations, use [Get Batch Job Detail](/api-reference/endpoint/get-batch-job).
</Note>

## Request

```bash theme={null}
GET /batch/jobs/{batch_job_id}/redis-status
```

## Path Parameters

| Parameter      | Type   | Required | Description                 |
| -------------- | ------ | -------- | --------------------------- |
| `batch_job_id` | string | ✅        | Unique batch job identifier |

## Response

```json theme={null}
{
  "batchJobId": "batch_xyz789",
  "databaseStatus": "scheduled",
  "scheduledJobId": "arq_job_abc123",
  "scheduledStartTime": "2025-03-01T14:00:00Z",
  "redisJobInfo": {
    "job_id": "arq_job_abc123",
    "in_defer_queue": false,
    "job_metadata_exists": true,
    "scheduled_time": "2025-03-01T14:00:00+00:00",
    "note": "ARQ 0.26.3+ stores deferred jobs as individual keys, not in a defer queue"
  }
}
```

### Response Fields

| Field                | Type   | Description                    |
| -------------------- | ------ | ------------------------------ |
| `batchJobId`         | string | Batch job ID                   |
| `databaseStatus`     | string | Job status in database         |
| `scheduledJobId`     | string | Redis/ARQ job ID               |
| `scheduledStartTime` | string | Scheduled time (ISO 8601, UTC) |
| `redisJobInfo`       | object | Redis-side job information     |

### Redis Job Info Object

| Field                 | Type    | Description                                           |
| --------------------- | ------- | ----------------------------------------------------- |
| `job_id`              | string  | ARQ job identifier                                    |
| `in_defer_queue`      | boolean | Whether in defer queue (always false for ARQ 0.26.3+) |
| `job_metadata_exists` | boolean | Whether job key exists in Redis                       |
| `scheduled_time`      | string  | Scheduled execution time from Redis                   |
| `note`                | string  | Implementation note about ARQ version                 |

## Examples

### Example 1: Check Scheduled Job Status

```bash theme={null}
curl -X GET "https://api.talkifai.com/batch/jobs/batch_xyz789/redis-status" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

**Response (Job Exists):**

```json theme={null}
{
  "batchJobId": "batch_xyz789",
  "databaseStatus": "scheduled",
  "scheduledJobId": "arq_job_abc123",
  "scheduledStartTime": "2025-03-01T14:00:00Z",
  "redisJobInfo": {
    "job_id": "arq_job_abc123",
    "in_defer_queue": false,
    "job_metadata_exists": true,
    "scheduled_time": "2025-03-01T14:00:00+00:00",
    "note": "ARQ 0.26.3+ stores deferred jobs as individual keys, not in a defer queue"
  }
}
```

**Response (Job Not Found in Redis):**

```json theme={null}
{
  "batchJobId": "batch_xyz789",
  "databaseStatus": "scheduled",
  "scheduledJobId": "arq_job_abc123",
  "scheduledStartTime": "2025-03-01T14:00:00Z",
  "redisJobInfo": {
    "job_id": "arq_job_abc123",
    "in_defer_queue": false,
    "job_metadata_exists": false,
    "scheduled_time": null,
    "note": "ARQ 0.26.3+ stores deferred jobs as individual keys, not in a defer queue"
  }
}
```

### Example 2: Check Non-Scheduled Job

```bash theme={null}
curl -X GET "https://api.talkifai.com/batch/jobs/batch_running/redis-status" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

**Response:**

```json theme={null}
{
  "batchJobId": "batch_running",
  "databaseStatus": "running",
  "scheduledJobId": null,
  "scheduledStartTime": null,
  "redisJobInfo": null
}
```

### Example 3: Debug Cancellation

Before cancelling a scheduled job, verify it exists:

```bash theme={null}
# Check if job exists in Redis
curl -X GET "https://api.talkifai.com/batch/jobs/batch_xyz789/redis-status" \
  -H "Authorization: Bearer YOUR_API_KEY"

# If redisJobInfo.job_metadata_exists is true, proceed with cancellation
curl -X POST "https://api.talkifai.com/batch/jobs/batch_xyz789/cancel" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

## Interpretation Guide

### Job Exists in Redis

```json theme={null}
{
  "redisJobInfo": {
    "job_metadata_exists": true,
    "scheduled_time": "2025-03-01T14:00:00+00:00"
  }
}
```

**Meaning:** Job is properly scheduled and will execute at the scheduled time.

### Job Not Found in Redis

```json theme={null}
{
  "redisJobInfo": {
    "job_metadata_exists": false,
    "scheduled_time": null
  }
}
```

**Possible causes:**

* Job already executed (dequeued by worker)
* Job was cancelled previously
* Database and Redis are out of sync
* Job creation failed silently

### No Scheduled Job ID

```json theme={null}
{
  "scheduledJobId": null,
  "redisJobInfo": null
}
```

**Meaning:** Job is not scheduled (either `running`, `completed`, `pending`, or was never scheduled).

## Error Handling

### 404 Not Found

```json theme={null}
{
  "detail": "Batch job not found"
}
```

### 500 Internal Server Error

```json theme={null}
{
  "detail": "Failed to get Redis job status"
}
```

## Troubleshooting

### Issue: Job Shows "scheduled" But Never Started

**Check Redis status:**

```bash theme={null}
curl -X GET "https://api.talkifai.com/batch/jobs/batch_xyz789/redis-status"
```

**If `job_metadata_exists` is false:**

* Job may have been lost (Redis restart, crash)
* Database and Redis are out of sync
* **Solution:** Use [Start Batch Job](/api-reference/endpoint/start-batch-job) to manually start

### Issue: Cancellation Returns "Job Not Found"

**Check Redis status first:**

```bash theme={null}
curl -X GET "https://api.talkifai.com/batch/jobs/batch_xyz789/redis-status"
```

**If `job_metadata_exists` is false:**

* Job already executed or was never in Redis
* Cancellation will still update database
* **Expected behavior:** `redisJobCancelled: false` in response

### Issue: Scheduled Time Wrong

**Verify timezone conversion:**

```bash theme={null}
curl -X GET "https://api.talkifai.com/batch/jobs/batch_xyz789/redis-status"
```

Compare `scheduledStartTime` (database) with `redisJobInfo.scheduled_time` (Redis):

* They should match (within seconds)
* If different, there may be a timezone conversion issue

## Related

* [Get Batch Job Detail](/api-reference/endpoint/get-batch-job) — Get complete job info
* [Cancel Batch Job](/api-reference/endpoint/cancel-batch-job) — Cancel a scheduled job
* [Reschedule Batch Job](/api-reference/endpoint/reschedule-batch-job) — Change scheduled time
* [Batch Calling Guide](/platform/batch-calling) — Complete guide to batch campaigns


## OpenAPI

````yaml GET /batch/jobs/{batch_job_id}/redis-status
openapi: 3.1.0
info:
  title: TalkifAI API
  version: 1.0.0
  description: Build and manage AI voice and chat agents programmatically.
servers:
  - url: https://api.talkifai.dev
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Agents
    description: Create and manage voice and chat agents
  - name: Voice Calls
    description: Initiate outbound calls and retrieve call data
  - name: Text Chat
    description: Text chat sessions via REST + SSE
  - name: Batch Calling
    description: Run large-scale outbound call campaigns
paths:
  /batch/jobs/{batch_job_id}/redis-status:
    get:
      tags:
        - Batch Calling
      summary: Get Redis Job Status
      description: >-
        Get Redis job status for debugging scheduled batch jobs. Verifies if job
        exists in Redis defer queue.
      operationId: getRedisJobStatus
      parameters:
        - name: batch_job_id
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Redis job status
          content:
            application/json:
              schema:
                type: object
                properties:
                  batchJobId:
                    type: string
                  databaseStatus:
                    type: string
                    example: scheduled
                  scheduledJobId:
                    type: string
                    nullable: true
                  scheduledStartTime:
                    type: string
                    format: date-time
                    nullable: true
                  redisJobInfo:
                    type: object
                    nullable: true
                    properties:
                      job_id:
                        type: string
                      in_defer_queue:
                        type: boolean
                      job_metadata_exists:
                        type: boolean
                      scheduled_time:
                        type: string
                        format: date-time
                        nullable: true
                      note:
                        type: string
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          description: Batch job not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - bearerAuth: []
components:
  responses:
    Unauthorized:
      description: Invalid or missing API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            success: false
            error: Invalid API key
            code: invalid_api_key
  schemas:
    Error:
      type: object
      properties:
        success:
          type: boolean
          example: false
        error:
          type: string
          example: Error message
        code:
          type: string
          example: ERROR_CODE
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: tk_live_...
      description: Your TalkifAI API key. Get it from Studio â†’ Settings â†’ API Keys.

````