---
title: "Crear sesión de verificación"
---

> Documentation Index
> Fetch the complete documentation index at: https://sovra-id-docs-1044960690985.us-central1.run.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Crear sesión de verificación

Path: Sovra ID API › Verificaciones

`POST /api/v1/verifier/verifications`

URL: `https://test-api-sovra.flagonsa.com/api/v1/verifier/verifications`

Inicia una sesión de verificación OID4VP. `dcql_query` sigue la especificación DCQL de OID4VP.

Tres reglas que evitan casi todos los fallos:
1. Cada `path` debe coincidir carácter por carácter con el `key` del esquema.
2. Todos los claims pedidos son obligatorios: si el holder omite uno, falla toda la presentación.
3. `id` es una etiqueta libre tuya, devuelta tal cual en el resultado; no filtra por tipo de credencial.

La respuesta trae `session_id`, `authorization_request_uri` (autocontenida) y `authorization_request_uri_ref` (corta, para DCQL grandes). La sesión vive 10 minutos.

## Authentication

- `apiKey`, http bearer, header `Authorization`

## Request body

_Required._

- `dcql_query` (`createVerification.dcql_query`; object, optional)
  - `credentials` (`createVerification.dcql_query.credentials`; array of object, optional)
    - `id` (`createVerification.dcql_query.credentials.id`; string, optional)
    - `format` (`createVerification.dcql_query.credentials.format`; string, optional)
    - `claims` (`createVerification.dcql_query.credentials.claims`; array of object, optional)
      - `path` (`createVerification.dcql_query.credentials.claims.path`; array of string, optional)

## Example requests

### Crear sesión de verificación

```json
{
  "dcql_query": {
    "credentials": [
      {
        "id": "identidad",
        "format": "vc+sd-jwt",
        "claims": [
          {
            "path": [
              "email"
            ]
          }
        ]
      }
    ]
  }
}
```

### Control de tránsito (licencia completa)

```json
{
  "dcql_query": {
    "credentials": [
      {
        "id": "licencia",
        "format": "mso_mdoc",
        "meta": {
          "doctype_value": "io.sovra.0x5de0df12cce712ddaaa23feb359920ae4f3230d4.driving_licence_v2.1"
        },
        "claims": [
          {
            "path": [
              "mx.gob.nl.icv.1",
              "given_name"
            ]
          },
          {
            "path": [
              "mx.gob.nl.icv.1",
              "family_name"
            ]
          },
          {
            "path": [
              "mx.gob.nl.icv.1",
              "second_family_name"
            ]
          },
          {
            "path": [
              "mx.gob.nl.icv.1",
              "document_number"
            ]
          },
          {
            "path": [
              "mx.gob.nl.icv.1",
              "expiry_date"
            ]
          },
          {
            "path": [
              "mx.gob.nl.icv.1",
              "driving_privileges"
            ]
          },
          {
            "path": [
              "mx.gob.nl.icv.1",
              "portrait"
            ]
          }
        ]
      }
    ]
  }
}
```

### Verificación de edad (sin fecha de nacimiento)

```json
{
  "dcql_query": {
    "credentials": [
      {
        "id": "edad",
        "format": "mso_mdoc",
        "meta": {
          "doctype_value": "io.sovra.0x5de0df12cce712ddaaa23feb359920ae4f3230d4.driving_licence_v2.1"
        },
        "claims": [
          {
            "path": [
              "mx.gob.nl.icv.1",
              "age_over_18"
            ]
          }
        ]
      }
    ]
  }
}
```

### Urgencias médicas

```json
{
  "dcql_query": {
    "credentials": [
      {
        "id": "urgencias",
        "format": "mso_mdoc",
        "meta": {
          "doctype_value": "io.sovra.0x5de0df12cce712ddaaa23feb359920ae4f3230d4.driving_licence_v2.1"
        },
        "claims": [
          {
            "path": [
              "mx.gob.nl.icv.1",
              "blood_type"
            ]
          },
          {
            "path": [
              "mx.gob.nl.icv.1",
              "allergies"
            ]
          },
          {
            "path": [
              "mx.gob.nl.icv.1",
              "organ_donor"
            ]
          },
          {
            "path": [
              "mx.gob.nl.icv.1",
              "emergency_phone"
            ]
          }
        ]
      }
    ]
  }
}
```

### Comprobante de domicilio

```json
{
  "dcql_query": {
    "credentials": [
      {
        "id": "domicilio",
        "format": "mso_mdoc",
        "meta": {
          "doctype_value": "io.sovra.0x5de0df12cce712ddaaa23feb359920ae4f3230d4.driving_licence_v2.1"
        },
        "claims": [
          {
            "path": [
              "mx.gob.nl.icv.1",
              "street"
            ]
          },
          {
            "path": [
              "mx.gob.nl.icv.1",
              "exterior_number"
            ]
          },
          {
            "path": [
              "mx.gob.nl.icv.1",
              "interior_number"
            ]
          },
          {
            "path": [
              "mx.gob.nl.icv.1",
              "neighborhood"
            ]
          },
          {
            "path": [
              "mx.gob.nl.icv.1",
              "resident_city"
            ]
          },
          {
            "path": [
              "mx.gob.nl.icv.1",
              "resident_postal_code"
            ]
          }
        ]
      }
    ]
  }
}
```

### Zona de cobertura (calle y CP)

```json
{
  "dcql_query": {
    "credentials": [
      {
        "id": "cobertura",
        "format": "mso_mdoc",
        "meta": {
          "doctype_value": "io.sovra.0x5de0df12cce712ddaaa23feb359920ae4f3230d4.driving_licence_v2.1"
        },
        "claims": [
          {
            "path": [
              "mx.gob.nl.icv.1",
              "street"
            ]
          },
          {
            "path": [
              "mx.gob.nl.icv.1",
              "resident_postal_code"
            ]
          }
        ]
      }
    ]
  }
}
```

### Trámite que requiere CURP

```json
{
  "dcql_query": {
    "credentials": [
      {
        "id": "tramite",
        "format": "mso_mdoc",
        "meta": {
          "doctype_value": "io.sovra.0x5de0df12cce712ddaaa23feb359920ae4f3230d4.driving_licence_v2.1"
        },
        "claims": [
          {
            "path": [
              "mx.gob.nl.icv.1",
              "curp"
            ]
          },
          {
            "path": [
              "mx.gob.nl.icv.1",
              "given_name"
            ]
          },
          {
            "path": [
              "mx.gob.nl.icv.1",
              "family_name"
            ]
          },
          {
            "path": [
              "mx.gob.nl.icv.1",
              "second_family_name"
            ]
          }
        ]
      }
    ]
  }
}
```

## Code samples

### cURL

```bash
curl --request POST \
  --url https://test-api-sovra.flagonsa.com/api/v1/verifier/verifications \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "dcql_query": {
    "credentials": [
      {
        "id": "identidad",
        "format": "vc+sd-jwt",
        "claims": [
          {
            "path": [
              "email"
            ]
          }
        ]
      }
    ]
  }
}
'
```

### TypeScript

```typescript
const url = 'https://test-api-sovra.flagonsa.com/api/v1/verifier/verifications';
const options = {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    Authorization: 'Bearer <token>'
  },
  body: JSON.stringify({
    dcql_query: {
      credentials: [{id: 'identidad', format: 'vc+sd-jwt', claims: [{path: ['email']}]}]
    }
  })
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://test-api-sovra.flagonsa.com/api/v1/verifier/verifications"

payload = { "dcql_query": { "credentials": [
            {
                "id": "identidad",
                "format": "vc+sd-jwt",
                "claims": [{ "path": ["email"] }]
            }
        ] } }
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer <token>"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
```

## Responses

### 200

Respuesta exitosa. La colección de Postman de origen no incluye el cuerpo de la respuesta; ver la guía de referencia.


Source: https://sovra-id-docs-1044960690985.us-central1.run.app/api/create-verification/index.md
