> This is Payabli documentation. For a complete page index, fetch https://docs.payabli.com/llms.txt — append .md to any page URL for lightweight markdown. For section-level indexes, query parameters, and other AI-optimized access methods, see https://docs.payabli.com/ai-agents.md

# Download case attachment

GET https://api-sandbox.payabli.com/api/v2/cases/{caseUuid}/attachments/{attachmentId}

Streams the file content of an attachment.

Available to both Platform and Enterprise Partners.


Reference: https://docs.payabli.com/developers/api-reference/caseManagement/download-case-attachment

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: payabliApi-oas
  version: 1.0.0
paths:
  /v2/cases/{caseUuid}/attachments/{attachmentId}:
    get:
      operationId: GetAttachment
      summary: Download case attachment
      description: |
        Streams the file content of an attachment.

        Available to both Platform and Enterprise Partners.
      tags:
        - caseManagement
      parameters:
        - name: caseUuid
          in: path
          description: The case's UUID.
          required: true
          schema:
            type: string
            format: uuid
        - name: attachmentId
          in: path
          description: The attachment's UUID.
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: The file content
          content:
            application/octet-stream:
              schema:
                type: string
                format: binary
        '401':
          description: Unauthorized request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PayabliErrorBody'
        '403':
          description: Consent error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PayabliErrorBody'
        '404':
          description: The case or attachment doesn't exist.
          content:
            application/json:
              schema:
                description: Any type
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PayabliErrorBody'
servers:
  - url: https://api-sandbox.payabli.com/api
    description: Sandbox
  - url: https://api.payabli.com/api
    description: Production
components:
  schemas:
    PayabliErrorBodyResponseData:
      type: object
      properties:
        explanation:
          type: string
          description: Human-readable explanation of what happened.
        todoAction:
          type: string
          description: Suggested resolution.
      description: Object with detailed error context.
      title: PayabliErrorBodyResponseData
    PayabliErrorBody:
      type: object
      properties:
        isSuccess:
          type: boolean
          description: Always `false` for error responses.
        responseCode:
          type: integer
          description: |
            Code for the response. Learn more in
            [API Response Codes](/developers/api-reference/api-responses).
        responseText:
          type: string
          description: Error text describing what went wrong.
        responseData:
          $ref: '#/components/schemas/PayabliErrorBodyResponseData'
          description: Object with detailed error context.
      required:
        - isSuccess
        - responseText
      description: |
        Shape returned by every Payabli API error response. The `responseData`
        object carries human-readable error context.
      title: PayabliErrorBody

```

## Examples



**SDK Code**

```typescript
import { PayabliClient } from "@payabli/sdk-node";

async function main() {
    const client = new PayabliClient();
    await client.caseManagement.getAttachment("attachmentId", "caseUuid");
}
main();

```

```python
from payabli import payabli

client = payabli()

client.case_management.get_attachment(
    attachment_id="attachmentId",
    case_uuid="caseUuid",
)

```

```java
package com.example.usage;

import io.github.payabli.api.PayabliPayabliApiOasClient;

public class Example {
    public static void main(String[] args) {
        PayabliPayabliApiOasClient client = PayabliPayabliApiOasClient
            .builder()
            .build();

        client.caseManagement().getAttachment("caseUuid", "attachmentId");
    }
}
```

```csharp
using PayabliPayabliApiOas;
using System.Threading.Tasks;

namespace Usage;

public class Example
{
    public async Task Do() {
        var client = new PayabliPayabliApiOasClient();

        await client.CaseManagement.GetAttachmentAsync(
            "caseUuid",
            "attachmentId"
        );
    }

}

```

```go
package example

import (
    context "context"

    client "github.com/payabli/sdk-go/client"
)

func do() {
    client := client.NewClient()
    client.CaseManagement.GetAttachment(
        context.TODO(),
        "caseUuid",
        "attachmentId",
    )
}

```

```php
<?php

namespace Example;

use Payabli\PayabliClient;

$client = new PayabliClient();
$client->caseManagement->getAttachment(
    'attachmentId',
    'caseUuid',
);

```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api-sandbox.payabli.com/api/v2/cases/caseUuid/attachments/attachmentId")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
```

```swift
import Foundation

let request = NSMutableURLRequest(url: NSURL(string: "https://api-sandbox.payabli.com/api/v2/cases/caseUuid/attachments/attachmentId")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```