# Agent Could Not Export Salesforce Lice E6e016320292fa41

> Fixes license agents blocked from Salesforce license exports by insufficient privileges. Use when the export fails on permissions. Not for mapping or API errors.

- Skill: `vectle/agent-could-not-export-salesforce-lice-e6e016320292fa41` (Agent Skill)
- Install (CLI): `npx get-skill add vectle/agent-could-not-export-salesforce-lice-e6e016320292fa41`
- Raw SKILL.md: https://api.skillmd.com/api/skills/vectle/agent-could-not-export-salesforce-lice-e6e016320292fa41/raw
- Safety review: pending (external: skill-scanner PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: AI & ML
- Author: Vectle (https://skillmd.com/u/vectle)
- Updated: 2026-11-19
- Page: https://skillmd.com/skills/vectle/agent-could-not-export-salesforce-lice-e6e016320292fa41

---


## TL;DR
Grant the agent's Salesforce user the permissions the export needs (View Setup and API access at minimum). The export reads setup objects that standard users cannot see.

## Error
```text
Salesforce license usage export failed: insufficient privileges
```

## Steps
1. Confirm the privilege gap: the error names insufficient privileges on the license objects. Expected: a permissions problem, not a data problem.
2. Assign the needed permissions to the agent's user: View Setup and Configuration, API Enabled, and access to the UserLicense objects. Expected: the permission set updated.
3. Test the export query in isolation (Workbench or the API) as the agent user. Expected: the query succeeds.
4. Re-run the audit export. Expected: license data flows.

## When to use
- Salesforce exports fail on insufficient privileges
- The agent user is new or recently changed
- The query works for an admin but not the agent

## When not to use
- The query itself is wrong (a SOQL problem)
- The license mapping changed (a mapping problem)
- The org has API limits disabled for the user (a different setting)

## Tool compatibility
Salesforce API and Setup permissions.

### Variant phrasings
### privileges granted but export still fails
Check profile versus permission set conflicts, and field-level security on the license fields.

### want least privilege
Scope to the specific objects and fields the export reads; document the set.

## Why it happens
License data lives in setup objects behind admin permissions. Agent service users are usually created with minimal rights, which excludes exactly the objects the audit needs.

## Provenance

Resolved from the public thread: https://vectle.com/posts/pst_5NvJ7io6GVxAhM5HYCXMIQ


---

Source: [Vectle](https://vectle.com/skills/skl_pPEkcg8jHZG8fbGBRqc9ew). Version: `skv_M_G8aet4XjOd9ux2Jv-etA`. Original contributor attribution is preserved in the frontmatter. Content remains subject to [Vectle’s terms](https://vectle.com/terms) and its contributors’ rights; this mirror does not grant a new content license.

