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

# Get Shortened URL by ID

> Get a URL Shortened by its urlCode

## Get Shortened URL by urlCode

Returns a single shortened URL. The path parameter is the `urlCode` (not a numeric database id). Requires scope `shortener:read`.

### HTTP Request

```http theme={null}
GET https://api-beta.lomadee.com.br/affiliate/shortener/urls/{urlCode}
```

### Response

```json theme={null}
{
  "data": {
    "originalUrl": "https://...",
    "shortUrl": "https://staging.lmdee.link/xWkSzD7vmsK8",
    "urlCode": "xWkSzD7vmsK8",
    "active": true,
    "linkType": "Offer"
  }
}
```

### Example

```bash theme={null}
curl -X GET "https://api-beta.lomadee.com.br/affiliate/shortener/urls/xWkSzD7vmsK8" \
  -H "x-api-key: your-api-key"
```


## OpenAPI

````yaml GET /affiliate/shortener/urls/{id}
openapi: 3.1.0
info:
  title: Lomadee Public API
  description: >-
    REST API for affiliate brands, channels, campaigns, orders, products, and
    link shortener. Authenticate with x-api-key. Rate limit: 60 req/60s per key
    and IP.
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.lomadee.com.br/
    description: Production — target URL for all integrations
  - url: https://api-beta.lomadee.com.br/
    description: Beta (legacy) — available during transition; will be retired soon
security:
  - x-api-key: []
paths:
  /affiliate/shortener/urls/{id}:
    get:
      description: Get a URL Shortened by its urlCode
      parameters:
        - name: id
          in: path
          required: true
          description: The urlCode of the shortened URL to retrieve
          schema:
            type: string
      responses:
        '200':
          description: Shorten URL response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ShortenURL'
          headers:
            X-RateLimit-Limit:
              description: Max requests per window
              schema:
                type: integer
            X-RateLimit-Remaining:
              description: Remaining requests in window
              schema:
                type: integer
            X-RateLimit-Reset:
              description: Unix timestamp when window resets
              schema:
                type: integer
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          description: URL not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          $ref: '#/components/responses/TooManyRequests'
components:
  schemas:
    ShortenURL:
      type: object
      properties:
        originalUrl:
          description: The original URL
          type: string
        shortUrl:
          description: The short URL
          type: string
        urlCode:
          description: The unique identifier for the shortened URL
          type: string
        organizationId:
          description: The organization ID
          type: string
        active:
          description: If the URL is active
          type: boolean
        count:
          description: The count of clicks of the URL
          type: number
        linkType:
          description: The link type
          type: string
          enum:
            - Coupon
            - BrandPage
            - Offer
    Error:
      required:
        - message
        - error
        - statusCode
      type: object
      properties:
        message:
          type: string
          description: Human-readable error message
        error:
          type: string
          description: Error type/category
        statusCode:
          type: integer
          format: int32
          description: HTTP status code
  responses:
    Unauthorized:
      description: API key missing or invalid
      content:
        application/json:
          schema:
            type: object
            properties:
              success:
                type: boolean
                example: false
              message:
                type: string
              code:
                type: string
    Forbidden:
      description: Valid key without required scope
      content:
        application/json:
          schema:
            type: object
            properties:
              success:
                type: boolean
                example: false
              message:
                type: string
              code:
                type: string
    TooManyRequests:
      description: Rate limit exceeded (60 req/60s per key + IP)
      headers:
        X-RateLimit-Limit:
          description: Max requests per window
          schema:
            type: integer
        X-RateLimit-Remaining:
          description: Remaining requests in window
          schema:
            type: integer
        X-RateLimit-Reset:
          description: Unix timestamp when window resets
          schema:
            type: integer
        Retry-After:
          description: Seconds until retry
          schema:
            type: integer
      content:
        application/json:
          schema:
            type: object
            properties:
              success:
                type: boolean
                example: false
              message:
                type: string
              code:
                type: string
  securitySchemes:
    x-api-key:
      type: apiKey
      in: header
      name: x-api-key

````