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

# Tickets in Claude Code and Codex

> Work your support tickets from Claude Code, Codex or your own code: read them, reply to customers, close, reopen, assign, learn and split, across every agent in your team.

Work your support tickets without opening the dashboard. Ask Claude Code or Codex "what's waiting for us?", read a conversation, agree a reply, and send it. One key covers **every agent in your team**.

You need three things: a key, one line of setup, and the right team role.

## 1. Create a key

1. Go to **Team → API keys → Create Key**.

2. Choose a secret key and, under **Tickets**, tick what it may do:

   | Permission | Lets Claude |
   | - | - |
   | **Read your tickets and their conversations** | See your agents, their tickets and whole conversations (comes with every other one) |
   | **Reply to customers on your tickets** | Send a reply on a ticket, on the channel the customer wrote from |
   | **Close, reopen and set priority on your tickets** | Close a finished ticket, reopen one, set how urgent it is |
   | **Assign and take your tickets** | Assign a ticket to a teammate, or take it yourself |
   | **Learn from and split your tickets** | Teach SuperIntern from a ticket's answer, and split a ticket that holds several questions |

3. Copy the key. It's shown once.

> [!WARNING]
>
> **The key works as the person who creates it, with their team role.** Create it while signed in as yourself, so it can do what you can do and no more. Creating a team key needs a team admin.
>
> Anyone holding the key can do what you ticked, so keep it out of code, chats and shared files. If it leaks, turn it off in **Team → API keys**.

## 2. Connect Claude Code or Codex

Save the key on your computer as an environment variable called `SUPERINTERN_API_KEY`. For example, add this line to `~/.zshrc` (Mac) or `~/.bashrc` (Linux), then open a new terminal:

```bash theme={null}
export SUPERINTERN_API_KEY="sk_live_…"
```

Then add SuperIntern:

> [tab] Claude Code
>
> ```bash theme={null}
> claude mcp add --transport http --scope user superintern-tickets https://api.superintern.ai/mcp \
>   --header 'Authorization: Bearer ${SUPERINTERN_API_KEY}'
> ```
>
> Keep the single quotes. Claude Code then saves the name of the variable, not the key, and reads the key each time it connects.
>
> Check it worked with `claude mcp list`: **superintern-tickets** should say **Connected**.

> [tab] Codex
>
> Add this to `~/.codex/config.toml` (the Codex app, command line and editor extension all read it):
>
> ```toml theme={null}
> [mcp_servers.superintern-tickets]
> url = "https://api.superintern.ai/mcp"
> bearer_token_env_var = "SUPERINTERN_API_KEY"
> ```
>
> Codex reads the key from `SUPERINTERN_API_KEY` each time it starts. Check it worked with `codex mcp list`.

Open Claude Code or Codex from a terminal where `SUPERINTERN_API_KEY` is set. Already connected SuperIntern for your CRM or websites? Keep that connection; this one sits beside it.

## 3. Ask

Start a new chat and ask in your own words:

* "Which tickets are waiting for us on each agent?"
* "Read the newest waiting ticket on the Support agent and draft a reply."
* "Send that reply." (Claude shows you the exact text first and sends only after you say yes.)
* "Close every ticket where the customer said thanks and nothing is left to do."
* "Assign the billing questions to Sam."
* "Learn from the tickets we closed today."
* "This ticket has two questions in it. Split it."

Claude asks before it replies to a customer, closes, reopens, assigns, learns from or splits a ticket. A reply goes out as your business and can't be taken back.

## What it can do

| Tool | What it does | Needs |
| - | - | - |
| `ticket_agent_list` | Your agents, how many tickets wait for the team on each, and what you may do there | Read tickets |
| `ticket_list` | One agent's tickets, filtered by status or by "changed since" | Read tickets |
| `ticket_read` | One ticket with its whole conversation | Read tickets |
| `ticket_reply` | Reply to the customer | Reply to tickets |
| `ticket_close`, `ticket_reopen` | Close or reopen a ticket | Ticket status |
| `ticket_priority_set` | Set the priority: low, medium or high | Ticket status |
| `ticket_member_list`, `ticket_assign` | See who can take tickets, and assign one (or clear it) | Assign tickets |
| `ticket_claim` | Take a ticket yourself. On a ticket SuperIntern is still answering, it stops answering | Assign tickets |
| `ticket_learn` | Teach SuperIntern from the ticket, so it answers that question itself next time | Learn from tickets |
| `ticket_split`, `ticket_split_undo` | Split a ticket into one per question, or put it back together | Learn from tickets |

