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

# Get Job Result

> Retrieve the generated content after job completion

## Endpoint

```
GET /api/job-result/:jobId
```

## Authentication

No authentication required.

## Path Parameters

<ParamField path="jobId" type="string" required>
  The unique identifier of the completed job
</ParamField>

## Response

<ResponseField name="success" type="boolean">
  Indicates if the request was successful
</ResponseField>

<ResponseField name="message" type="string">
  Human-readable status message
</ResponseField>

<ResponseField name="data" type="object">
  <Expandable title="properties">
    <ResponseField name="id" type="string">
      Content identifier
    </ResponseField>

    <ResponseField name="type" type="string">
      Content type: `text` or `pdf`
    </ResponseField>

    <ResponseField name="format" type="string">
      Content format: `image`, `carousel`, or `reel`
    </ResponseField>

    <ResponseField name="caption" type="string">
      Generated caption text for the post
    </ResponseField>

    <ResponseField name="hashtags" type="string">
      Suggested hashtags for the post
    </ResponseField>

    <ResponseField name="audioUrl" type="string">
      URL to audio file (for reels only)
    </ResponseField>

    <ResponseField name="createdAt" type="string">
      ISO timestamp when content was created
    </ResponseField>

    <ResponseField name="metadata" type="object">
      Additional metadata like platform, visual template, slide count, etc.
    </ResponseField>

    <ResponseField name="images" type="array">
      Array of image objects

      <Expandable title="image object">
        <ResponseField name="id" type="string">
          Image identifier
        </ResponseField>

        <ResponseField name="url" type="string">
          Public URL to the generated image
        </ResponseField>

        <ResponseField name="slideNumber" type="number">
          Slide position (for carousels)
        </ResponseField>

        <ResponseField name="createdAt" type="string">
          ISO timestamp
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="videos" type="array">
      Array of video objects (for reels)

      <Expandable title="video object">
        <ResponseField name="id" type="string">
          Video identifier
        </ResponseField>

        <ResponseField name="url" type="string">
          Public URL to the generated video
        </ResponseField>

        <ResponseField name="duration" type="number">
          Video duration in seconds
        </ResponseField>

        <ResponseField name="createdAt" type="string">
          ISO timestamp
        </ResponseField>
      </Expandable>
    </ResponseField>
  </Expandable>
</ResponseField>

## Example Request

```bash theme={null}
curl https://api.distylia.com/api/job-result/550e8400-e29b-41d4-a716-446655440000
```

## Example Response - Image

```json theme={null}
{
  "success": true,
  "message": "Job result retrieved successfully",
  "data": {
    "id": "content-123",
    "type": "text",
    "format": "image",
    "caption": "Ready to boost your productivity? Check out these 5 game-changing tips! 🚀",
    "hashtags": "#productivity #workfromhome #timemanagement #efficiency #success",
    "audioUrl": null,
    "createdAt": "2024-01-08T10:32:15.000Z",
    "metadata": {
      "platform": "instagram",
      "visualTemplate": "minimal",
      "slideCount": null
    },
    "images": [
      {
        "id": "img-1",
        "url": "https://storage.example.com/content/image-123.png",
        "slideNumber": 1,
        "createdAt": "2024-01-08T10:32:15.000Z"
      }
    ],
    "videos": []
  }
}
```

## Example Response - Carousel

```json theme={null}
{
  "success": true,
  "message": "Job result retrieved successfully",
  "data": {
    "id": "content-456",
    "type": "text",
    "format": "carousel",
    "caption": "Swipe through for 5 essential remote work tips! 💼✨",
    "hashtags": "#remotework #workfromhome #productivity #digitalnomad #workflow",
    "audioUrl": null,
    "createdAt": "2024-01-08T10:35:20.000Z",
    "metadata": {
      "platform": "instagram",
      "visualTemplate": "magazine",
      "slideCount": 5
    },
    "images": [
      {
        "id": "img-1",
        "url": "https://storage.example.com/content/slide-1.png",
        "slideNumber": 1,
        "createdAt": "2024-01-08T10:35:20.000Z"
      },
      {
        "id": "img-2",
        "url": "https://storage.example.com/content/slide-2.png",
        "slideNumber": 2,
        "createdAt": "2024-01-08T10:35:21.000Z"
      }
      // ... more slides
    ],
    "videos": []
  }
}
```

## Example Response - Reel

```json theme={null}
{
  "success": true,
  "message": "Job result retrieved successfully",
  "data": {
    "id": "content-789",
    "type": "text",
    "format": "reel",
    "caption": "Quick productivity tips to level up your work! 🎯",
    "hashtags": "#productivitytips #reels #motivation #worklife #shorts",
    "audioUrl": "https://storage.example.com/audio/audio-123.mp3",
    "createdAt": "2024-01-08T10:40:30.000Z",
    "metadata": {
      "platform": "tiktok",
      "visualTemplate": "neon",
      "maxDuration": 30,
      "captions": {
        "enabled": true,
        "style": "modern",
        "position": "bottom",
        "fontSize": "medium"
      }
    },
    "images": [],
    "videos": [
      {
        "id": "vid-1",
        "url": "https://storage.example.com/content/reel-789.mp4",
        "duration": 28,
        "createdAt": "2024-01-08T10:40:30.000Z"
      }
    ]
  }
}
```

## Error Responses

<ResponseExample>
  ```json 400 - Job ID Required theme={null}
  {
    "error": "Job ID is required"
  }
  ```

  ```json 404 - Result Not Found theme={null}
  {
    "success": false,
    "error": "Result for job with ID abc123 not found or job not completed"
  }
  ```
</ResponseExample>

## Notes

* Only call this endpoint after the job status is `completed`
* Result URLs are publicly accessible and permanent
* All media files are hosted on Azure Blob Storage
* For carousels, images are ordered by `slideNumber`
