openapi: "3.1.1"
info:
  title: PicSee Short Link API Document
  version: ""
  description: |-
    This is the API documentation for the [PicSee URL Shortener](https://picsee.io). <br>
    PicSee offers <font class="plan">Free</font>, <font class="plan">Basic</font>, and <font class="plan">Advanced</font> Plans. For detailed information and documentation updates, please refer to the PicSee API official website: https://picsee.io/developers.

    - If you encounter issues while integrating, please use [Postman](https://www.postman.com/) to take screenshots, and provide your PicSee ID to PicSee customer support. Please <font color="red">DO NOT</font> share your code directly.
    - The API endpoint varies when upgrading to the "**Dedicated Host (獨立主機)**" or "**Fixed IP Server (固定 IP)**" plans. Don't hesitate to get in touch with PicSee for more details.
    
    <div class="card">
      <div class="card-left">
        <div>
          <div class="card-title">API Plans & Pricing</div>
          <div class="card-subtitle">(Free 800 requests / year)</div>
        </div>
      </div>
      <a href="https://picsee.io/developers#pricing" target="_blank" rel="noopener noreferrer" class="btn">
        View Plan 
        <svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
          <path d="M1.16669 11.0833V4.66666C1.16669 4.20253 1.35119 3.75754 1.67938 3.42935C2.00757 3.10116 2.45256 2.91666 2.91669 2.91666H6.41669C6.73885 2.91666 7.00002 3.17782 7.00002 3.49999C7.00002 3.82216 6.73885 4.08332 6.41669 4.08332H2.91669C2.76198 4.08332 2.61365 4.14483 2.50425 4.25422C2.39486 4.36362 2.33335 4.51195 2.33335 4.66666V11.0833C2.33335 11.238 2.39486 11.3864 2.50425 11.4958C2.61365 11.6052 2.76198 11.6667 2.91669 11.6667H9.33335C9.48806 11.6667 9.63639 11.6052 9.74579 11.4958C9.85518 11.3864 9.91669 11.238 9.91669 11.0833V7.58332C9.91669 7.26116 10.1779 6.99999 10.5 6.99999C10.8222 6.99999 11.0834 7.26116 11.0834 7.58332V11.0833C11.0834 11.5475 10.8988 11.9924 10.5707 12.3206C10.2425 12.6488 9.79748 12.8333 9.33335 12.8333H2.91669C2.45256 12.8333 2.00757 12.6488 1.67938 12.3206C1.35119 11.9924 1.16669 11.5475 1.16669 11.0833ZM12.8334 5.24999C12.8334 5.57216 12.5722 5.83332 12.25 5.83332C11.9279 5.83332 11.6667 5.57216 11.6667 5.24999V3.15819L6.24579 8.57909C6.01798 8.8069 5.64872 8.8069 5.42092 8.57909C5.19311 8.35129 5.19311 7.98203 5.42092 7.75422L10.8418 2.33332H8.75002C8.42785 2.33332 8.16669 2.07216 8.16669 1.74999C8.16669 1.42782 8.42785 1.16666 8.75002 1.16666H12.25C12.5722 1.16666 12.8334 1.42782 12.8334 1.74999V5.24999Z" fill="#0F172A"/>
        </svg>
      </a>
    </div>
  termsOfService: https://picsee.io/policy
  x-logo:
    url: 'https://wcdn.pse.im/website/picsee_basic_web.png'
    altText: PicSee logo
    href: "https://picsee.io/developers"
  contact:
    email: service@picsee.vip
    url: https://picsee.io

servers:
  - url: "https://api.pics.ee"
tags:
  - name: My Account
    description: Account-level endpoints — API plan & usage, domains, tags, tracking tools.
  - name: Short Links
    description: Create, list, edit, batch create, and delete short links.
  - name: Analytics
    description: Click analytics — overview, daily clicks, platform, referrer, country, and audience labels.
  - name: Authorized Security Partners Only
    description: Endpoints exclusively available to authorized security partners.
paths:
  /v2/my/api/status:
    get:
      summary: Get API Plans and Usage
      description: |-
        <div class="api-description">
        <strong>One call per second is allowed.</strong> If this limit is exceeded, a <code>status code 429</code> will be returned. A try-catch structure is recommended to retry.
        </div>
      tags:
        - My Account
      operationId: getApiStatus
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: object
                required:
                  - meta
                properties:
                  data:
                    $ref: '#/components/schemas/ApiStatus'
                  meta:
                    $ref: '#/components/schemas/Meta'
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - access_token: []
        - X-API-Key: []
        - BearerAuth: []
      x-codeSamples:
        - lang: "cURL"
          label: "cURL"
          source: |-
            curl -X 'GET' \
            'https://api.pics.ee/v2/my/api/status?access_token=YOUR_ACCESS_TOKEN' \
            -H 'accept: application/json'
        - lang: "JavaScript"
          label: "JavaScript (fetch)"
          source: |-
            const access_token = 'YOUR_ACCESS_TOKEN';
            const res = await fetch(`https://api.pics.ee/v2/my/api/status?access_token=${access_token}`, {
              method: 'GET',
              headers: {
                'accept': 'application/json',
              },
            })
            const data = await res.json();
            console.log(data);
        - lang: "Python"
          label: "Python (requests)"
          source: |-
            import requests

            url = 'https://api.pics.ee/v2/my/api/status'
            params = {
                'access_token': 'YOUR_ACCESS_TOKEN'
            }
            headers = {
                'accept': 'application/json'
            }

            response = requests.get(url, params=params, headers=headers)
            print(response.json())
  /v4/my/api/usage:
    get:
      summary: Get API Usage by externalId
      description: |-
        <div class="api-description">
          Returns the number of short links the caller has created via the API within the specified time range, broken down by `externalId`. Links created without an `externalId` are reported under `externalId: null`.

          <strong>One call per second</strong> is allowed. If exceeded, a <code>status code 429</code> will be returned. A try-catch structure is recommended to retry.

          The default time range is the last 30 days. A custom range may be specified with `startTime` / `endTime`, but the range <strong>must not exceed 31 days</strong>. Results are cached for 1 hour.
        </div>
      tags:
        - My Account
      operationId: getApiUsageByExternalId
      parameters:
        - name: startTime
          in: query
          required: false
          description: |-
            Start time of the query range (Taipei time, format `YYYY-MM-DDTHH:mm:ss`). Defaults to 30 days before `endTime`.
          schema:
            type: string
            example: "2026-04-20T00:00:00"
        - name: endTime
          in: query
          required: false
          description: |-
            End time of the query range (Taipei time, format `YYYY-MM-DDTHH:mm:ss`). Defaults to the current time, floored to the current hour. The range between `startTime` and `endTime` must not exceed 31 days.
          schema:
            type: string
            example: "2026-05-20T00:00:00"
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: object
                required:
                  - meta
                properties:
                  data:
                    type: object
                    properties:
                      startTime:
                        type: string
                        format: date-time
                        description: Resolved start time of the query range (Taipei time).
                        example: "2026-04-20 00:00:00"
                      endTime:
                        type: string
                        format: date-time
                        description: Resolved end time of the query range (Taipei time).
                        example: "2026-05-20 14:00:00"
                      total:
                        type: number
                        description: Total number of API-created short links within the time range.
                        example: 1234
                      externalIds:
                        type: array
                        description: "Per-externalId link count. Links created without an `externalId` are reported under `externalId: null`."
                        items:
                          type: object
                          properties:
                            externalId:
                              type: [string, "null"]
                              description: The `externalId` provided when the link was created. `null` indicates links created without an `externalId`.
                              example: "20231111_campaign"
                            count:
                              type: number
                              description: Number of short links created with this `externalId`.
                              example: 320
                  meta:
                    $ref: '#/components/schemas/Meta'
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - access_token: []
        - X-API-Key: []
        - BearerAuth: []
      x-codeSamples:
        - lang: "cURL"
          label: "cURL"
          source: |-
            curl -X 'GET' \
            'https://api.pics.ee/v4/my/api/usage?access_token=YOUR_ACCESS_TOKEN' \
            -H 'accept: application/json'
        - lang: "JavaScript"
          label: "JavaScript (fetch)"
          source: |-
            const access_token = 'YOUR_ACCESS_TOKEN';
            const res = await fetch(`https://api.pics.ee/v4/my/api/usage?access_token=${access_token}`, {
              method: 'GET',
              headers: {
                'accept': 'application/json'
              }
            });
            const data = await res.json();
            console.log(data);
        - lang: "Python"
          label: "Python (requests)"
          source: |-
            import requests

            url = 'https://api.pics.ee/v4/my/api/usage'
            params = {
                'access_token': 'YOUR_ACCESS_TOKEN'
            }
            headers = {
                'accept': 'application/json'
            }

            response = requests.get(url, params=params, headers=headers)
            print(response.json())
  /v4/my/api/domains:
    get:
      summary: Get Available Domains
      description: |-
        <div class="api-description">
          Returns the brand domains (BSDs), subdomains, and shared root domain available to the caller. Each entry indicates whether HTTPS is enabled and whether it is the account default. Useful for building a domain picker (e.g. the Chrome Extension) instead of asking the user to type a domain manually.

          <strong>One call per second</strong> is allowed. If exceeded, a <code>status code 429</code> will be returned. A try-catch structure is recommended to retry.

          Results are cached for 1 hour.
        </div>
      tags:
        - My Account
      operationId: getMyDomains
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: object
                required:
                  - meta
                properties:
                  data:
                    type: object
                    properties:
                      domains:
                        type: array
                        example:
                          - type: "bsd"
                            name: "go.example.com"
                            https: true
                            isDefault: false
                          - type: "subdomain"
                            name: "mysub.pse.is"
                            https: true
                            isDefault: true
                          - type: "regular"
                            name: "pse.is"
                            https: true
                            isDefault: false
                        items:
                          type: object
                          properties:
                            type:
                              type: string
                              enum: [bsd, subdomain, regular]
                              description: |-
                                Domain category:
                                - `bsd`: a brand short domain owned by the account
                                - `subdomain`: a PicSee subdomain (e.g. `mybrand.pse.is`)
                                - `regular`: the shared PicSee root domain (e.g. `pse.is`)
                              example: "bsd"
                            name:
                              type: string
                              description: Fully-qualified hostname.
                              example: "go.example.com"
                            https:
                              type: boolean
                              description: Whether HTTPS is enabled for this domain.
                              example: true
                            isDefault:
                              type: boolean
                              description: Whether this is the account's default domain. At most one entry will be `true`.
                              example: false
                  meta:
                    $ref: '#/components/schemas/Meta'
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - access_token: []
        - X-API-Key: []
        - BearerAuth: []
      x-codeSamples:
        - lang: "cURL"
          label: "cURL"
          source: |-
            curl -X 'GET' \
            'https://api.pics.ee/v4/my/api/domains?access_token=YOUR_ACCESS_TOKEN' \
            -H 'accept: application/json'
        - lang: "JavaScript"
          label: "JavaScript (fetch)"
          source: |-
            const access_token = 'YOUR_ACCESS_TOKEN';
            const res = await fetch(`https://api.pics.ee/v4/my/api/domains?access_token=${access_token}`, {
              method: 'GET',
              headers: {
                'accept': 'application/json'
              }
            });
            const data = await res.json();
            console.log(data);
        - lang: "Python"
          label: "Python (requests)"
          source: |-
            import requests

            url = 'https://api.pics.ee/v4/my/api/domains'
            params = {
                'access_token': 'YOUR_ACCESS_TOKEN'
            }
            headers = {
                'accept': 'application/json'
            }

            response = requests.get(url, params=params, headers=headers)
            print(response.json())
  /v4/my/api/tags:
    get:
      summary: Get Available Tags
      description: |-
        <div class="api-description">
          Returns the tags available to the caller (tag id + value), as previously created on this account. The returned tag IDs can be referenced in other endpoints; the values match the values accepted by `tags` in the create / edit link APIs.

          <strong>One call per second</strong> is allowed. If exceeded, a <code>status code 429</code> will be returned. A try-catch structure is recommended to retry.

          Results are cached for 1 hour.
        </div>
      tags:
        - My Account
      operationId: getMyTags
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: object
                required:
                  - meta
                properties:
                  data:
                    type: object
                    properties:
                      tags:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: number
                              description: Tag ID.
                              example: 123
                            value:
                              type: string
                              description: Tag value.
                              example: "promotion"
                  meta:
                    $ref: '#/components/schemas/Meta'
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - access_token: []
        - X-API-Key: []
        - BearerAuth: []
      x-codeSamples:
        - lang: "cURL"
          label: "cURL"
          source: |-
            curl -X 'GET' \
            'https://api.pics.ee/v4/my/api/tags?access_token=YOUR_ACCESS_TOKEN' \
            -H 'accept: application/json'
        - lang: "JavaScript"
          label: "JavaScript (fetch)"
          source: |-
            const access_token = 'YOUR_ACCESS_TOKEN';
            const res = await fetch(`https://api.pics.ee/v4/my/api/tags?access_token=${access_token}`, {
              method: 'GET',
              headers: {
                'accept': 'application/json'
              }
            });
            const data = await res.json();
            console.log(data);
        - lang: "Python"
          label: "Python (requests)"
          source: |-
            import requests

            url = 'https://api.pics.ee/v4/my/api/tags'
            params = {
                'access_token': 'YOUR_ACCESS_TOKEN'
            }
            headers = {
                'accept': 'application/json'
            }

            response = requests.get(url, params=params, headers=headers)
            print(response.json())
  /v4/my/api/trackingTools:
    get:
      summary: Get Available Tracking Tools
      description: |-
        <div class="api-description">
          Returns the tracking tools remembered on the account: UTM source / medium values previously used, plus saved Meta Pixels and Google Tag (GTM) configurations. Use this to populate dropdowns in tools that create PicSee links, so users can pick from prior values instead of retyping.

          <strong>One call per second</strong> is allowed. If exceeded, a <code>status code 429</code> will be returned. A try-catch structure is recommended to retry.

          Results are cached for 1 hour.
        </div>
      tags:
        - My Account
      operationId: getMyTrackingTools
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: object
                required:
                  - meta
                properties:
                  data:
                    type: object
                    properties:
                      utmSources:
                        type: array
                        description: Remembered `utm_source` values.
                        items:
                          type: object
                          properties:
                            id:
                              type: number
                              example: 1
                            value:
                              type: string
                              example: "facebook"
                      utmMediums:
                        type: array
                        description: Remembered `utm_medium` values.
                        items:
                          type: object
                          properties:
                            id:
                              type: number
                              example: 2
                            value:
                              type: string
                              example: "cpc"
                      fbPixels:
                        type: array
                        description: Saved Meta (Facebook) Pixels.
                        items:
                          type: object
                          properties:
                            id:
                              type: number
                              example: 3
                            value:
                              type: string
                              description: Meta Pixel ID.
                              example: "123456789012345"
                            name:
                              type: string
                              description: User-defined display name. Omitted when none was set.
                              example: "Main Pixel"
                      gTags:
                        type: array
                        description: Saved Google Tag (GTM) configurations.
                        items:
                          type: object
                          properties:
                            id:
                              type: number
                              example: 4
                            value:
                              type: string
                              description: GTM container ID.
                              example: "GTM-XXXXXXX"
                            name:
                              type: string
                              description: User-defined display name. Omitted when none was set.
                              example: "Main GTM"
                  meta:
                    $ref: '#/components/schemas/Meta'
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - access_token: []
        - X-API-Key: []
        - BearerAuth: []
      x-codeSamples:
        - lang: "cURL"
          label: "cURL"
          source: |-
            curl -X 'GET' \
            'https://api.pics.ee/v4/my/api/trackingTools?access_token=YOUR_ACCESS_TOKEN' \
            -H 'accept: application/json'
        - lang: "JavaScript"
          label: "JavaScript (fetch)"
          source: |-
            const access_token = 'YOUR_ACCESS_TOKEN';
            const res = await fetch(`https://api.pics.ee/v4/my/api/trackingTools?access_token=${access_token}`, {
              method: 'GET',
              headers: {
                'accept': 'application/json'
              }
            });
            const data = await res.json();
            console.log(data);
        - lang: "Python"
          label: "Python (requests)"
          source: |-
            import requests

            url = 'https://api.pics.ee/v4/my/api/trackingTools'
            params = {
                'access_token': 'YOUR_ACCESS_TOKEN'
            }
            headers = {
                'accept': 'application/json'
            }

            response = requests.get(url, params=params, headers=headers)
            print(response.json())
  /v1/links:
    post:
      summary: Create a Short Link
      description: |-
        <div class="api-description">
        As long as the request is within the <a href="https://picsee.io/developers">plan's rate limit</a>, <strong>you do not need to wait for the response and can make concurrent calls.</strong> If the rate limit is exceeded, a <code>status code 429</code> will be returned. A try-catch structure is recommended to retry.

        💡 Once a Short Link is created or edited, it can be used immediately. However, due to the cache design, it may take up to 10 minutes to appear in the "Batch Records" on the PicSee website or the [Short Link List](#operation/getLinksOverview) via the API.
        </div>
      tags:
        - Short Links
      operationId: createShortLink
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Link'
            examples:
              createShortLink:
                summary: Create a Short Link
                value:
                  url: "https://picsee.io"
              all_parameters:
                summary: Create a Short Link with all parameters
                value:
                  url: "https://picsee.io"
                  encodeId: "5b93x9"
                  domain: "pse.is"
                  externalId: "20231111_campaign"
                  title: "PicSee URL Shortener"
                  description: "URL Shortener, QR Code…"
                  imageUrl: "https://wcdn.pse.im/website/picsee_v3_og.png"
                  tags: ["event1", "中文", "1111"]
                  targets:
                    - target: ios_android
                      url: "https://picsee.io/"
                    - target: pc_mac
                      url: "https://picsee.io/pricing"
                  fbPixel: "1234567"
                  gTag: GTM-XXXXXXX
                  utm:
                    source: facebook
                    medium: social
                    campaign: "2024"
                    term: "0112"
                    content: UTM
                  pathFormat:
                    key: utm_source
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: object
                required:
                  - meta
                properties:
                  data:
                    type: object
                    properties:
                      picseeUrl:
                        type: string
                        description: The short link
                        example: "https://pse.is/5b93x9"
                  meta:
                    $ref: '#/components/schemas/Meta'
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - access_token: []
        - X-API-Key: []
        - BearerAuth: []
      x-codeSamples:
        - lang: "cURL"
          label: "cURL"
          source: |-
            curl -X 'POST' \
            'https://api.pics.ee/v1/links?access_token=YOUR_ACCESS_TOKEN' \
            -H 'Content-Type: application/json' \
            -d '{
              "url": "https://picsee.io"
            }'
        - lang: "JavaScript"
          label: "JavaScript (fetch)"
          source: |-
            const access_token = 'YOUR_ACCESS_TOKEN';
            const res = await fetch(`https://api.pics.ee/v1/links?access_token=${access_token}`, {
              method: 'POST',
              headers: {
                'Content-Type': 'application/json'
              },
              body: JSON.stringify({
                url: "https://picsee.io"
              })
            })
            const data = await res.json();
            console.log(data);
        - lang: "Python"
          label: "Python (requests)"
          source: |-
            import requests

            url = 'https://api.pics.ee/v1/links'
            params = {
                'access_token': 'YOUR_ACCESS_TOKEN'
            }
            data = {
                'url': 'https://picsee.io'
            }

            response = requests.post(url, params=params, json=data)
            print(response.json())
  /v2/links/overview:
    post:
      summary: List of Short Links
      description: |-
        <div class="api-description">
          <strong>One call per second</strong> is allowed. If this limit is exceeded, a <code>status code 429</code> will be returned. A try-catch structure is recommended to retry.
        </div>
      tags:
        - Short Links
      operationId: getLinksOverview
      parameters:
        - name: limit
          in: query
          description: |-
            Short links displayed per list, defaulting to 20, with an optional maximum of 50.
          schema:
            type: number
            example: 20
        - name: startTime
          in: query
          description: |-
            Set the start time for listing short links, queried in descending order from the specified time backward, defaulting to the current time.
          schema:
            type: string
            example: 2023-11-20T13:00:00
        - name: prevMapId
          in: query
          description: |-
            Retrieve the list of short links older than this mapId. When both startTime and prevMapId are specified, they will be queried using an AND condition.
          schema:
            type: number
            example: 22198535
        - name: isAPI
          in: query
          description: |-
            Query only API-generated short links: `true` for yes, `false` for no (only non-API-generated links). The default is `true`.
          schema:
            type: boolean
            example: true
        - name: isStar
          in: query
          description: |-
            Query only starred short links: `true` for yes, `false` for no (only non-starred links). The default is `false`.
          schema:
            type: boolean
            example: false
        - name: externalId
          in: query
          description: |-
            Query short links containing a specific externalId.
          schema:
            type: string
            example: 20231111_campaign
      requestBody:
        required: false
        description: |-
          #### Search Parameters <font class="plan">(Advanced Plan)</font>

          When multiple search parameters are provided, higher priority parameters take precedence and lower priority ones are ignored. Priority order (highest to lowest): `encodeId` > `authorId` > `tag` > `keyword`.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LinksSearchParams'
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: object
                required:
                  - meta
                properties:
                  data:
                    $ref: '#/components/schemas/Links'
                  meta:
                    $ref: '#/components/schemas/Meta'
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - access_token: []
        - X-API-Key: []
        - BearerAuth: []
      x-codeSamples:
        - lang: "cURL"
          label: "cURL"
          source: |-
            curl -X 'POST' \
            'https://api.pics.ee/v2/links/overview?access_token=YOUR_ACCESS_TOKEN' \
            -H 'Content-Type: application/json'
        - lang: "JavaScript"
          label: "JavaScript (fetch)"
          source: |-
            const access_token = 'YOUR_ACCESS_TOKEN';
            const res = await fetch(`https://api.pics.ee/v2/links/overview?access_token=${access_token}`, {
              method: 'POST',
              headers: {
                'Content-Type': 'application/json'
              }
            });
            const data = await res.json();
            console.log(data);
        - lang: "Python"
          label: "Python (requests)"
          source: |-
            import requests

            url = 'https://api.pics.ee/v2/links/overview'
            params = {
              'access_token': access_token
            }
            response = requests.post(url, headers={'Content-Type': 'application/json'}, json=params)
            data = response.json()
            print(data)
  /v2/links/{encodeId}:
    put:
      summary: Edit a Short link
      description: |-
        <div class="api-description">
          <strong>This API is exclusive to <font class="plan">Advanced</font> Plan users.</strong>

          <strong>One call per second</strong> is allowed. If this limit is exceeded, a <code>status code 429</code> will be returned. A try-catch structure is recommended to retry.

          💡 Once a Short Link is created or edited, it can be used immediately. However, due to the cache design, it may take up to 10 minutes to appear in the "Batch Records" on the PicSee website or the [Short Link List](#operation/getLinksOverview) and [Short Link Analytics](#operation/getLinkAnalytics) via the API.
        </div>
      tags:
        - Short Links
      operationId: editShortLink
      parameters:
        - name: encodeId
          in: path
          required: true
          description: The slug of the short link
          schema:
            type: string
            example: "5b93x9"
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LinkEditRequest'
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: object
                required:
                  - meta
                properties:
                  data:
                    type: object
                    properties:
                      result:
                        type: string
                        description: If successful, the response will always return `success`
                        example: success
                  meta:
                    $ref: '#/components/schemas/Meta'
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - access_token: []
        - X-API-Key: []
        - BearerAuth: []
      x-codeSamples:
        - lang: "cURL"
          label: "cURL"
          source: |-
            curl -X 'PUT' \
            'https://api.pics.ee/v2/links/5b93x9?access_token=YOUR_ACCESS_TOKEN' \
            -H 'Content-Type: application/json' \
            -d '{
              "title": "New Title",
              "description": "Updated description"
            }'
        - lang: "JavaScript"
          label: "JavaScript (fetch)"
          source: |-
            const encodeId = '5b93x9';
            const access_token = 'YOUR_ACCESS_TOKEN';
            const res = await fetch(`https://api.pics.ee/v2/links/${encodeId}?access_token=${access_token}`, {
              method: 'PUT',
              headers: {
                'Content-Type': 'application/json'
              },
              body: JSON.stringify({
                title: "New Title",
                description: "Updated description"
              })
            });
            const data = await res.json();
            console.log(data);
        - lang: "Python"
          label: "Python (requests)"
          source: |-
            import requests

            encode_id = '5b93x9'
            url = f'https://api.pics.ee/v2/links/{encode_id}'
            params = {
                'access_token': 'YOUR_ACCESS_TOKEN'
            }
            data = {
                'title': 'New Title',
                'description': 'Updated description'
            }

            response = requests.put(url, params=params, json=data)
            print(response.json())
  /v2/links/batch:
    post:
      summary: Batch Create Short Links
      description: |-
        <div class="api-description">
          <strong>This API is exclusive to <font class="plan">Advanced</font> Plan users.</strong>

          You must <strong>wait for the response</strong> from the current call before making another request.

          💡 Once a Short Link is created or edited, it can be used immediately. However, due to the cache design, it may take up to 10 minutes to appear in the "Batch Records" on the PicSee website or the [Short Link List](#operation/getLinksOverview) and [Short Link Analytics](#operation/getLinkAnalytics) via the API.
        </div>
      tags:
        - Short Links
      operationId: batchCreateShortLinks
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - urls
              properties:
                urls:
                  type: array
                  items:
                    type: string
                    format: uri
                    description: Allows batch creation of 1 to 100 short URLs.
                    example: https://picsee.io
                domain:
                  type: string
                  description: Specify the Short Link domain. If omitted or invalid, the default domain will be applied.
                  example: pse.is
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: object
                required:
                  - meta
                properties:
                  data:
                    type: object
                    properties:
                      links:
                        type: array
                        items:
                          type: object
                          properties:
                            originalLink:
                              type: string
                              format: uri
                              description: The original URL to be shortened.
                              example: https://picsee.io
                            picseeLink:
                              type: string
                              format: uri
                              description: The generated PicSee short link.
                              example: https://pse.is/free_api
                  meta:
                    $ref: '#/components/schemas/Meta'
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - access_token: []
        - X-API-Key: []
        - BearerAuth: []
      x-codeSamples:
        - lang: "cURL"
          label: "cURL"
          source: |-
            curl -X 'POST' \
            'https://api.pics.ee/v2/links/batch?access_token=YOUR_ACCESS_TOKEN' \
            -H 'Content-Type: application/json' \
            -d '{
              "urls": [
                "https://picsee.io"
              ]
            }'
        - lang: "JavaScript"
          label: "JavaScript (fetch)"
          source: |-
            const access_token = 'YOUR_ACCESS_TOKEN';
            const res = await fetch(`https://api.pics.ee/v2/links/batch?access_token=${access_token}`, {
              method: 'POST',
              headers: {
                'Content-Type': 'application/json'
              },
              body: JSON.stringify({
                urls: [
                  "https://picsee.io"
                ]
              })
            });
            const data = await res.json();
            console.log(data);
        - lang: "Python"
          label: "Python (requests)"
          source: |-
            import requests

            url = 'https://api.pics.ee/v2/links/batch'
            params = {
                'access_token': 'YOUR_ACCESS_TOKEN'
            }
            data = {
                'urls': [
                    'https://picsee.io'
                ]
            }

            response = requests.post(url, params=params, json=data)
            print(response.json())
  /v2/links/{encodeId}/delete:
    post:
      summary: Delete or Recover a Short Link
      description: |-
        <div class="api-description">
          <strong>One call per second</strong> is allowed. If this limit is exceeded, a <code>status code 429</code> will be returned. A try-catch structure is recommended to retry.
        </div>
      tags:
        - Short Links
      operationId: deleteOrRecoverShortLink
      parameters:
        - name: encodeId
          in: path
          required: true
          description: The short link slug to be deleted or recovered.
          schema:
            type: string
            example: "5b93x9"
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - value
              properties:
                value:
                  type: string
                  description: |-
                    `delete`: Moves the link to the trash bin.
                    `recover`: Restores the link from the trash bin.
                  enum: [delete, recover]
                  example: delete
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: object
                required:
                  - meta
                properties:
                  data:
                    type: object
                    properties:
                      result:
                        type: string
                        description: If successful, the response will always return `success`
                        example: success
                  meta:
                    $ref: '#/components/schemas/Meta'
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - access_token: []
        - X-API-Key: []
        - BearerAuth: []
      x-codeSamples:
        - lang: "cURL"
          label: "cURL"
          source: |-
            curl -X 'POST' \
            'https://api.pics.ee/v2/links/5b93x9/delete?access_token=YOUR_ACCESS_TOKEN' \
            -H 'Content-Type: application/json' \
            -d '{
              "value": "delete"
            }'
        - lang: "JavaScript"
          label: "JavaScript (fetch)"
          source: |-
            const encodeId = '5b93x9';
            const access_token = 'YOUR_ACCESS_TOKEN';
            const res = await fetch(`https://api.pics.ee/v2/links/${encodeId}/delete?access_token=${access_token}`, {
              method: 'POST',
              headers: {
                'Content-Type': 'application/json'
              },
              body: JSON.stringify({
                value: 'delete'
              })
            });
            const data = await res.json();
            console.log(data);
        - lang: "Python"
          label: "Python (requests)"
          source: |-
            import requests

            encode_id = '5b93x9'
            url = f'https://api.pics.ee/v2/links/{encode_id}/delete'
            params = {
                'access_token': 'YOUR_ACCESS_TOKEN'
            }
            data = {
                'value': 'delete'
            }

            response = requests.post(url, params=params, json=data)
            print(response.json())
  /v1/links/{encodeId}/overview:
    get:
      summary: Get Short Link Analytics
      description: |-
        <div class="api-description">
          There is no call frequency limit; however, <strong>the content update frequency may vary depending on the <a href="https://picsee.io/developers">plan</a>.</strong>
        </div>
      tags:
        - Analytics
      operationId: getLinkAnalytics
      parameters:
        - name: encodeId
          in: path
          required: true
          description: The slug of the short link
          schema:
            type: string
            example: "5b93x9"
        - name: format
          in: query
          description: |-
            Supported return formats include "json" and "csv". If left blank, the default is "json".
          schema:
            type: string
            enum: ["json", "csv"]
            example: "csv"
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: object
                required:
                  - meta
                properties:
                  data:
                    $ref: '#/components/schemas/LinkAnalytics'
                  meta:
                    $ref: '#/components/schemas/Meta'
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - access_token: []
        - X-API-Key: []
        - BearerAuth: []
      x-codeSamples:
        - lang: "cURL"
          label: "cURL"
          source: |-
            curl -X 'GET' \
            'https://api.pics.ee/v1/links/5b93x9/overview?access_token=YOUR_ACCESS_TOKEN' \
            -H 'accept: application/json'
        - lang: "JavaScript"
          label: "JavaScript (fetch)"
          source: |-
            const encodeId = '5b93x9';
            const access_token = 'YOUR_ACCESS_TOKEN';
            const res = await fetch(`https://api.pics.ee/v1/links/${encodeId}/overview?access_token=${access_token}`, {
              method: 'GET',
              headers: {
                'accept': 'application/json'
              }
            })
            const data = await res.json();
            console.log(data);
        - lang: "Python"
          label: "Python (requests)"
          source: |-
            import requests

            encode_id = '5b93x9'
            url = f'https://api.pics.ee/v1/links/{encode_id}/overview'
            params = {
                'access_token': 'YOUR_ACCESS_TOKEN'
            }
            headers = {
              'accept': 'application/json'
            }

            response = requests.get(url, params=params, headers=headers)
            print(response.json())
  /v4/links/{encodeId}/details/dailyClicks:
    get:
      summary: Get Daily Clicks
      description: |-
        <div class="api-description">
          Returns total clicks and unique clicks aggregated by day within the specified time range.

          <strong>10 calls per second</strong> are allowed for <font class="plan">Advanced</font> plan users; <strong>1 call per second</strong> for other plans. If exceeded, a <code>status code 429</code> will be returned. A try-catch structure is recommended to retry.

          The default time range is the last 30 days. The maximum lookback is <strong>365 days</strong> for <font class="plan">Advanced</font> plan users and <strong>30 days</strong> for other plans. Results are cached for 10 minutes (Advanced) or 1 hour (other plans).
        </div>
      tags:
        - Analytics
      operationId: getLinkDailyClicks
      parameters:
        - name: encodeId
          in: path
          required: true
          description: The slug of the short link
          schema:
            type: string
            example: "5b93x9"
        - name: startTime
          in: query
          required: false
          description: |-
            Start time of the query range (Taipei time, format `YYYY-MM-DDTHH:mm:ss`). Defaults to 30 days before `endTime`.
          schema:
            type: string
            example: "2026-04-20T00:00:00"
        - name: endTime
          in: query
          required: false
          description: |-
            End time of the query range (Taipei time, format `YYYY-MM-DDTHH:mm:ss`). Defaults to the current time, floored to the cache bucket (10-minute bucket for Advanced, hour bucket for other plans).
          schema:
            type: string
            example: "2026-05-20T00:00:00"
        - name: format
          in: query
          required: false
          description: |-
            Supported return formats include "json" and "csv". If left blank, the default is "json". When `csv` is specified, the response returns a CSV file with columns: `date, totalClicks, uniqueClicks`.
          schema:
            type: string
            enum: ["json", "csv"]
            example: "csv"
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: object
                required:
                  - meta
                properties:
                  data:
                    type: object
                    properties:
                      encodeId:
                        type: string
                        description: The slug of the short link.
                        example: "5b93x9"
                      startTime:
                        type: string
                        format: date-time
                        description: Resolved start time of the query range (Taipei time).
                        example: "2026-04-20 00:00:00"
                      endTime:
                        type: string
                        format: date-time
                        description: Resolved end time of the query range (Taipei time).
                        example: "2026-05-20 14:00:00"
                      dailyClicks:
                        type: array
                        description: Daily click counts (Taipei time), sorted ascending by date. Days with zero clicks may be omitted.
                        items:
                          type: object
                          properties:
                            date:
                              type: string
                              format: date
                              description: Click date.
                              example: "2026-05-19"
                            totalClicks:
                              type: number
                              description: Total clicks on this date.
                              example: 42
                            uniqueClicks:
                              type: number
                              description: Unique clicks on this date.
                              example: 31
                  meta:
                    $ref: '#/components/schemas/Meta'
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - access_token: []
        - X-API-Key: []
        - BearerAuth: []
      x-codeSamples:
        - lang: "cURL"
          label: "cURL"
          source: |-
            curl -X 'GET' \
            'https://api.pics.ee/v4/links/5b93x9/details/dailyClicks?access_token=YOUR_ACCESS_TOKEN' \
            -H 'accept: application/json'
        - lang: "JavaScript"
          label: "JavaScript (fetch)"
          source: |-
            const encodeId = '5b93x9';
            const access_token = 'YOUR_ACCESS_TOKEN';
            const res = await fetch(`https://api.pics.ee/v4/links/${encodeId}/details/dailyClicks?access_token=${access_token}`, {
              method: 'GET',
              headers: {
                'accept': 'application/json'
              }
            });
            const data = await res.json();
            console.log(data);
        - lang: "Python"
          label: "Python (requests)"
          source: |-
            import requests

            encode_id = '5b93x9'
            url = f'https://api.pics.ee/v4/links/{encode_id}/details/dailyClicks'
            params = {
                'access_token': 'YOUR_ACCESS_TOKEN'
            }
            headers = {
                'accept': 'application/json'
            }

            response = requests.get(url, params=params, headers=headers)
            print(response.json())
  /v4/links/{encodeId}/details/platform:
    get:
      summary: Get Click Distribution by Device
      description: |-
        <div class="api-description">
          Returns unique click counts broken down by device (e.g. `iphone`, `ipad`, `android`, `windows`, `macintosh`, ...) within the specified time range. Devices are returned individually without being grouped into "mobile" / "desktop" buckets — callers can aggregate as needed.

          <strong>10 calls per second</strong> are allowed for <font class="plan">Advanced</font> plan users; <strong>1 call per second</strong> for other plans. If exceeded, a <code>status code 429</code> will be returned. A try-catch structure is recommended to retry.

          The default time range is the last 30 days. The maximum lookback is <strong>365 days</strong> for <font class="plan">Advanced</font> plan users and <strong>30 days</strong> for other plans. Results are cached for 10 minutes (Advanced) or 1 hour (other plans).
        </div>
      tags:
        - Analytics
      operationId: getLinkPlatformDistribution
      parameters:
        - name: encodeId
          in: path
          required: true
          description: The slug of the short link
          schema:
            type: string
            example: "5b93x9"
        - name: startTime
          in: query
          required: false
          description: |-
            Start time of the query range (Taipei time, format `YYYY-MM-DDTHH:mm:ss`). Defaults to 30 days before `endTime`.
          schema:
            type: string
            example: "2026-04-20T00:00:00"
        - name: endTime
          in: query
          required: false
          description: |-
            End time of the query range (Taipei time, format `YYYY-MM-DDTHH:mm:ss`). Defaults to the current time, floored to the cache bucket.
          schema:
            type: string
            example: "2026-05-20T00:00:00"
        - name: format
          in: query
          required: false
          description: |-
            Supported return formats include "json" and "csv". If left blank, the default is "json". When `csv` is specified, the response returns a CSV file with columns: `platform, count`.
          schema:
            type: string
            enum: ["json", "csv"]
            example: "csv"
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: object
                required:
                  - meta
                properties:
                  data:
                    type: object
                    properties:
                      encodeId:
                        type: string
                        description: The slug of the short link.
                        example: "5b93x9"
                      startTime:
                        type: string
                        format: date-time
                        example: "2026-04-20 00:00:00"
                      endTime:
                        type: string
                        format: date-time
                        example: "2026-05-20 14:00:00"
                      platforms:
                        type: array
                        description: Per-device unique click counts, sorted by count descending.
                        items:
                          type: object
                          properties:
                            platform:
                              type: string
                              description: Device label (e.g. `iphone`, `ipad`, `android`, `windows`, `macintosh`).
                              example: iphone
                            count:
                              type: number
                              description: Unique click count for this device.
                              example: 153
                  meta:
                    $ref: '#/components/schemas/Meta'
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - access_token: []
        - X-API-Key: []
        - BearerAuth: []
      x-codeSamples:
        - lang: "cURL"
          label: "cURL"
          source: |-
            curl -X 'GET' \
            'https://api.pics.ee/v4/links/5b93x9/details/platform?access_token=YOUR_ACCESS_TOKEN' \
            -H 'accept: application/json'
        - lang: "JavaScript"
          label: "JavaScript (fetch)"
          source: |-
            const encodeId = '5b93x9';
            const access_token = 'YOUR_ACCESS_TOKEN';
            const res = await fetch(`https://api.pics.ee/v4/links/${encodeId}/details/platform?access_token=${access_token}`, {
              method: 'GET',
              headers: {
                'accept': 'application/json'
              }
            });
            const data = await res.json();
            console.log(data);
        - lang: "Python"
          label: "Python (requests)"
          source: |-
            import requests

            encode_id = '5b93x9'
            url = f'https://api.pics.ee/v4/links/{encode_id}/details/platform'
            params = {
                'access_token': 'YOUR_ACCESS_TOKEN'
            }
            headers = {
                'accept': 'application/json'
            }

            response = requests.get(url, params=params, headers=headers)
            print(response.json())
  /v4/links/{encodeId}/details/referrers:
    get:
      summary: Get Click Distribution by Referrer
      description: |-
        <div class="api-description">
          Returns unique click counts broken down by traffic source (e.g. specific AI Agents, search engines, social platforms, long-tail referrers) within the specified time range. Referrers are returned individually without being collapsed into "AI Agent" or "Others" buckets. Clicks without a referrer are reported as `direct`.

          <strong>10 calls per second</strong> are allowed for <font class="plan">Advanced</font> plan users; <strong>1 call per second</strong> for other plans. If exceeded, a <code>status code 429</code> will be returned. A try-catch structure is recommended to retry.

          The default time range is the last 30 days. The maximum lookback is <strong>365 days</strong> for <font class="plan">Advanced</font> plan users and <strong>30 days</strong> for other plans. Results are cached for 10 minutes (Advanced) or 1 hour (other plans).
        </div>
      tags:
        - Analytics
      operationId: getLinkReferrers
      parameters:
        - name: encodeId
          in: path
          required: true
          description: The slug of the short link
          schema:
            type: string
            example: "5b93x9"
        - name: startTime
          in: query
          required: false
          description: |-
            Start time of the query range (Taipei time, format `YYYY-MM-DDTHH:mm:ss`). Defaults to 30 days before `endTime`.
          schema:
            type: string
            example: "2026-04-20T00:00:00"
        - name: endTime
          in: query
          required: false
          description: |-
            End time of the query range (Taipei time, format `YYYY-MM-DDTHH:mm:ss`). Defaults to the current time, floored to the cache bucket.
          schema:
            type: string
            example: "2026-05-20T00:00:00"
        - name: format
          in: query
          required: false
          description: |-
            Supported return formats include "json" and "csv". If left blank, the default is "json". When `csv` is specified, the response returns a CSV file with columns: `referer, count`.
          schema:
            type: string
            enum: ["json", "csv"]
            example: "csv"
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: object
                required:
                  - meta
                properties:
                  data:
                    type: object
                    properties:
                      encodeId:
                        type: string
                        description: The slug of the short link.
                        example: "5b93x9"
                      startTime:
                        type: string
                        format: date-time
                        example: "2026-04-20 00:00:00"
                      endTime:
                        type: string
                        format: date-time
                        example: "2026-05-20 14:00:00"
                      referrers:
                        type: array
                        description: Per-referrer unique click counts, sorted by count descending.
                        items:
                          type: object
                          properties:
                            referer:
                              type: string
                              description: The referrer label. Clicks with no referrer information are reported as `direct`.
                              example: "google.com"
                            count:
                              type: number
                              description: Unique click count from this referrer.
                              example: 87
                  meta:
                    $ref: '#/components/schemas/Meta'
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - access_token: []
        - X-API-Key: []
        - BearerAuth: []
      x-codeSamples:
        - lang: "cURL"
          label: "cURL"
          source: |-
            curl -X 'GET' \
            'https://api.pics.ee/v4/links/5b93x9/details/referrers?access_token=YOUR_ACCESS_TOKEN' \
            -H 'accept: application/json'
        - lang: "JavaScript"
          label: "JavaScript (fetch)"
          source: |-
            const encodeId = '5b93x9';
            const access_token = 'YOUR_ACCESS_TOKEN';
            const res = await fetch(`https://api.pics.ee/v4/links/${encodeId}/details/referrers?access_token=${access_token}`, {
              method: 'GET',
              headers: {
                'accept': 'application/json'
              }
            });
            const data = await res.json();
            console.log(data);
        - lang: "Python"
          label: "Python (requests)"
          source: |-
            import requests

            encode_id = '5b93x9'
            url = f'https://api.pics.ee/v4/links/{encode_id}/details/referrers'
            params = {
                'access_token': 'YOUR_ACCESS_TOKEN'
            }
            headers = {
                'accept': 'application/json'
            }

            response = requests.get(url, params=params, headers=headers)
            print(response.json())
  /v4/links/{encodeId}/details/regions:
    get:
      summary: Get Click Distribution by Country
      description: |-
        <div class="api-description">
          Returns unique click counts broken down by country within the specified time range. Results are aggregated at country granularity only — no city-level breakdown. Clicks from unknown countries are bucketed as `Others`.

          <strong>10 calls per second</strong> are allowed for <font class="plan">Advanced</font> plan users; <strong>1 call per second</strong> for other plans. If exceeded, a <code>status code 429</code> will be returned. A try-catch structure is recommended to retry.

          The default time range is the last 30 days. The maximum lookback is <strong>365 days</strong> for <font class="plan">Advanced</font> plan users and <strong>30 days</strong> for other plans. Results are cached for 10 minutes (Advanced) or 1 hour (other plans).
        </div>
      tags:
        - Analytics
      operationId: getLinkRegions
      parameters:
        - name: encodeId
          in: path
          required: true
          description: The slug of the short link
          schema:
            type: string
            example: "5b93x9"
        - name: startTime
          in: query
          required: false
          description: |-
            Start time of the query range (Taipei time, format `YYYY-MM-DDTHH:mm:ss`). Defaults to 30 days before `endTime`.
          schema:
            type: string
            example: "2026-04-20T00:00:00"
        - name: endTime
          in: query
          required: false
          description: |-
            End time of the query range (Taipei time, format `YYYY-MM-DDTHH:mm:ss`). Defaults to the current time, floored to the cache bucket.
          schema:
            type: string
            example: "2026-05-20T00:00:00"
        - name: format
          in: query
          required: false
          description: |-
            Supported return formats include "json" and "csv". If left blank, the default is "json". When `csv` is specified, the response returns a CSV file with columns: `name, code, count`.
          schema:
            type: string
            enum: ["json", "csv"]
            example: "csv"
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: object
                required:
                  - meta
                properties:
                  data:
                    type: object
                    properties:
                      encodeId:
                        type: string
                        description: The slug of the short link.
                        example: "5b93x9"
                      startTime:
                        type: string
                        format: date-time
                        example: "2026-04-20 00:00:00"
                      endTime:
                        type: string
                        format: date-time
                        example: "2026-05-20 14:00:00"
                      regions:
                        type: array
                        description: Per-country unique click counts. Unknown countries are bucketed as `Others`.
                        items:
                          type: object
                          properties:
                            name:
                              type: string
                              description: English country name (e.g. `Taiwan`, `Japan`). Unknown countries are reported as `Others`.
                              example: "Taiwan"
                            code:
                              type: string
                              description: Lower-case ISO 3166-1 alpha-2 country code. Unknown countries are reported as `others`.
                              example: "tw"
                            count:
                              type: number
                              description: Unique click count from this country.
                              example: 215
                  meta:
                    $ref: '#/components/schemas/Meta'
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - access_token: []
        - X-API-Key: []
        - BearerAuth: []
      x-codeSamples:
        - lang: "cURL"
          label: "cURL"
          source: |-
            curl -X 'GET' \
            'https://api.pics.ee/v4/links/5b93x9/details/regions?access_token=YOUR_ACCESS_TOKEN' \
            -H 'accept: application/json'
        - lang: "JavaScript"
          label: "JavaScript (fetch)"
          source: |-
            const encodeId = '5b93x9';
            const access_token = 'YOUR_ACCESS_TOKEN';
            const res = await fetch(`https://api.pics.ee/v4/links/${encodeId}/details/regions?access_token=${access_token}`, {
              method: 'GET',
              headers: {
                'accept': 'application/json'
              }
            });
            const data = await res.json();
            console.log(data);
        - lang: "Python"
          label: "Python (requests)"
          source: |-
            import requests

            encode_id = '5b93x9'
            url = f'https://api.pics.ee/v4/links/{encode_id}/details/regions'
            params = {
                'access_token': 'YOUR_ACCESS_TOKEN'
            }
            headers = {
                'accept': 'application/json'
            }

            response = requests.get(url, params=params, headers=headers)
            print(response.json())
  /v4/links/{encodeId}/details/audienceLabels:
    get:
      summary: Get Audience Labels
      description: |-
        <div class="api-description">
          Returns the audience labels of a short link, split into two groups: <strong>interest</strong> and <strong>brand</strong>. All labels are returned (no truncation).

          <strong>This API is exclusive to <font class="plan">Advanced</font> Plan users.</strong>

          <strong>Privacy guard:</strong> to avoid identifying individuals when sample sizes are small, results are only returned when the link's lifetime <strong>unique click count is greater than 100</strong>. Otherwise, `interest` and `brand` will be returned as empty arrays.

          <strong>Interest labels</strong> are returned as label IDs with audience counts. Refer to the <a href="https://docs.google.com/spreadsheets/d/1KU_klYkh9UgWN2St7w9ftRJYWe-U4VMg6MoKthhYGSQ/edit?gid=0#gid=0" target="_blank" rel="noopener noreferrer">interest label ID reference sheet</a> for the human-readable label name of each ID.

          <strong>Brand labels</strong> are returned as brand names with audience counts, reported in uppercase (e.g. `PICSEE`).

          <strong>10 calls per second</strong> are allowed. If exceeded, a <code>status code 429</code> will be returned. A try-catch structure is recommended to retry. Results are cached for 10 minutes.
        </div>
      tags:
        - Analytics
      operationId: getLinkAudienceLabels
      parameters:
        - name: encodeId
          in: path
          required: true
          description: The slug of the short link
          schema:
            type: string
            example: "5b93x9"
        - name: format
          in: query
          required: false
          description: |-
            Supported return formats include "json" and "csv". If left blank, the default is "json". When `csv` is specified, interest and brand labels are merged into a single file with columns: `type, label, count`, where `type` is either `interest` or `brand`.
          schema:
            type: string
            enum: ["json", "csv"]
            example: "csv"
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: object
                required:
                  - meta
                properties:
                  data:
                    type: object
                    properties:
                      encodeId:
                        type: string
                        description: The slug of the short link.
                        example: "5b93x9"
                      interest:
                        type: array
                        description: Interest labels with audience counts, sorted by count descending. Returned as an empty array when the link's unique click count is at or below 100.
                        items:
                          type: object
                          properties:
                            id:
                              type: string
                              description: Interest label ID. See the [interest label reference sheet](https://docs.google.com/spreadsheets/d/1KU_klYkh9UgWN2St7w9ftRJYWe-U4VMg6MoKthhYGSQ/edit?gid=0#gid=0) for the human-readable name.
                              example: "2001"
                            count:
                              type: number
                              description: Audience count (not a percentage).
                              example: 124
                      brand:
                        type: array
                        description: Brand labels with audience counts, sorted by count descending. Returned as an empty array when the link's unique click count is at or below 100.
                        items:
                          type: object
                          properties:
                            name:
                              type: string
                              description: Brand name in uppercase (e.g. `PICSEE`).
                              example: "PICSEE"
                            count:
                              type: number
                              description: Audience count (not a percentage).
                              example: 60
                  meta:
                    $ref: '#/components/schemas/Meta'
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - access_token: []
        - X-API-Key: []
        - BearerAuth: []
      x-codeSamples:
        - lang: "cURL"
          label: "cURL"
          source: |-
            curl -X 'GET' \
            'https://api.pics.ee/v4/links/5b93x9/details/audienceLabels?access_token=YOUR_ACCESS_TOKEN' \
            -H 'accept: application/json'
        - lang: "JavaScript"
          label: "JavaScript (fetch)"
          source: |-
            const encodeId = '5b93x9';
            const access_token = 'YOUR_ACCESS_TOKEN';
            const res = await fetch(`https://api.pics.ee/v4/links/${encodeId}/details/audienceLabels?access_token=${access_token}`, {
              method: 'GET',
              headers: {
                'accept': 'application/json'
              }
            });
            const data = await res.json();
            console.log(data);
        - lang: "Python"
          label: "Python (requests)"
          source: |-
            import requests

            encode_id = '5b93x9'
            url = f'https://api.pics.ee/v4/links/{encode_id}/details/audienceLabels'
            params = {
                'access_token': 'YOUR_ACCESS_TOKEN'
            }
            headers = {
                'accept': 'application/json'
            }

            response = requests.get(url, params=params, headers=headers)
            print(response.json())
  /v1/abuse:
    post:
      summary: Report Short Link Abuse
      description: |-
        <div class="api-description">
         This API is exclusively available to authorized security partners. It enables partners to flag PicSee shortened URLs to display warning pages, preventing users from being redirected to potentially harmful destination sites.
        </div>
      tags:
        - Authorized Security Partners Only
      operationId: reportShortLinkAbuse
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LinkAbuseReportRequest'
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: object
                required:
                  - meta
                properties:
                  data:
                    type: object
                    properties:
                      status:
                        type: string
                        description: The block status indicates the URL's current state. A status of `banned` means the short link has been successfully blocked and will display a warning page when clicked. A status of `noted` indicates the short link belongs to a business user, and PicSee administrators will be notified to perform a manual review.
                        enum: [noted, banned]
                        example: noted
                  meta:
                    $ref: '#/components/schemas/Meta'
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - access_token: []
        - X-API-Key: []
        - BearerAuth: []
      x-codeSamples:
        - lang: "cURL"
          label: "cURL"
          source: |-
            curl -X 'POST' \
            'https://api.pics.ee/v1/abuse?access_token=YOUR_ACCESS_TOKEN' \
            -H 'Content-Type: application/json' \
            -d '{
              "url": "https://example.com"
            }'
        - lang: "JavaScript"
          label: "JavaScript (fetch)"
          source: |-
            const access_token='YOUR_ACCESS_TOKEN';
            const res = await fetch(`https://api.pics.ee/v1/abuse?access_token=${access_token}`, {
              method: 'POST',
              headers: {
                'Content-Type': 'application/json'
              },
              body: JSON.stringify({
                url: "https://example.com"
              })
            });
            const data = await res.json();
            console.log(data);
        - lang: "Python"
          label: "Python (requests)"
          source: |-
            import requests

            url = 'https://api.pics.ee/v1/abuse'
            params = {
                'access_token': 'YOUR_ACCESS_TOKEN'
            }
            data = {
                'url': 'https://example.com'
            }

            response = requests.post(url, params=params, json=data)
            print(response.json())
components:
  schemas:
    Meta:
      type: object
      description: Contains the URL and parameters for this API request; this field is only return when the format is json.
      required:
        - request
      properties:
        request:
          type: object
          required:
            - url
            - query
          properties:
            url:
              type: object
              description: The URL of this API request
            query:
              type: object
              description: This object will contain the query parameters and body parameters of this API request, excluding the `access_token` for security reasons.
    Error:
      type: object
      required:
        - meta
      properties:
        error:
          type: object
          description: |-
            | Error Code | Error Description | Error Message (Optional) |
            | --- | --- | --- |
            | PUB00001 | An unexpected error occurred. | An unexpected error occurred. |
            | PUB00002 | Invalid request parameters. | *{Reason for the parameter error}* |
            | PUB00003 | This API is only available to **Advanced** plan users. |  |
            | PUB00004 | Cannot create a short link and batch create short links in the same request. |  |
            | PUB00005 | Request limit exceeded. | Too many requests, the limitation of {*API name*} is {*times*} requests / {*time range*} |
            | PUB00006 | Requested resource not found. |  |
            | PUB00007 | Plan quota limit reached. | Quota limit reached |
            | PUB00008 | Caller is not an authorized security partner | Access denied |
            | PUB00201 | Some parameters are only available to **Advanced** plan users. |  |
            | PUB00202 | Invalid or unsafe URL, please try a different URL or contact support. |  |
            | PUB00203 | Invalid image URL. |  |
            | PUB00301 | The requested short link was not found. | Link not found |
            | PUB00302 | Reached the limit of the free plan, therefore unable to retrieve results. |  |
            | PUB00303 | The requested short link has been deleted. | Link deleted |
            | PUB00304 | The requested short link belongs to another user. | Access denied |
            | PUB00501 | The requested short link was not found. | Link not found |
            | PUB00502 | The slug of short link slug does not meet the length requirement (3-90 characters). | The encodeId doesn't fit the requirement(length 3-90) after URI encoded. |
            | PUB00503 | The slug of short link is already exists. | The encodeId already exists. |
            | PUB00504 | The requested short link has been deleted. | Link deleted |
            | PUB00505 | The original domain of the requested short link is invalid. | The link’s domain is invalid. |
            | PUB00506 | The specified Meta Pixel does not exist. | Pixel does not exist |
            | PUB00507 | The specified GTM does not exist. | GTM does not exist |
            | PUB00508 | Unauthorized access to edit the expiration time. | Unauthorized access to edit expireTime. |
            | PUB00509 | Invalid expiration time. You can only set a future time. | Invalid expire time. |
            | PUB00510 | This link is not allowed to be updated to the destination  URL. | The link is not allowed to switch to the url |
            | PUB00511 | The requested short link belongs to another user. | Access denied |
            | PUB00512 | Invalid image URL. |  |
            | PUB00513 | Unable to add tags. | Tags limit reached |
            | PUB00601 | An error occurred during batch URL creation. Please try again. |  |
            | PUB00701 | The requested short link was not found. | Link not found |
            | PUB00702 | The short link is already in the trash | Link deleted |
            | PUB00703 | The short link is not in the trash. | Link recovered |
            | PUB00704 | The link has been in the trash for over 30 days and cannot be restored. | The link has been deleted over 30 days. |
            | PUB00705 | The requested short link belongs to another user. | Access denied. |
            | PUB00706 | Starred links cannot be deleted. | Link starred. |
            | PUB01001 | Invalid URL format - must be a string and include both protocol and path | url must be a string |
            | PUB01002 | The short link does not exist in PicSee |  |
          required:
            - status
            - code
          properties:
            status:
              type: number
              description: HTTP Status Code
              example: 500
            code:
              type: string
              description: Error Code.
              enum: [PUB00001, PUB00002, PUB00003, PUB00004, PUB00005, PUB00006, PUB00007, PUB00008, PUB00201, PUB00202, PUB00203, PUB00301, PUB00302, PUB00303, PUB00304, PUB00501, PUB00502, PUB00503, PUB00504, PUB00505, PUB00506, PUB00507, PUB00508, PUB00509, PUB00510, PUB00511, PUB00512, PUB00513, PUB00601, PUB00701, PUB00702, PUB00703, PUB00704, PUB00705, PUB00706, PUB01001, PUB01002]
            message:
              type: string
              description: Error Description
              oneOf:
                - const: "An unexpected error occurred."
                  title: "PUB00001"
                - const: "{Reason for the parameter error}"
                  title: "PUB00002"
                - const: "Too many requests, the limitation of {API name} is {times} requests / {time range}"
                  title: "PUB00005"
                - const: "Quota limit reached"
                  title: "PUB00007"
                - const: "Access denied"
                  title: "PUB00008"
                - const: "Link not found"
                  title: "PUB00301"
                - const: "Link deleted"
                  title: "PUB00303"
                - const: "Access denied"
                  title: "PUB00304"
                - const: "Link not found"
                  title: "PUB00501"
                - const: "The encodeId doesn't fit the requirement(length 3-90) after URI encoded."
                  title: "PUB00502"
                - const: "The encodeId already exists."
                  title: "PUB00503"
                - const: "Link deleted"
                  title: "PUB00504"
                - const: "The link's domain is invalid."
                  title: "PUB00505"
                - const: "Pixel does not exist"
                  title: "PUB00506"
                - const: "GTM does not exist"
                  title: "PUB00507"
                - const: "Unauthorized access to edit expireTime."
                  title: "PUB00508"
                - const: "Invalid expire time."
                  title: "PUB00509"
                - const: "The link is not allowed to switch to the url"
                  title: "PUB00510"
                - const: "Access denied"
                  title: "PUB00511"
                - const: "Tags limit reached"
                  title: "PUB00513"
                - const: "Link not found"
                  title: "PUB00701"
                - const: "Link deleted"
                  title: "PUB00702"
                - const: "Link recovered"
                  title: "PUB00703"
                - const: "The link has been deleted over 30 days."
                  title: "PUB00704"
                - const: "Access denied."
                  title: "PUB00705"
                - const: "Link starred."
                  title: "PUB00706"
                - const: "url must be a string"
                  title: "PUB01001" 
        meta:
          $ref: '#/components/schemas/Meta'
    ApiStatus:
      type: object
      properties:
        picseeId:
          type: number
          description: PicSee ID of API user
          example: 739
        email:
          type: string
          description: Login e-mail of API user
          example: "service@picsee.vip"
        planName:
          type: string
          description: Return the name of the user's current API plan, which includes free, basic, and advanced options.
          example: "basic"
        quota:
          type: number
          description: Maximum number of short links that can be created via the API within the plan period.
          example: 10000
        usage:
          type: number
          description: Number of short links created via the API within the plan period.
          example: 13
        endTime:
          type: string
          format: date-time
          description: Expiration time of the plan (UTC+8).
          example: "2024-03-23 23:59:59"
        queryTime:
          type: string
          format: date-time
          description: Timestamp of this query (UTC+8).
          example: "2023-11-14 11:39:00"
    Link:
      type: object
      required:
        - url
      properties:
        url:
          type: string
          format: uri
          description: |-
            Destination URL, the target URL of redirection, max length: 2048
          example: "https://picsee.io"
        encodeId:
          type: string
          description: |-
            Specify a unique short link slug for the URL. The slug must be between 3 and 90 characters in length, and can only contain English letters (A-Z, a-z), numbers (0-9), underscores (_), hyphens (-), or Chinese characters. 
            If the slug does not meet these criteria or conflicts with an existing slug, the system will return an error. Ensure the slug is unique across the entire PicSee platform.
        domain:
          type: string
          description: |-
            Specify the Short Link domain. If omitted or invalid, the default domain will be applied.
          example: "pse.is"
        externalId:
          type: string
          description: |-
            Allows grouping of URLs with an optional custom string between 1 and 100 characters.
          example: "20231111_campaign"
        title:
          type: string
          description: |-
            <font class="plan">Advanced Plan</font>
            Customize the URL preview title with a string of 3-300 characters.
          example: "PicSee URL Shortener"
        description:
          type: string
          description: |-
            <font class="plan">Advanced Plan</font>
            Customize the URL preview description with a string of 3-300 characters.
          example: "URL Shortener, QR Code…"
        imageUrl:
          type: string
          format: uri
          description: |-
            <font class="plan">Advanced Plan</font>
            Customize the URL preview thumbnail, which must be an image URL starting with http(s).
          example: "https://wcdn.pse.im/website/picsee_v3_og.png"
        tags:
          type: array
          description: |-
            <font class="plan">Advanced Plan</font>
            Supports up to 3 tags per short link.
          items:
            type: string
          example: ["event1", "中文", "1111"]
        targets:
          type: array
          description: |-
            <font class="plan">Advanced Plan</font>
            Detects the user's device to redirect to specific target pages.
          items:
            type: object
            required:
              - target
              - url
            properties:
              target:
                type: string
                description: |-
                  Supported target device types include:
                  1. ios_android: Mobile (iOS & Android)
                  2. ios: iOS
                  3. ios_store: App Store
                  4. android: Android
                  5. android_store: Google Play Store
                  6. ios_line (beta): LINE browser on iOS
                  7. ios_safari (beta): Safari browser on iOS
                  8. android_fb (beta): FB browser on Android
                  9. pc_mac: Desktop (PC & Mac)
                  10. pc: PC
                  11. mac: Mac
                  12. facebook: from Facebook
                  13. twitter: from Twitter
                example: "ios_android"
              url:
                type: string
                description: Destination link for the target device redirection
                example: https://picsee.io/pricing
            example:
              - target: ios_android
                url: https://picsee.io/
              - target: pc_mac
                url: https://picsee.io/pricing
        fbPixel:
          type: string
          description: |-
            <font class="plan">Advanced Plan</font>
            Meta Pixel ID. Only pixels created via the web version are selectable. To add a new pixel, go to the web version settings.
          example: "1234567"
        gTag:
          type: string
          description: |-
            <font class="plan">Advanced Plan</font>
            Google Tag Manager (GTM) ID. Only GTMs created on the web version can be selected. To add a new GTM, go to the web version settings.
          example: GTM-XXXXXXX
        utm:
          type: object
          description: |-
            <font class="plan">Advanced Plan</font>
            UTM parameters, you can specify the following UTM types:
          properties:
            source:
              type: string
              description: utm_source
            medium:
              type: string
              description: utm_medium
            campaign:
              type: string
              description: utm_campaign
            term:
              type: string
              description: utm_term
            content:
              type: string
              description: utm_content
          example:
            source: facebook
            medium: social
            campaign: "2024"
            term: "0112"
            content: UTM
        pathFormat:
          type: object
          description: |-
            <font class="plan">Advanced Plan</font>
            And needs purchase of the "Path Parameterization（路徑化參數）" feature
          required:
            - key
          properties:
            key:
              type: string
              description: Defines the key name of the GET parameter used to route to the destination URL.
              example: utm_source
    LinkAnalytics:
      type: object
      required:
        - id
        - encodeId
        - url
        - ssl
        - domain
        - totalClicks
        - uniqueClicks
        - created
      properties:
        id:
          type: string
          description: Unique system identifier for this short link
          example: "22198535"
        encodeId:
          type: string
          description: The slug of the short link
          example: "5b93x9"
        url:
          type: string
          format: uri
          description: Destination URL (目標網址)
          example: "https://picsee.io"
        ssl:
          type: boolean
          description: Whether HTTPS is enabled
          example: true
        domain:
          type: string
          description: Domain of this short link
          example: "pse.is"
        totalClicks:
          type: [number, "null"]
          description: Total clicks, which will return null when the free plan limit is reached.
          example: 21
        uniqueClicks:
          type: [number, "null"]
          description: Unique clicks, which will return null when the free plan limit is reached.
          example: 9
        created:
          type: string
          format: date-time
          description: Create time (UTC+8).
          example: "2023-11-11 08:06:28"
        groupId:
          type: number
          description: PicSee group ID of the link owner.
          example: 119
        isStar:
          type: boolean
          description: Whether the link is marked as a favorite.
          example: false
        isAPI:
          type: boolean
          description: Whether the link was created via the API.
          example: true
    LinksSearchParams:
      type: object
      properties:
        encodeId:
          type: string
          description: "Search for short links using the slug (requires an exact match to find results). **Priority 1** — when provided, all other search parameters are ignored."
          example: "5b93x9"
        authorId:
          type: integer
          description: "Search for short links created by a specific link author ID. **Priority 2** — ignored if `encodeId` is provided."
          example: 739
        tag:
          type: string
          description: "Search for short links with the specified tag (limit: 3-30 characters). **Priority 3** — ignored if `encodeId` or `authorId` is provided."
          example: "facebook_campaign"
        keyword:
          type: string
          description: "Search for short links with the keyword (limit: 3-30 characters). **Priority 4** — ignored if any higher priority parameter (`encodeId`, `authorId`, or `tag`) is provided."
          example: "picsee"
    Links:
      type: array
      items:
        type: object
        properties:
          mapId:
            type: string
            description: The ID of the short link.
            example: "22198535"
          domain:
            type: string
            description: The domain of the short link.
            example: "pse.is"
          encodeId:
            type: string
            description: The slug (short link code) for the short link.
            example: "5b93x9"
          ssl:
            type: boolean
            description: Indicates if the link uses HTTPS. Set to `true` for HTTPS and `false` for HTTP.
            example: true
          url:
            type: string
            format: uri
            description: The destination URL.
            example: "https://picsee.io"
          title:
            type: string
            description: The preview title of the short link.
            example: "PicSee URL Shortener | Boost YouTube's Facebook game"
          description:
            type: string
            description: The preview description of the short link.
            example: "URL Shortener - Register-free Link shortening, Bulk Batch URL Shortener API, Customized Previews, Integrated with ChatGPT, Facebook Pixel and GTM"
          gtm:
            type: string
            description: The ID of Google Tag Manager (GTM).
            example: GTM-XXXXXXX
          fbPixel:
            type: string
            description: The ID of Facebook Pixel.
            example: "1234567"
          utm:
            type: [object, "null"]
            description: UTM parameters, containing source and campaign details. Set to null if not applicable.
            properties:
              source:
                type: string
                description: utm_source
              medium:
                type: string
                description: utm_medium
              campaign:
                type: string
                description: utm_campaign
              term:
                type: string
                description: utm_term
              content:
                type: string
                description: utm_content
            example:
              source: facebook
              medium: social
              campaign: "2024"
              term: "0112"
              content: UTM
          createTime:
            type: string
            format: date-time
            description: The creation time of the short link (UTC+8).
            example: "2026-01-29 16:44:28"
          author:
            type: object
            description: The creator of the short link.
            properties:
              id:
                type: number
                description: PicSee ID of creator
                example: 739
              email:
                type: string
                description: Login e-mail of creator
                example: service@picsee.vip
              groupId:
                type: number
                description: PicSee group ID of creator
                example: 119
          tags:
            type: array
            description: Tags associated with the short link.
            items:
              type: object
              properties:
                id:
                  type: number
                  description: Tag ID.
                  example: 2323031
                value:
                  type: string
                  description: Tag Value
                  example: edm
            example:
              - id: 2323031
                value: edm
              - id: 2323032
                value: event1
          targets:
            type: array
            description: Device detection settings that redirect different devices to different destination URLs if applicable.
            items:
              type: object
              properties:
                target:
                  type: string
                  description: Target device type.
                  example: ios_android
                url:
                  type: string
                  description: Device-specific destination URL.
                  example: https://picsee.io/en
            example:
              - target: ios_android
                url: https://picsee.io/
              - target: pc_mac
                url: https://picsee.io/pricing
          isAPILink:
            type: boolean
            description: Specifies whether the short link was generated through an API.
            example: true
          isAPI:
            type: boolean
            description: Specifies whether the short link was generated through an API.
            example: true
          isStar:
            type: boolean
            description: Indicates whether the short link is marked as a favorite.
            example: false
          totalClicks:
            type: [number, "null"]
            description: The total number of clicks. If the user is on a free plan and reaches the plan’s limit, it will return `null`. If there are no clicks, it will return `0`.
            example: 20
          uniqueClicks:
            type: [number, "null"]
            description: The total number of unique clicks. If the user is on a free plan and reaches the plan’s limit, it will return `null`. If there are no unique clicks, it will return `0`.
            example: 14
          qrcodeUrl:
            type: string
            format: uri
            description: |-
              <font class="plan">Advanced Plan</font>
              The URL for the QR code associated with the short link.
            example: "https://api.pics.ee/pse.is/5b93x9/qrcode.jpeg"
    LinkEditRequest:
      type: object
      properties:
        encodeId:
          type: string
          description: |-
            Specify a unique short link slug for the URL. The slug must be between 3 and 90 characters in length, and can only contain English letters (A-Z, a-z), numbers (0-9), underscores (_), hyphens (-), or Chinese characters.
            If the slug does not meet these criteria or conflicts with an existing slug, the system will return an error. Ensure the slug is unique across the entire PicSee platform.
          example: "5b93x9"
        domain:
          type: string
          description: Specify the Short Link domain. If omitted or invalid, the default domain will be applied.
          example: "pse.is"
        title:
          type: string
          description: Customize the URL preview title with a string of 3-300 characters.
          example: PicSee URL Shortener
        description:
          type: string
          description: Customize the URL preview description with a string of 3-300 characters.
          example: URL Shortener, QR Code…
        imageUrl:
          type: string
          format: uri
          description: Customize the URL preview thumbnail, which must be an image URL starting with http(s).
          example: https://wcdn.pse.im/website/picsee_v3_og.png
        url:
          type: string
          format: uri
          description: "Destination URL, the target URL of redirection, max length: 2048"
          example: https://picsee.io
        tags:
          type: array
          description: Supports up to 3 tags per short link.
          items:
            type: string
          example: ["event1", "中文", "1111"]
        targets:
          type: array
          description: Detects the user's device to redirect to specific target pages.
          items:
            type: object
            required:
              - target
              - url
            properties:
              target:
                type: string
                description: |-
                  Supported target device types include:
                  1. ios_android: Mobile (iOS & Android)
                  2. ios: iOS
                  3. ios_store: App Store
                  4. android: Android
                  5. android_store: Google Play Store
                  6. ios_line (beta): LINE browser on iOS
                  7. ios_safari (beta): Safari browser on iOS
                  8. android_fb (beta): FB browser on Android
                  9. pc_mac: Desktop (PC & Mac)
                  10. pc: PC
                  11. mac: Mac
                  12. facebook: from Facebook
                  13. twitter: from Twitter
                example: ios_android
              url:
                type: string
                description: Destination link for the target device redirection
                example: https://picsee.io/pricing
          example:
            - target: ios_android
              url: https://picsee.io/
            - target: pc_mac
              url: https://picsee.io/pricing
        fbPixel:
          type: string
          description: |-
            Meta Pixel ID. Only pixels created via the web version are selectable. To add a new pixel, go to the web version settings. Passing null will clear any previously set pixel.
          example: "1234567"
        gTag:
          type: string
          description: |-
            Google Tag Manager (GTM) ID. Only GTMs created on the web version can be selected. To add a new GTM, go to the web version settings. Passing null will clear any previously set GTM.
          example: GTM-XXXXXXX
        utm:
          type: object
          description: "UTM parameters, you can specify the following UTM types: Passing null will clear any previously set UTM parameters."
          properties:
            source:
              type: string
              description: utm_source
            medium:
              type: string
              description: utm_medium
            campaign:
              type: string
              description: utm_campaign
            term:
              type: string
              description: utm_term
            content:
              type: string
              description: utm_content
          example:
            source: facebook
            medium: social
            campaign: "2024"
            term: "0112"
            content: UTM
        expireTime:
          type: string
          format: date-time
          description: The expiration time for the link, which can be set to any future date and time in the format `YYYY-MM-DDTHH:mm:ss`. Passing `null` will clear any previously set expiration.
          example: "2023-11-30T23:59:59"
    LinkAbuseReportRequest:
      type: object
      required:
        - url
      properties:
        url:
          type: string
          format: uri
          description: A PicSee short link - must include protocol (e.g., https) and path (e.g., /abuse)
          example: https://psee.io/abuse
        attack_type:
          type: string
          description: Type of attack - for internal reference
        description:
          type: string
          description: Notes - for internal reference
        date:
          type: string
          format: date
          description: Report date - for internal reference, used for report tracking
        target_brand:
          type: string
          description: Target brand - for internal reference
        screenshot_url:
          type: string
          format: uri
          description: Screenshot URL - for internal reference
  securitySchemes:
    access_token:
      type: apiKey
      in: query
      name: access_token
      description: "Use the same token as X-API-Key. Example: ?access_token=YOUR_TOKEN"
    X-API-Key:
      type: apiKey
      in: header
      name: X-API-Key
      description: "Use the same token as access_token, but sent via header. Example: X-API-Key: YOUR_TOKEN"
    BearerAuth:
      type: http
      scheme: bearer
      description: "Use the same token, but with the 'Bearer ' prefix. Example: Authorization: Bearer YOUR_TOKEN"