# Euroopahanked Agent Access

Euroopahanked.ee provides a read-only Agent API for customer-owned AI agents and tools.
Agents can search tenders, inspect selected tender details, ask supported document-based tender questions,
search previous contract awards, and read billing status.

## Base URLs

- Agent API: `https://www.euroopahanked.ee/api/agent/v1`
- MCP JSON-RPC: `https://www.euroopahanked.ee/mcp`
- Capabilities: `https://www.euroopahanked.ee/api/agent/v1/capabilities`
- Guide: `https://www.euroopahanked.ee/agents/euroopahanked-agent-api.md`
- LLM guide: `https://www.euroopahanked.ee/llms.txt`

## Authentication

Preferred flow for agents:

1. Call `POST https://www.euroopahanked.ee/api/agent/v1/device/start` with a client name.
2. Show the returned `verificationUrlComplete` to the user.
3. Poll `POST https://www.euroopahanked.ee/api/agent/v1/device/token` with `deviceCode`.
4. After the logged-in user confirms access in the browser, the poll response returns a Bearer token.

If the browser user is not logged in, `verificationUrlComplete` opens the normal login flow.
If the user does not yet have an account, they can register from that flow; after successful
authentication or registration in the same browser session, Euroopahanked returns them to the
agent connection approval page. A logged-in user can also create a token manually in the company
profile integrations view.

```http
Authorization: Bearer <agent_token>
```

Token access is read-only and follows the same company service-status rules as the web app.
The token cannot be valid longer than the company service period.

## Important Rules

- Start with `GET /api/agent/v1/me`.
- MCP clients can call `https://www.euroopahanked.ee/mcp` with `initialize`, `tools/list` and `tools/call`.
- Use `GET /api/agent/v1/cpv` to discover CPV sectors and codes.
- Tender search must include `keyword` or `cpv`.
- Contract search must include `cpv`, `buyer` or `winner`.
- Search results return temporary token-scoped UUIDs, not real tender or contract identifiers.
- Tender and contract detail endpoints are rate-limited and audited.
- Document questions are supported only when `documentQuestionsSupported` is `true`.

## Limits

- Search page size: max 25
- Temporary reference TTL: 24 hours
- Tender details: 50/day and 1000/month
- Contract details: 50/day and 1000/month

## Status

Agent API enabled: `true`
