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

Create a data source

Create a new data source for automated credential issuance. Data sources
connect to external databases or file uploads to retrieve subject data.
New data sources are created in draft status.

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

name * string

Display name for the data source

Example: HR Database

source_type * string

Type of data source

Allowed values: "postgresql", "csv"

Example: postgresql

connection_settings object

PostgreSQL connection settings

host * string

Database server hostname or IP address

Example: db.example.com

port integer

Database server port (1-65535)

Example: 5432

database * string

Name of the database to connect to

Example: hr_production

username string

Database user for authentication (optional for local/trusted connections)

Example: readonly_user

password string

Database password (optional for passwordless/trusted connections)

sslmode string

SSL connection mode: prefer (try SSL first), require (must use SSL), disable (no SSL)

Allowed values: "prefer", "require", "disable"

Example: prefer

Response

201 Data source created

Content-Type: application/json

success boolean
data object

A data source for automated credential issuance

slug * string

URL-friendly identifier

Example: employee-database

name * string

Display name for the data source

Example: Employee Database

source_type * string

Type of data source: - postgresql: PostgreSQL database connection - csv: CSV file upload

Allowed values: "postgresql", "csv"

Example: postgresql

status * string

Current status of the data source: - draft: Not yet configured/tested - active: Connection verified, ready for use - paused: Temporarily disabled - error: Connection test failed

Allowed values: "draft", "active", "paused", "error"

Example: active

mapping_count * integer

Number of credential schema mappings using this source

Example: 3

connection_info object nullable

Connection metadata (passwords are never exposed)

host string

Database hostname

Example: db.example.com

port integer

Database port

Example: 5432

database string

Database name

Example: hr_system

username string

Connection username

Example: reader

source_file object nullable

CSV file details (for csv source type)

filename string

Example: employees.csv

byte_size integer

Example: 15240

content_type string

Example: text/csv

created_at * string (date-time)

When the data source was created

Example: 2025-01-01T00:00:00Z

updated_at * string (date-time)

When the data source was last updated

Example: 2025-01-15T10:30:00Z

Code Examples

import os
from aho_sdk import AhoSdk

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

result = client.data_sources.create(
    body={
        "name": "HR Database",
        "source_type": "postgresql",
        "connection_settings": {
            "host": "db.example.com",
            "port": 5432,
            "database": "hr_production",
            "username": "readonly_user",
            "password": "string",
            "sslmode": "prefer"
        }
    }
)

Try It

Log in to test this endpoint directly from the documentation.

Log in