Button Links Api

The Links Api API from Button — 1 operation(s) for links api.

GitHub OpenAPI
Business capability
Mobile Attribution & Deep Linking AE-902

Operations 1

Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/usebutton:usebutton-links-api-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

usebutton-links-api-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: links-api Links API
  version: '4'
servers:
- url: https://api.usebutton.com/v1/links
security:
- sec0: []
tags:
- name: Links Api
paths:
  /:
    post:
      summary: Generate a Link
      description: Generate and return a fully attributable Button-wrapped link to the desired Retailer page by passing the full page URL or the affiliate tracking link.
      operationId: generate-a-link
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
              - url
              properties:
                url:
                  type: string
                  description: The target destination URL, such as `https://example.com/products`.
                experience:
                  type: object
                  description: Optional customizations for the linking experience.
                  properties:
                    btn_pub_user:
                      type: string
                      description: 'Your user''s unique identifier. Typically a user ID or a stable hash of one. This value will be passed back to you in webhook requests associated with that downstream Brand activity. Must be a string between 1 and 255 characters long in the ASCII range [0x21-0x7E]. Note: Loyalty Publishers must include this value in order to know which user to reward.'
                    btn_pub_ref:
                      type: string
                      description: A Publisher reference value (e.g. click ID, campaign ID) that can be used to associate any value with any downstream Brand activity such as orders, app-installs, etc. This value will be passed back to you in webhook requests associated with that downstream Brand activity. String with a maximum length of 512.
                    btn_desktop_url:
                      type: string
                      description: A url to redirect to if the user is on desktop. If unset, the target flow is executed.
      responses:
        '200':
          description: '200'
          content:
            application/json:
              examples:
                Result:
                  value: "{\n  \"meta\": {\n    \"status\": \"ok\"\n  },\n  \"object\":{\n    \"merchant_id\": \"org-YYY\",\n    \"affiliate\": null,\n    \"links\": {\n      \"universal\": \"https://r.bttn.io?btn_url=https%3A%2F%2Fwww.brand123.com&btn_pub_user=your-user-id&btn_pub_ref=your-publisher--reference&btn_ref=org-XXX\"\n    }\n  }\n}"
              schema:
                type: object
                properties:
                  meta:
                    type: object
                    properties:
                      status:
                        type: string
                        example: ok
                  object:
                    type: object
                    properties:
                      merchant_id:
                        type: string
                        example: org-YYY
                      affiliate: {}
                      links:
                        type: object
                        properties:
                          universal:
                            type: string
                            example: https://r.bttn.io?btn_url=https%3A%2F%2Fwww.brand123.com&btn_pub_user=your-user-id&btn_pub_ref=your-publisher--reference&btn_ref=org-XXX
        '401':
          description: '401'
          content:
            application/json:
              examples:
                Result:
                  value: "{\n    \"meta\": {\n        \"status\": \"error\"\n    },\n    \"error\": {\n        \"message\": \"Invalid api_key\"\n    }\n}"
              schema:
                type: object
                properties:
                  meta:
                    type: object
                    properties:
                      status:
                        type: string
                        example: error
                  error:
                    type: object
                    properties:
                      message:
                        type: string
                        example: Invalid api_key
        '403':
          description: '403'
          content:
            application/json:
              examples:
                Result:
                  value: "{\n    \"meta\": {\n        \"status\": \"error\"\n    },\n    \"error\": {\n        \"message\": \"Not approved for link building\",\n        \"type\": \"NoMerchantApproval\",\n        \"details\": {\n            \"merchant_id\": \"org-123\"\n        }\n    }\n}"
              schema:
                type: object
                properties:
                  meta:
                    type: object
                    properties:
                      status:
                        type: string
                        example: error
                  error:
                    type: object
                    properties:
                      message:
                        type: string
                        example: Not approved for link building
                      type:
                        type: string
                        example: NoMerchantApproval
                      details:
                        type: object
                        properties:
                          merchant_id:
                            type: string
                            example: org-123
        '404':
          description: '404'
          content:
            application/json:
              examples:
                Result:
                  value: "{\n    \"meta\": {\n        \"status\": \"error\"\n    },\n    \"error\": {\n        \"message\": \"Merchant could not be detected from the url\",\n        \"type\": \"NoMerchantLinkSupport\"\n    }\n}"
              schema:
                type: object
                properties:
                  meta:
                    type: object
                    properties:
                      status:
                        type: string
                        example: error
                  error:
                    type: object
                    properties:
                      message:
                        type: string
                        example: Merchant could not be detected from the url
                      type:
                        type: string
                        example: NoMerchantLinkSupport
      deprecated: false
      x-readme:
        code-samples:
        - language: curl
          code: "curl https://api.usebutton.com/v1/links \\\n  -X POST \\\n  -u YOUR_API_KEY: \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"url\": \"https://www.brand123.com\",\n    \"experience\": {\n      \"btn_pub_user\": \"your-user-id\",\n      \"btn_pub_ref\":\"your-publisher-reference\"\n    }\n  }'"
        samples-languages:
        - curl
      tags:
      - Links Api
components:
  securitySchemes:
    sec0:
      type: http
      scheme: basic
x-readme:
  headers: []
  explorer-enabled: false
  proxy-enabled: false
x-readme-fauxas: true