# List Tag Mappings Beta

> Which tags are on which resources.

> Documentation index: https://www.foxreach.io/docs/llms.txt lists every page of these docs. Each page is also served as Markdown: add `.md` to its URL.

`GET` https://api.foxreach.io/api/v1/tags/mappings

> **Note:** **Beta.** This endpoint is new and may change.

Requires an API key with the `read` scope.

Returns tag and resource id pairs for leads, campaigns or email accounts, ordered by tag and then resource. For campaigns and email accounts, `tagIds` and `resourceIds` are both optional filters. For leads, `resourceIds` is required (up to 100): to list the leads that carry one tag, use [List Leads](https://www.foxreach.io/docs/api-reference/leads/list-leads) with `tags`. Deleted leads and resources of other workspaces are never returned.

## Query Parameters

- `resourceType` string query required: `lead`, `campaign` or `email_account`.
- `tagIds` string query: Comma-separated tag ids, up to 50.
- `resourceIds` string query: Comma-separated resource ids, up to 100. Required when `resourceType` is `lead`.
- `page` integer query: Page number, starting at 1.
- `pageSize` integer query: Results per page, 1 to 100. Default 50.

**Request example**

```bash cURL
curl "https://api.foxreach.io/api/v1/tags/mappings?resourceType=campaign" \
  -H "X-API-Key: otr_your_key"
```

```python Python SDK (beta)
from foxreach import FoxReach

client = FoxReach(api_key="otr_your_key")
page = client.tags.mappings("campaign")
```

```typescript TypeScript SDK (beta)
import { FoxReach } from "foxreach";

const client = new FoxReach({ apiKey: "otr_your_key" });
const page = await client.tags.mappings("campaign");
```

**Response example**

```json
{
  "data": [
    { "tagId": "tag_abc123", "resourceId": "cmp_1", "resourceType": "campaign" }
  ],
  "meta": { "page": 1, "pageSize": 50, "total": 1, "totalPages": 1 }
}
```

## Errors

| Status | Description |
|--------|-------------|
| `401` | Missing, invalid, revoked or expired API key |
| `403` | API key does not have the required scope: `read` |
| `422` | `resourceType` is missing or invalid, `resourceIds` is missing for leads, or a list is too long |

## Rate Limit

- **300 requests per minute, shared by every `read` call in your workspace.** Fixed 60-second window.
- Every response includes `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset` (unix epoch seconds) and `X-RateLimit-Bucket` (`read`).
- A `429` response includes a `Retry-After` header (seconds until the bucket resets).

For client-side patterns, see [Rate Limiting](https://www.foxreach.io/docs/rate-limiting).
