> ## Documentation Index
> Fetch the complete documentation index at: https://docs.opencharge.network/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Metadata

> Return your KYC provider's public metadata for service discovery

<Info>
  This endpoint is public and does not require authentication. Other services fetch this to discover your capabilities and verify your signatures.
</Info>

## Implementation

Host this endpoint at the URL you register in the Router Registry. The response tells other services:

* **Your public key** - Used to verify your signed KYC data
* **Your endpoint URL** - Where to send API requests
* **Your capabilities** - Which KYC endpoints you support

## Example Response

```json theme={null}
{
  "opencharge": "0.1",
  "name": "TrustVerify KYC",
  "profile": "Global KYC verification provider",
  "icon": "https://kyc.provider.example/icon.png",
  "config": {
    "publicKey": "a34b5c6d7e8f9a0b...",
    "endpoint": "https://kyc.provider.example/opencharge",
    "capabilities": [
      "kyc.grant",
      "kyc.validate",
      "kyc.data"
    ]
  },
  "kyc": [],
  "signature": "a1b2c3d4e5f6...7f1b",
  "contact": "support@kycprovider.example"
}
```

## Key Fields

| Field                 | Purpose                                    |
| --------------------- | ------------------------------------------ |
| `profile`             | Description of your KYC service            |
| `config.publicKey`    | Your secp256k1 public key (128 hex chars)  |
| `config.endpoint`     | Base URL for your Opencharge API           |
| `config.capabilities` | List of supported KYC operations           |
| `signature`           | Your signature of the canonicalized config |

## Signing Your Config

Sign the `config` object to prove you control the private key:

```javascript theme={null}
const config = {
  publicKey: YOUR_PUBLIC_KEY,
  endpoint: "https://kyc.provider.example/opencharge",
  capabilities: [
    "kyc.grant",
    "kyc.validate",
    "kyc.data"
  ]
};

const canonical = JSON.stringify(config, Object.keys(config).sort());
const signature = secp256k1_sign(YOUR_PRIVATE_KEY, SHA256(canonical));
```


## OpenAPI

````yaml kyc-provider-api/endpoint/kyc-provider-api/openapi.json get /metadata.json
openapi: 3.1.0
info:
  title: Opencharge KYC Provider API
  description: >-
    API specification for KYC providers integrating with the Opencharge
    protocol. KYC providers collect and verify user identity information, then
    share it with authorized OCN entities.
  version: 0.1.0
  license:
    name: MIT
servers:
  - url: https://kyc.provider.example/opencharge
    description: Example KYC provider Opencharge endpoint
security: []
paths:
  /metadata.json:
    get:
      summary: Get OCID metadata
      description: >-
        Returns your KYC provider's metadata including public key, endpoint URL,
        and capabilities. Other services fetch this to verify your signatures
        and discover your capabilities.
      operationId: getMetadata
      responses:
        '200':
          description: OCID metadata document
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OCIDMetadata'
              example:
                opencharge: '0.1'
                name: TrustVerify KYC
                profile: Global KYC verification provider
                icon: https://kyc.provider.example/icon.png
                config:
                  publicKey: >-
                    a34b5c6d7e8f9a0b1c2d3e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d7e8f9a0b1c2d3e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9c0d1e2f3a4b
                  endpoint: https://kyc.provider.example/opencharge
                  capabilities:
                    - kyc.grant
                    - kyc.validate
                    - kyc.data
                kyc: []
                signature: a1b2c3d4e5f6...7f1b
                contact: support@kycprovider.example
components:
  schemas:
    OCIDMetadata:
      type: object
      required:
        - opencharge
        - name
        - config
        - signature
      properties:
        opencharge:
          type: string
        name:
          type: string
        profile:
          type: string
        icon:
          type: string
          format: uri
        config:
          $ref: '#/components/schemas/OCIDConfig'
        kyc:
          type: array
          items:
            type: integer
          description: Supported auto KYC providers that service accepts
        signature:
          type: string
        contact:
          type: string
    OCIDConfig:
      type: object
      required:
        - publicKey
        - endpoint
        - capabilities
      properties:
        publicKey:
          type: string
          pattern: ^[a-fA-F0-9]{128}$
        endpoint:
          type: string
          format: uri
        capabilities:
          type: array
          items:
            type: string
            enum:
              - kyc.grant
              - kyc.validate
              - kyc.data

````