# Quick Start — Validation API

Validate a signed PDF in two API calls: authenticate, then submit the document for validation.

## Prerequisites

- An API username and API key with the `ROLE_VALIDATION_API_USER` role
- A digitally signed PDF document (Base64-encoded)

## Step 1 — Authenticate

```bash
curl -X POST "https://api.skribble.com/v2/access/login" \
  -H "Content-Type: application/json" \
  -d '{
    "username": "api_your_username",
    "api-key": "your-api-key"
  }'
```

The response is a plain-text JWT token:

```
eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...
```

Save this token — it's valid for ~20 minutes.

## Step 2 — Validate a document

Submit a Base64-encoded signed PDF for validation:

```bash
curl -X POST "https://api.skribble.com/validation/v1/validate/document" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "content": "JVBERi0xLjQKMSAwIG9iago8PAovVHlwZSAvQ2F0..."
  }'
```

**Response:**

```json
{
  "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "valid": true,
  "signatures": 1,
  "validSignatures": 1,
  "quality": "QES",
  "legislation": "CH",
  "longTermValidation": true,
  "visualDifferences": false,
  "undefinedChanges": false
}
```

| Field | Description |
|-------|-------------|
| `valid` | `true` if all signatures are valid |
| `signatures` | Total number of signatures found |
| `validSignatures` | Number of valid signatures |
| `quality` | Highest signature quality detected (`SES`, `AES`, `QES`) |
| `legislation` | Legislation under which the signatures were validated. Only present when `quality` is `QES` |
| `longTermValidation` | Whether the signatures support long-term validation |

## Getting more details

Use the returned `id` to fetch additional information:

```bash
# Signer details
curl -H "Authorization: Bearer YOUR_TOKEN" \
  "https://api.skribble.com/validation/v1/infos/{id}/signers"

# PDF validation report
curl -H "Authorization: Bearer YOUR_TOKEN" \
  "https://api.skribble.com/validation/v1/reports/{id}/skribble"
```

## What's next

- [Best Practices](/validation-api-best-practices) — validation parameters and error handling
- [Validation API v1 Reference](/api/validation-v1) — full endpoint documentation
