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

# Marketing Resources

> Use merchant-provided files, social posts, swipe copy, and links in your affiliate promotions.

Marketing Resources are affiliate-ready assets published by a merchant. They can include files, social post templates, swipe copy, external links, and campaign collections.

You only see resources for programs where you are an approved affiliate.

## What you can access

| Resource       | How to use it                                                           |
| -------------- | ----------------------------------------------------------------------- |
| Files          | Download images, PDFs, videos, or other campaign assets.                |
| Social posts   | Render post copy with your own affiliate link and referral code.        |
| Swipe copy     | Copy approved messaging for emails, posts, or landing pages.            |
| External links | Open merchant-hosted folders, brand kits, or campaign pages.            |
| Collections    | Download or browse a grouped set of resources for a launch or campaign. |

## Surface coverage

Affiliate REST, SDK, and MCP access is read-oriented. Affiliates can list published resources, inspect a resource, render social post templates, and create download URLs. Creating or editing merchant resources is a merchant-only workflow.

| Capability                                    | Dashboard | REST API | Node/Python SDKs | Affiliate MCP |
| --------------------------------------------- | --------- | -------- | ---------------- | ------------- |
| List published resources for a joined program | Yes       | Yes      | Yes              | Yes           |
| Get resource detail                           | Yes       | Yes      | Yes              | Yes           |
| Render social post placeholders               | Yes       | Yes      | Yes              | Yes           |
| Create download URLs                          | Yes       | Yes      | Yes              | Yes           |
| Create or edit resources                      | No        | No       | No               | No            |

<Info>
  Marketing Resources do not currently emit webhook events. Merchants publish or unpublish resources, and affiliates read the current published state.
</Info>

## Rendered social posts

Merchants can publish social post templates with placeholders:

| Placeholder          | Rendered value                      |
| -------------------- | ----------------------------------- |
| `{{affiliate_link}}` | Your tracking link for the program. |
| `{{affiliate_code}}` | Your referral code.                 |
| `{{program_name}}`   | The program name.                   |

When you render a social post, AgentRef returns the final copy, available links, attached media, merchant instructions, and disclosure guidance.

<Warning>
  If you share a post with your affiliate link, include a clear disclosure where people can see it. Examples include `#ad`, `affiliate link`, or equivalent wording that fits the platform and local rules.
</Warning>

## REST API

Affiliate Marketing Resources require an affiliate API key (`ak_aff_*`) with `marketing_resources:read`.

| Action                       | Endpoint                                                                |
| ---------------------------- | ----------------------------------------------------------------------- |
| List resources for a program | `GET /api/v1/me/programs/{programId}/marketing-resources`               |
| Get resource detail          | `GET /api/v1/me/marketing-resources/{resourceId}?program_id=PROGRAM_ID` |
| Render social post           | `POST /api/v1/me/marketing-resources/social-posts/{resourceId}/render`  |
| Create download URL          | `POST /api/v1/me/marketing-resources/download-url`                      |

<CodeGroup>
  ```bash List resources theme={null}
  curl "https://www.agentref.co/api/v1/me/programs/PROGRAM_ID/marketing-resources?kind=social_posts" \
    -H "Authorization: Bearer ak_aff_YOUR_KEY"
  ```

  ```bash Render a social post theme={null}
  curl -X POST "https://www.agentref.co/api/v1/me/marketing-resources/social-posts/RESOURCE_ID/render" \
    -H "Authorization: Bearer ak_aff_YOUR_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "program_id": "PROGRAM_ID",
      "affiliate_link_id": "LINK_ID"
    }'
  ```
</CodeGroup>

## MCP tools

Affiliate MCP exposes Marketing Resources through:

`list_marketing_resources`, `get_marketing_resource`, `render_marketing_social_post`, and `create_marketing_resource_download_url`.

Use the affiliate MCP endpoint:

```text theme={null}
https://www.agentref.co/api/mcp/affiliate
```

## What's next

<CardGroup cols={2}>
  <Card title="Links & Attribution" icon="link" href="/affiliates/links-attribution">
    Create and use tracking links.
  </Card>

  <Card title="Commissions" icon="coins" href="/affiliates/commissions">
    Understand how earnings are calculated.
  </Card>
</CardGroup>