The **Needs** column uses the short names you see on the key's row in **Team → API keys**. Claude only sees the tools your key allows. Learning and splitting use your credits.

### Your team role still applies

Each action also needs your role on that agent, the same as in the dashboard:

| To | Your role needs |
| - | - |
| Read tickets | Case Viewer or higher |
| Reply | Case Responder or Case Resolver |
| Close, reopen, set priority, take a ticket | Case Resolver |
| Assign to someone else, learn, split | Case Manager |

`ticket_agent_list` shows what you may do on each agent, so Claude knows before it tries.

### Limits

Per key, per hour: 60 replies, 120 closes, reopens and priority changes, 120 assignments, and 30 learns and splits. Past a limit, the key waits for the next hour. The limits stop a runaway script; normal work never reaches them.

## Use the API from your own code

The same key works with plain HTTPS. Send it as `Authorization: Bearer sk_live_…`.

**Base address:** `https://api.superintern.ai`

| Request | Does | Needs |
| - | - | - |
| `GET /data/agent-case/agents` | Your agents, with `waiting`, `open` and `can` (what you may do on each) | Read tickets |
| `GET /data/agent-case/export?agent_id=…` | One agent's tickets with their conversations, oldest change first. Filters: `statuses` (`escalated,open,open_bot,closed,rejected`), `updated_after`, `cursor`, `limit` (up to 50) | Read tickets |
| `GET /data/agent-case/export?case_id=…` | One ticket | Read tickets |
| `POST /data/async/agent-case/send-message` | Reply: `{"case_id", "message"}` | Reply to tickets |
| `POST /data/agent-case/close` | Close: `{"case_id"}` | Ticket status |
| `POST /data/agent-case/reopen` | Reopen: `{"case_id"}` | Ticket status |
| `POST /data/agent-case/set-priority` | `{"case_id", "priority": "low" \| "medium" \| "high"}` | Ticket status |
| `GET /data/agent-case/assignable-members?agent_id=…` | Who tickets can be assigned to | Assign tickets |
| `POST /data/agent-case/assign` | `{"case_id", "member_id"}`; `null` clears it | Assign tickets |
| `POST /data/agent-case/claim` | Take it yourself: `{"case_id"}` | Assign tickets |
| `POST /data/async/agent-case/learn` | `{"case_id"}`; `learned` says whether anything was learned | Learn from tickets |
| `POST /data/agent-case/split` | `{"case_id"}`; `result` is `split` (with `new_case_ids`) or `one_matter` | Learn from tickets |
| `POST /data/agent-case/undo-split` | `{"case_id"}` | Learn from tickets |

```bash theme={null}
# Your agents and what's waiting
curl https://api.superintern.ai/data/agent-case/agents \
  -H "Authorization: Bearer $SUPERINTERN_API_KEY"

# Tickets waiting for the team on one agent
curl "https://api.superintern.ai/data/agent-case/export?agent_id=<agent id>&statuses=escalated" \
  -H "Authorization: Bearer $SUPERINTERN_API_KEY"

# Reply
curl -X POST https://api.superintern.ai/data/async/agent-case/send-message \
  -H "Authorization: Bearer $SUPERINTERN_API_KEY" -H "Content-Type: application/json" \
  -d '{"case_id": "<ticket id>", "message": "Thanks for waiting. This is fixed now."}'
```

To pick up only what changed, keep `next_cursor` from the last export and pass it back as `cursor` next time.

Errors come back as `{"status": "error", "message": "…"}`:

| Code | Means |
| - | - |
| `401` | The key is wrong, turned off, or can't read tickets |
| `403` | The key wasn't given that permission, or your role doesn't allow it on that agent |
| `404` | No such ticket or agent in your team |
| `429` | The key reached its hourly limit |

Tickets are always named by `case_id`. A key never sees a ticket's private customer link.

## Turn a key off

Go to **Team → API keys** and turn it off or delete it. It stops working at once. A key also stops reaching your agents if the person who made it leaves the team.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.