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

# Get Document URL

> Issues a fresh signed download URL for one document attached to a payer name, valid for 1 hour. The document must belong to that payer name and the payer name to your account; anything else answers `404`.

Issues a fresh signed download link for one document attached to a payer name.

Documents are stored privately. The `downloadUrl` returned inside a payer name expires **1 hour** after that response was generated, so a link you cached earlier will stop working — call this endpoint when you need a live one.

## Example Request

```bash theme={null}
curl "https://api.rolla.xyz/api/v1/external/payer-names/9f8e7d6c-5b4a-4938-8271-0a1b2c3d4e5f/documents/2b3c4d5e-6f70-4812-9a3b-4c5d6e7f8091/url" \
  -H "X-API-Key: your_api_key_here"
```

## Example Response

```json theme={null}
{
  "status": 200,
  "message": "Document URL generated",
  "success": true,
  "data": {
    "download_url": "https://files.rolla.xyz/payer_name_docs/...?token=..."
  }
}
```

The link is valid for 1 hour and grants access to whoever holds it — treat it like a credential and do not put it somewhere public.

<Note>
  `documentId` must be a document on that payer name, and the payer name must belong to your account. Anything else answers `404`.
</Note>


## OpenAPI

````yaml GET /payer-names/{payerNameId}/documents/{documentId}/url
openapi: 3.1.0
info:
  title: Rolla Developer API
  description: >-
    API for programmatic transaction management on the Rolla platform. Monetary
    `amount` fields use the smallest unit of the referenced currency unless an
    endpoint says otherwise (e.g. NGN = kobo, USD = cents, where **100 cents =
    USD 1.00**).
  version: 1.0.0
servers:
  - url: https://api.rolla.xyz/api/v1/external
    description: Production server
security:
  - apiKeyAuth: []
paths:
  /payer-names/{payerNameId}/documents/{documentId}/url:
    get:
      summary: Get Document URL
      description: >-
        Issues a fresh signed download URL for one document attached to a payer
        name, valid for 1 hour. The document must belong to that payer name and
        the payer name to your account; anything else answers `404`.
      operationId: getPayerNameDocumentUrl
      parameters:
        - name: payerNameId
          in: path
          required: true
          description: The payer name id.
          schema:
            type: string
            format: uuid
        - name: documentId
          in: path
          required: true
          description: The document id, as returned in `documents[].id`.
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: Document URL generated
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    description: HTTP status code, repeated in the body
                    example: 200
                  message:
                    type: string
                    example: Document URL generated
                  success:
                    type: boolean
                    example: true
                  data:
                    type: object
                    properties:
                      download_url:
                        type: string
                        description: >-
                          Signed URL, valid for 1 hour. It grants access to
                          whoever holds it.
                        example: https://files.rolla.xyz/payer_name_docs/...?token=...
              example:
                status: 200
                message: Document URL generated
                success: true
                data:
                  download_url: https://files.rolla.xyz/payer_name_docs/...?token=...
        '401':
          description: Unauthorized — invalid or missing API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Forbidden — Named Payouts are not enabled for this account
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                status: 403
                message: >-
                  Payer names are not enabled for this account. Contact your
                  Rolla account manager to turn them on.
                code: PAYER_NAMES_DISABLED
        '404':
          description: >-
            Not found — no such payer name on this account, no such document on
            it, or the stored file is no longer available
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                status: 404
                message: Document not found
components:
  schemas:
    Error:
      type: object
      required:
        - status
        - message
      description: >-
        Error envelope. Some errors add further top-level fields (for example
        `accountBlocked`, `provider`, `missingFields`); the endpoint documents
        them where they apply.
      additionalProperties: true
      properties:
        status:
          type: integer
          description: HTTP status code, repeated in the body as a number
          example: 400
        message:
          type: string
          description: Human-readable description of what went wrong
          example: Validation failed
        code:
          type: string
          description: >-
            Machine-readable error code, present on some errors only. See the
            Errors concept page for the taxonomy.
          example: ACCOUNT_RESTRICTED
        errors:
          type: array
          description: 'Present on `400` validation failures: one entry per offending field'
          items:
            type: object
            properties:
              path:
                type: array
                items:
                  type: string
                example:
                  - amount
              message:
                type: string
                example: >-
                  amount must be a whole number of smallest currency units (e.g.
                  cents)
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: Your Rolla API key

````