Polygon ID Schemas API

The Schemas API from Polygon ID — 2 operation(s) for schemas.

OpenAPI Specification

polygon-id-schemas-api-openapi.yml Raw ↑
openapi: 3.0.0
info:
  title: Privado ID - Issuer Agent Schemas API
  description: "The Issuer Node Core API is ideal for users who need multiple identities and for integrator profiles, who want to \ncreate solutions based on Privado ID functionalities and might be interested in having access to low level \ninformation such as Merkle Trees.\nThe Issuer Node API provide the following functionalities:\n* Create and retrieve Identities\n* Create a Verifiable Credential (VC)\n* Retrieve a Verifiable Credential or a list of Verifiable Credentials\n* Generate JSON to create a QR Code and use that to accept credentials in a wallet\n* Revoke a Verifiable Credential\n* Check revocation status of a Verifiable Credential\n* Retrieve the Revocation Status of a Verifiable Credential\n* Call Agent Endpoint using the Wallet App\n* Handle connections.\n"
  version: '1'
tags:
- name: Schemas
paths:
  /v2/identities/{identifier}/schemas:
    post:
      summary: Import JSON schema
      operationId: ImportSchema
      description: Import a JSON schema to be used in the credentials.
      security:
      - basicAuth: []
      tags:
      - Schemas
      parameters:
      - $ref: '#/components/parameters/pathIdentifier'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ImportSchemaRequest'
      responses:
        '201':
          description: Schema imported
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UUIDResponse'
        '400':
          $ref: '#/components/responses/400'
        '500':
          $ref: '#/components/responses/500'
    get:
      summary: Get Schemas
      operationId: GetSchemas
      security:
      - basicAuth: []
      tags:
      - Schemas
      parameters:
      - $ref: '#/components/parameters/pathIdentifier'
      - in: query
        name: query
        schema:
          type: string
        description: Query string to do full text search in schema types and attributes.
      responses:
        '200':
          description: Schema collection
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Schema'
        '400':
          $ref: '#/components/responses/400'
        '500':
          $ref: '#/components/responses/500'
  /v2/identities/{identifier}/schemas/{id}:
    get:
      summary: Get Schema
      operationId: GetSchema
      description: Get a specific schema for the provided identity.
      security:
      - basicAuth: []
      tags:
      - Schemas
      parameters:
      - $ref: '#/components/parameters/pathIdentifier'
      - $ref: '#/components/parameters/id'
      responses:
        '200':
          description: Schema information
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Schema'
        '400':
          $ref: '#/components/responses/400'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
    patch:
      summary: Update Schema
      operationId: UpdateSchema
      description: Update a specific schema for the provided identity.
      security:
      - basicAuth: []
      tags:
      - Schemas
      parameters:
      - $ref: '#/components/parameters/pathIdentifier'
      - $ref: '#/components/parameters/id'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                displayMethodID:
                  type: string
                  x-go-type: uuid.UUID
                  x-omitempty: false
      responses:
        '200':
          description: Schema information
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericMessage'
        '400':
          $ref: '#/components/responses/400'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
components:
  schemas:
    TimeUTC:
      type: string
      x-go-type: timeapi.Time
      x-go-type-import:
        name: timeapi
        path: github.com/polygonid/sh-id-platform/internal/timeapi
      example: '2023-10-26T10:59:08Z'
      x-omitempty: false
    GenericErrorMessage:
      type: object
      required:
      - message
      properties:
        message:
          type: string
          example: Something happen
    UUIDResponse:
      type: object
      required:
      - id
      properties:
        id:
          type: string
          x-omitempty: false
          example: c79c9c04-8c98-40f2-a7a0-5eeabf08d836
    GenericMessage:
      type: object
      required:
      - message
      properties:
        message:
          type: string
    Schema:
      type: object
      required:
      - id
      - hash
      - bigInt
      - url
      - type
      - contextURL
      - createdAt
      - version
      properties:
        id:
          type: string
          x-omitempty: false
          example: c79c9c04-8c98-40f2-a7a0-5eeabf08d836
        hash:
          type: string
          x-omitempty: false
          example: 18f30714a35a5db88ca24728c0c53dfd
        bigInt:
          type: string
          x-omitempty: false
          example: '336615423900919464193075592850483704600'
        url:
          type: string
          x-omitempty: false
          example: https://raw.githubusercontent.com/iden3/claim-schema-vocab/main/schemas/json/KYCAgeCredential-v3.json
        type:
          type: string
          x-omitempty: false
          example: KYCCountryOfResidenceCredential
        contextURL:
          type: string
        createdAt:
          $ref: '#/components/schemas/TimeUTC'
          x-omitempty: false
        title:
          type: string
          x-omitempty: false
          example: KYC Age Credential
        description:
          type: string
          x-omitempty: false
          example: KYC Age Credential description
        version:
          type: string
          x-omitempty: false
          example: 1.0.0
        displayMethodID:
          type: string
          x-go-type: uuid.UUID
          x-omitempty: false
    ImportSchemaRequest:
      type: object
      required:
      - url
      - schemaType
      - version
      properties:
        url:
          type: string
          example: https://raw.githubusercontent.com/iden3/claim-schema-vocab/main/schemas/json/KYCAgeCredential-v3.json
        schemaType:
          type: string
          example: vaccinationCertificate
        title:
          type: string
          example: KYC Age Credential
        description:
          type: string
          example: KYC Age Credential description
        version:
          type: string
          example: 1.0.0
        displayMethodID:
          type: string
          x-go-type: uuid.UUID
          x-omitempty: false
  responses:
    '404':
      description: Not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/GenericErrorMessage'
    '400':
      description: Bad Request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/GenericErrorMessage'
    '500':
      description: Internal Server  error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/GenericErrorMessage'
  parameters:
    id:
      name: id
      in: path
      required: true
      description: 'UUID parameter, e.g: 8edd8112-c415-11ed-b036-debe37e1cbd6

        '
      schema:
        type: string
        x-go-type: uuid.UUID
        x-go-type-import:
          name: uuid
          path: github.com/google/uuid
    pathIdentifier:
      name: identifier
      in: path
      required: true
      description: Issuer identifier
      schema:
        type: string
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic