Skip to main content
POST /v1/issuer/data_source_mappings API Key

Create a data source mapping

Create a mapping that connects a data source to a credential schema.

What this does:

  • Links a data source (e.g., your employee database) to a credential schema (e.g., EmployeeBadge)
  • Defines field mappings: which database columns populate which credential claims
  • Configures how to query records from the source

Example: Map employees.full_name → credential name claim, employees.job_titletitle claim.

Once created, use this mapping with an Automation to automatically issue credentials.

Parameters

Name Location Type Description
X-API-Key * header string Issuer API key for authentication

* Required parameter

Request Body

application/json

Parameters for creating a data source mapping

data_source_id * string

ID of the data source

Example: employee-database

credential_schema_id * string

UUID or slug of the credential schema

Example: employee-badge

name string

Optional custom name for the mapping

Example: HR Database to Employee Badge

field_mapping * object

Maps data source columns to credential claims

Example: {"name":"full_name","employee_id":"emp_id","department":"dept_name"}

query_config object

Query configuration for data extraction

Example: {"table":"employees","where":"status = 'active'"}

Response

201 Mapping created

Content-Type: application/json

success boolean
data object

A mapping between a data source and credential schema

slug * string

URL-friendly identifier

Example: employee-database-employee-badge

name string nullable

Optional custom name for the mapping

Example: Employee Badge Mapping

display_name * string

Display name (custom name or auto-generated)

Example: Employee Database → Employee Badge

data_source * object

The linked data source

slug string

Example: employee-database

name string

Example: Employee Database

source_type string

Allowed values: "postgresql", "csv"

Example: postgresql

credential_schema * object

The linked credential schema

uuid string (uuid)

Example: 60476b28-5bfc-4cd5-a65a-9ac898a7223c

slug string

Example: employee-badge

name string

Example: Employee Badge

field_mapping object nullable

Maps data source columns to credential claims (full view only)

Example: {"name":"full_name","email":"email_address"}

query_config object nullable

Query configuration for data extraction (full view only)

Example: {"table":"employees","columns":["full_name","email_address"]}

automation_count * integer

Number of automations using this mapping

created_at * string (date-time)

When the mapping was created

updated_at * string (date-time)

When the mapping was last updated

Code Examples

import os
from aho_sdk import AhoSdk

client = AhoSdk.issuer(api_key=os.environ["AHO_API_KEY"])

result = client.data_source_mappings.create(
    body={
        "data_source_id": "employee-database",
        "credential_schema_id": "employee-badge",
        "name": "HR Database to Employee Badge",
        "field_mapping": {
            "name": "full_name",
            "employee_id": "emp_id",
            "department": "dept_name"
        },
        "query_config": {
            "table": "employees",
            "where": "status = 'active'"
        }
    }
)

Try It

Log in to test this endpoint directly from the documentation.

Log in