From 2d3552063ac533bab3b93a0a78637a8f6ea29663 Mon Sep 17 00:00:00 2001 From: abdulla-ashurov Date: Mon, 10 Jul 2023 16:54:36 +0500 Subject: [PATCH] Update swagger.json. --- src/static/swagger.json | 4301 +++++++++++++++++++-------------------- 1 file changed, 2118 insertions(+), 2183 deletions(-) diff --git a/src/static/swagger.json b/src/static/swagger.json index 9cffaa3b..fbd5a2d7 100644 --- a/src/static/swagger.json +++ b/src/static/swagger.json @@ -1,2315 +1,2250 @@ { - "openapi": "3.0.0", - "servers": [ - { - "url": "/" - } - ], - "info": { - "description": "API service to create and manage DIDs and credentials on cheqd network.", - "version": "2.0.0", - "title": "Credential Service for cheqd network" + "openapi": "3.0.0", + "info": { + "title": "Credential Service for cheqd network", + "version": "2.0.0", + "description": "API service to create and manage DIDs and credentials on cheqd network." + }, + "tags": [ + { + "name": "Credential", + "externalDocs": { + "url": "https://github.com/cheqd/credential-service#readme" + } }, - "tags": [ - { - "name": "Credential", - "externalDocs": { - "url": "https://github.com/cheqd/credential-service#readme" + { + "name": "Account" + } + ], + "components": { + "schemas": { + "CredentialRequest": { + "description": "Input fields for the create operation.", + "type": "object", + "additionalProperties": false, + "properties": { + "issuerDid": { + "description": "This input field is the Issuer's DID.", + "type": "string", + "example": "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0" + }, + "subjectDid": { + "description": "This input field is the holder's DID.", + "type": "string", + "example": "did:key:z6MkhaXgBZDvotDkL5257faiztiGiC2QtKLGpbnnEGta2doK" + }, + "attributes": { + "description": "Json input of the attributes.", + "type": "object", + "example": { + "gender": "male", + "name": "bob" } - } - ], - "paths": { - "/key/create": { - "post": { - "tags": [ - "Key" - ], - "summary": "Create a Keypair", - "security": [ - { - "bearerAuth": [] - } + }, + "@context": { + "description": "Additional contexts to be included in the credential.", + "type": "array", + "items": { + "type": "string" + }, + "example": [ + "https://schema.org" + ] + }, + "type": { + "description": "Additional type property to be included in the credential.", + "type": "array", + "items": { + "type": "string" + }, + "example": [ + "Person" + ] + }, + "expirationDate": { + "description": "Optional expiration date according to the https://www.w3.org/TR/vc-data-model/#expiration specification." + }, + "format": { + "description": "Select one of the supported credential formats, jwt by default.", + "type": "string", + "enum": [ + "jwt", + "lds" + ], + "example": "jwt" + }, + "credentialStatus": { + "description": "Optional field to support revocation or suspension, which takes statusListName and statusListPurpose as inputs.", + "type": "object", + "required": [ + "statusPurpose", + "statusListName" + ], + "properties": { + "statusPurpose": { + "type": "string", + "enum": [ + "revocation", + "suspension" ], - "responses": { - "200": { - "description": "The request was successful", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/KeyResult" - } - } - } - }, - "400": { - "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Invalid Request" - } - } - } - }, - "401": { - "$ref": "#/components/schemas/UnauthorizedError" - }, - "500": { - "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Internal Error" - } - } - } - } - } + "example": "revocation" + }, + "statusListName": { + "type": "string", + "example": "employee-credentials" + }, + "statusListIndex": { + "type": "number", + "example": 10 + }, + "statusListVersion": { + "type": "string" + }, + "statusListRangeStart": { + "type": "number" + }, + "statusListRangeEnd": { + "type": "number" + }, + "indexNotIn": { + "type": "number" + } } + } }, - "/key/{kid}": { - "get": { - "tags": [ - "Key" - ], - "summary": "Fetch keypair", - "security": [ - { - "bearerAuth": [] - } - ], - "parameters": [ - { - "in": "path", - "name": "kid", - "schema": { - "type": "string" - }, - "required": true - } - ], - "responses": { - "200": { - "description": "The request was successful", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/KeyResult" - } - } - } - }, - "401": { - "$ref": "#/components/schemas/UnauthorizedError" - }, - "500": { - "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Internal Error" - } - } - } - } - } + "required": [ + "issuerDid", + "subjectDid", + "attributes" + ] + }, + "Credential": { + "description": "Input fields for the update operation.", + "type": "object", + "additionalProperties": false, + "properties": { + "@context": { + "type": "array", + "items": { + "type": "string" + }, + "example": [ + "https://www.w3.org/2018/credentials/v1", + "https://schema.org", + "https://veramo.io/contexts/profile/v1" + ] + }, + "type": { + "type": "array", + "items": { + "type": "string" + }, + "example": [ + "VerifiableCredential", + "Person" + ] + }, + "expirationDate": { + "type": "string" + }, + "issuer": { + "type": "object", + "properties": { + "id": { + "type": "string", + "example": "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0" + } } - }, - "/did/create": { - "post": { - "tags": [ - "DID" + }, + "credentialSubject": { + "type": "object", + "properties": { + "id": { + "type": "string" + } + }, + "example": { + "gender": "male", + "id": "did:key:z6MkhaXgBZDvotDkL5257faiztiGiC2QtKLGpbnnEGta2doK", + "name": "Bob" + } + }, + "credentialStatus": { + "type": "object", + "properties": { + "id": { + "type": "string", + "example": "https://resolver.cheqd.net/1.0/identifiers/did:cheqd:testnet:7c2b990c-3d05-4ebf-91af-f4f4d0091d2e?resourceName=cheqd-suspension-1&resourceType=StatusList2021Suspension#20" + }, + "statusListIndex": { + "type": "string", + "example": 20 + }, + "statusPurpose": { + "type": "string", + "enum": [ + "revocation", + "suspension" ], - "summary": "Create a DID", - "description": "

This endpoint creates a DID by taking a set of input parameters or the whole didDocument itself

", - "security": [ - { - "bearerAuth": [] - } + "example": "suspension" + }, + "type": { + "type": "string", + "enum": [ + "StatusList2021Entry" ], - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "schema": { - "$ref": "#/components/schemas/DIDCreateRequest" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/DIDCreateRequest" - } - } - } + "example": "StatusList2021Entry" + } + } + }, + "issuanceDate": { + "type": "string", + "example": "2023-06-08T13:49:28.000Z" + }, + "proof": { + "type": "object", + "properties": { + "type": { + "type": "string", + "example": "JwtProof2020" + }, + "jwt": { + "type": "string", + "example": "eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJkaWQ6Y2hlcWQ6dGVzdG5ldDo3YmY4MWEyMC02MzNjLTRjYzctYmM0YS01YTQ1ODAxMDA1ZTAiLCJuYmYiOjE2ODYyMzIxNjgsInN1YiI6ImRpZDprZXk6ejZNa2hhWGdCWkR2b3REa0w1MjU3ZmFpenRpR2lDMlF0S0xHcGJubkVHdGEyZG9LIiwidmMiOnsiQGNvbnRleHQiOlsiaHR0cHM6Ly93d3cudzMub3JnLzIwMTgvY3JlZGVudGlhbHMvdjEiLCJodHRwczovL3NjaGVtYS5vcmciLCJodHRwczovL3ZlcmFtby5pby9jb250ZXh0cy9wcm9maWxlL3YxIl0sImNyZWRlbnRpYWxTdWJqZWN0Ijp7ImdlbmRlciI6Im1hbGUiLCJuYW1lIjoiQm9iIn0sInR5cGUiOlsiVmVyaWZpYWJsZUNyZWRlbnRpYWwiLCJQZXJzb24iXX19.wMfdR6RtyAZA4eoWya5Aw97wwER2Cm5Guk780Xw8H9fA3sfudIJeLRLboqixpTchqSbYeA7KbuCTAnLgXTD_Cg" + } + } + } + } + }, + "CredentialRevokeRequest": { + "type": "object", + "properties": { + "credential": { + "description": "This input field takes the credential object or the JWT string", + "oneOf": [ + { + "type": "object" + }, + { + "type": "string" + } + ] + } + } + }, + "RevocationResult": { + "properties": { + "revoked": { + "type": "boolean" + } + } + }, + "SuspensionResult": { + "properties": { + "suspended": { + "type": "boolean" + }, + "statusList": { + "type": "string" + } + } + }, + "UnSuspensionResult": { + "properties": { + "unsuspended": { + "type": "boolean" + }, + "statusList": { + "type": "string" + } + } + }, + "CredentialVerifyRequest": { + "type": "object", + "properties": { + "credential": { + "description": "This input field takes the credential object or the JWT string.\\", + "allOf": [ + { + "type": "object" + }, + { + "type": "string" + } + ] + } + } + }, + "IVerifyResult": { + "type": "object", + "properties": { + "verified": { + "type": "boolean", + "example": true + }, + "issuer": { + "type": "string", + "example": "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0" + }, + "signer": { + "type": "object", + "example": { + "controller": "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0", + "id": "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0#key-1", + "publicKeyBase58": "BTJiso1S4iSiReP6wGksSneGfiKHxz9SYcm2KknpqBJt", + "type": "Ed25519VerificationKey2018" + } + }, + "jwt": { + "type": "string" + }, + "verifiableCredential": { + "type": "object" + } + } + }, + "PresentationRequest": { + "type": "object", + "required": [ + "presentation" + ], + "properties": { + "presentation": { + "description": "This input field takes the presentation object or the JWT string.", + "allOf": [ + { + "type": "string" + }, + { + "type": "object" + } + ] + } + } + }, + "Customer": { + "type": "object", + "properties": { + "customerId": { + "type": "string" + }, + "address": { + "type": "string" + } + } + }, + "InvalidRequest": { + "type": "object", + "properties": { + "error": { + "type": "string" + } + } + }, + "UnauthorizedError": { + "description": "Access token is missing or invalid", + "type": "object", + "properties": { + "error": { + "type": "string", + "example": "Unauthorized Error" + } + } + }, + "KeyResult": { + "type": "object", + "properties": { + "kid": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "Ed25519", + "Secp256k1" + ] + }, + "publicKeyHex": { + "type": "string" + } + } + }, + "DidDocument": { + "description": "This input field contains either a complete DID document, or an incremental change (diff) to a DID document. See https://identity.foundation/did-registration/#diddocument.", + "type": "object", + "properties": { + "context": { + "type": "array", + "items": { + "type": "string" + } + }, + "id": { + "type": "string", + "example": "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0" + }, + "controllers": { + "type": "array", + "items": { + "type": "string" + }, + "example": [ + "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0" + ] + }, + "authentication": { + "type": "array", + "items": { + "type": "string" + }, + "example": [ + "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0#key-0" + ] + }, + "assertionMethod": { + "type": "array", + "items": { + "type": "string" + } + }, + "capabilityInvocation": { + "type": "array", + "items": { + "type": "string" + } + }, + "capabilityDelegation": { + "type": "array", + "items": { + "type": "string" + } + }, + "keyAgreement": { + "type": "array", + "items": { + "type": "string" + } + }, + "verificationMethod": { + "type": "array", + "items": { + "$ref": "#/components/schemas/VerificationMethod" + } + }, + "service": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Service" + } + } + } + }, + "DidResult": { + "type": "object", + "properties": { + "did": { + "type": "string" + }, + "controllerKeyId": { + "type": "string" + }, + "keys": { + "type": "array", + "items": { + "type": "object" + } + }, + "services": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Service" + } + } + } + }, + "VerificationMethod": { + "type": "object", + "properties": { + "id": { + "type": "string", + "example": "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0#key-0" + }, + "type": { + "type": "string", + "example": "Ed25519VerificationKey2018" + }, + "controller": { + "type": "string", + "example": "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0" + }, + "publicKeyMultibase": { + "type": "string", + "example": "BTJiso1S4iSiReP6wGksSneGfiKHxz9SYcm2KknpqBJt" + }, + "publicKeyJwk": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "Service": { + "type": "object", + "properties": { + "id": { + "type": "string", + "example": "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0#rand" + }, + "type": { + "type": "string", + "example": "rand" + }, + "serviceEndpoint": { + "type": "array", + "items": { + "type": "string", + "example": "https://rand.in" + } + } + } + }, + "DidUpdateRequest": { + "type": "object", + "properties": { + "did": { + "type": "string" + }, + "service": { + "type": "array", + "description": "This input field assigns the provided service array to the DID Document.", + "items": { + "$ref": "#/components/schemas/Service" + } + }, + "verificationMethod": { + "type": "array", + "description": "This input field assigns the provided verificationMethod array to the DID Document.", + "items": { + "$ref": "#/components/schemas/VerificationMethod" + } + }, + "authentication": { + "description": "This input field assigns the provided authentication array to the DID Document.", + "type": "array", + "items": { + "type": "string" + } + }, + "didDocument": { + "$ref": "#/components/schemas/DidDocument" + } + } + }, + "CreateResourceRequest": { + "description": "Input fields for the resource creation", + "type": "object", + "additionalProperties": false, + "required": [ + "name", + "type", + "data", + "encoding" + ], + "properties": { + "data": { + "description": "Provide encoded string for the resource data.", + "type": "string" + }, + "encoding": { + "description": "The encoding format of the resource data.", + "type": "string", + "enum": [ + "base64url", + "base64", + "hex" + ] + }, + "name": { + "description": "Resource name.", + "type": "string" + }, + "alsoKnownAs": { + "type": "array", + "items": { + "type": "object", + "properties": { + "uri": { + "type": "string" }, - "responses": { - "200": { - "description": "The request was successful", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DidResult" - } - } - } - }, - "400": { - "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Invalid Request" - } - } - } - }, - "401": { - "$ref": "#/components/schemas/UnauthorizedError" - }, - "500": { - "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Internal Error" - } - } - } - } + "description": { + "type": "string" } + } } + }, + "version": { + "type": "string" + } }, - "/did/update": { - "post": { - "tags": [ - "DID" - ], - "summary": "Update a DID", - "description": "

This endpoint updates a DID by taking DID document or the particular fields needed to be updated

", - "security": [ - { - "bearerAuth": [] - } - ], - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "schema": { - "$ref": "#/components/schemas/DIDUpdateRequest" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/DIDUpdateRequest" - } - } - } - }, - "responses": { - "200": { - "description": "The request was successful", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DidResult" - } - } - } - }, - "400": { - "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Invalid Request" - } - } - } - }, - "401": { - "$ref": "#/components/schemas/UnauthorizedError" - }, - "500": { - "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Internal Error" - } - } - } - } + "example": { + "data": "SGVsbG8gV29ybGQ=", + "name": "ResourceName", + "type": "TextDocument" + } + }, + "CredentialStatusCreateRequest": { + "allOf": [ + { + "type": "object", + "required": [ + "did", + "statusListName" + ], + "properties": { + "did": { + "description": "The DID of the status list publisher.", + "type": "string", + "example": "did:cheqd:testnet:7c2b990c-3d05-4ebf-91af-f4f4d0091d2e" + }, + "statusListName": { + "description": "The name of the status list to be created.", + "type": "string", + "example": "cheqd-employee-credentials" + }, + "length": { + "description": "The length of the status list to be created. The default and minimum length is 140000 which is 16kb." + }, + "encoding": { + "description": "The encoding format of the statusList to be published.", + "type": "string", + "default": "base64url", + "enum": [ + "base64url", + "base64", + "hex" + ] + }, + "statusListVersion": { + "description": "This input field is OPTIONAL, If present assigns the version to be assigned to the statusList.", + "type": "string" + }, + "alsoKnownAs": { + "description": "The input field is OPTIONAL. If present, the value MUST be a set where each item in the set is a uri.", + "type": "array", + "items": { + "type": "object", + "properties": { + "uri": { + "type": "string" + }, + "description": { + "type": "string" + } + } } + } } - }, - "/did/deactivate/{did}": { - "post": { - "tags": [ - "DID" - ], - "summary": "Deactivate a DID", - "description": "

This endpoint deactivates a DID by taking DID document or a verification method as an input.

", - "security": [ - { - "bearerAuth": [] - } - ], - "parameters": [ - { - "in": "path", - "name": "did", - "schema": { - "type": "string" - }, - "required": true - } - ], - "responses": { - "200": { - "description": "The request was successful", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DidResult" - } - } - } - }, - "400": { - "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Invalid Request" - } - } - } - }, - "401": { - "$ref": "#/components/schemas/UnauthorizedError" - }, - "500": { - "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Internal Error" - } - } - } + } + ] + }, + "CredentialStatusResult": { + "type": "object", + "properties": { + "success": { + "type": "object", + "properties": { + "created": { + "type": "boolean", + "example": true + }, + "resource": { + "type": "object", + "example": { + "StatusList2021": { + "encodedList": "H4sIAAAAAAAAA-3BAQ0AAADCoPdPbQ8HFAAAAAAAAAAAAAAAAAAAAADwaDhDr_xcRAAA", + "type": "StatusList2021Revocation", + "validFrom": "2023-06-26T11:45:19.349Z" + }, + "metadata": { + "encoding": "base64url", + "encrypted": false + } + } + }, + "resourceMetadata": { + "type": "object", + "example": { + "resourceMetadata": { + "checksum": "909e22e371a41afbb96c330a97752cf7c8856088f1f937f87decbef06cbe9ca2", + "created": "2023-06-26T11:45:20Z", + "mediaType": "application/json", + "nextVersionId": null, + "previousVersionId": null, + "resourceCollectionId": "7c2b990c-3d05-4ebf-91af-f4f4d0091d2e", + "resourceId": "5945233a-a4b5-422b-b893-eaed5cedd2dc", + "resourceName": "cheqd-revocation-1", + "resourceType": "StatusList2021Revocation", + "resourceURI": "did:cheqd:testnet:7c2b990c-3d05-4ebf-91af-f4f4d0091d2e/resources/5945233a-a4b5-422b-b893-eaed5cedd2dc", + "resourceVersion": "2023-06-26T11:45:19.349Z" + } + } + }, + "statusList2021": { + "type": "object", + "properties": { + "statusList2021": { + "type": "object", + "properties": { + "encodedList": { + "type": "string" + }, + "type": { + "type": "string" + }, + "validFrom": { + "type": "string" + } } + } + } + }, + "metadata": { + "type": "string", + "properties": { + "encoding": { + "type": "string" + }, + "encrypted": { + "type": "boolean" + } } + } } - }, - "/did/list": { - "get": { - "tags": [ - "DID" - ], - "summary": "Fetch DIDs from wallet", - "description": "

This endpoint returns the list of DIDs controlled by the account

", - "security": [ - { - "bearerAuth": [] - } + } + } + }, + "CredentialStatusPublishRequest": { + "allOf": [ + { + "type": "object", + "required": [ + "did", + "encodedList", + "statusListName", + "encoding" + ], + "properties": { + "did": { + "description": "The DID of the status list publisher.", + "type": "string", + "example": "did:cheqd:testnet:7c2b990c-3d05-4ebf-91af-f4f4d0091d2e" + }, + "statusListName": { + "description": "The name of the statusList to be published", + "type": "string", + "example": "cheqd-employee-credentials" + }, + "encodedList": { + "description": "The encoding format of the statusList provided", + "type": "string", + "enum": [ + "base64url", + "base64", + "hex" ], - "responses": { - "200": { - "description": "The request was successful", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "type": "string" - } - } - } - } - }, - "400": { - "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Invalid Request" - } - } - } - }, - "401": { - "$ref": "#/components/schemas/UnauthorizedError" - }, - "500": { - "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Internal Error" - } - } - } - } + "example": "base64url" + }, + "statusListVersion": { + "description": "This input field is OPTIONAL, If present assigns the version to be assigned to the statusList", + "type": "string", + "example": 2023 + }, + "alsoKnownAs": { + "description": "The input field is OPTIONAL. If present, the value MUST be a set where each item in the set is a uri.", + "type": "array", + "items": { + "type": "object", + "properties": { + "uri": { + "type": "string" + }, + "description": { + "type": "string" + } + } } + } + } + } + ] + } + }, + "securitySchemes": { + "bearerAuth": { + "type": "http", + "scheme": "bearer", + "bearerFormat": "JWT" + } + } + }, + "paths": { + "/credential/issue": { + "post": { + "tags": [ + "Credential" + ], + "summary": "Issue a credential.", + "description": "This endpoint issues a credential. As input it takes the list of attributes, subjectDid, context and expiration date of the credential to be issued.", + "security": [ + { + "bearerAuth": [] + } + ], + "requestBody": { + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "$ref": "#/components/schemas/CredentialRequest" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/CredentialRequest" + } } + } }, - "/did/{did}": { - "get": { - "tags": [ - "DID" - ], - "summary": "Resolve a DID", - "description": "

This endpoint resolved a DID

", - "parameters": [ - { - "in": "path", - "name": "did", - "schema": { - "type": "string" - }, - "required": true - } - ], - "responses": { - "200": { - "description": "The request was successful", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DidDocument" - } - } - } - }, - "400": { - "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Invalid Request" - } - } - } - }, - "401": { - "$ref": "#/components/schemas/UnauthorizedError" - }, - "500": { - "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Internal Error" - } - } - } - } + "responses": { + "200": { + "description": "The request was successful.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Credential" } + } } - }, - "/credential/issue": { - "post": { - "tags": [ - "Credential" - ], - "summary": "Issue a credential", - "description": "

This endpoint issues a credential. As input it takes the list of attributes, subjectDid, context and expiration date of the credential to be issued.

", - "security": [ - { - "bearerAuth": [] - } - ], - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "schema": { - "$ref": "#/components/schemas/CredentialRequest" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/CredentialRequest" - } - } - } + }, + "400": { + "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" }, - "responses": { - "200": { - "description": "The request was successful", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Credential" - } - } - } - }, - "400": { - "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Invalid Request" - } - } - } - }, - "401": { - "$ref": "#/components/schemas/UnauthorizedError" - }, - "500": { - "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Internal Error" - } - } - } - } + "example": { + "error": "Invalid Request" } + } } - }, - "/credential/verify": { - "post": { - "tags": [ - "Credential" - ], - "summary": "Verify a credential", - "description": "

This endpoint verifies the credential. As input it takes the entire credential itself or just the JWT string

", - "operationId": "verify", - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "schema": { - "$ref": "#/components/schemas/CredentialVerifyRequest" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/CredentialVerifyRequest" - } - } - } + }, + "401": { + "$ref": "#/components/schemas/UnauthorizedError" + }, + "500": { + "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" }, - "responses": { - "200": { - "description": "The request was successful", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/IVerifyResult" - } - } - } - }, - "400": { - "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Invalid Request" - } - } - } - }, - "401": { - "$ref": "#/components/schemas/UnauthorizedError" - }, - "500": { - "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Internal Error" - } - } - } - } + "example": { + "error": "Internal Error" } + } + } + } + } + } + }, + "/credential/verify": { + "post": { + "tags": [ + "Credential" + ], + "summary": "Verify a credential.", + "description": "This endpoint verifies the credential. As input it takes the entire credential itself or just the JWT string.", + "operationId": "verify", + "security": [ + { + "bearerAuth": [] + } + ], + "requestBody": { + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "$ref": "#/components/schemas/CredentialVerifyRequest" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/CredentialVerifyRequest" + } } + } }, - "/credential/revoke": { - "post": { - "tags": [ - "Credential" - ], - "summary": "Revoke a credential", - "description": "

This endpoint verifies the credential. As input it takes the entire credential itself or just the JWT string

", - "operationId": "revoke", - "security": [ - { - "bearerAuth": [] - } - ], - "parameters": [ - { - "in": "query", - "name": "publish", - "required": true, - "schema": { - "type": "boolean", - "default": true - } - } - ], - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "schema": { - "$ref": "#/components/schemas/CredentialRevokeRequest" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/CredentialRevokeRequest" - } - } - } + "responses": { + "200": { + "description": "The request was successful.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IVerifyResult" + } + } + } + }, + "400": { + "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" }, - "responses": { - "200": { - "description": "The request was successful", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/RevocationResult" - } - } - } - }, - "400": { - "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Invalid Request" - } - } - } - }, - "401": { - "$ref": "#/components/schemas/UnauthorizedError" - }, - "500": { - "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Internal Error" - } - } - } - } + "example": { + "error": "Invalid Request" } + } } - }, - "/credential/suspend": { - "post": { - "tags": [ - "Credential" - ], - "summary": "Suspend a credential", - "description": "

This endpoint suspends the credential. As input it takes the entire credential itself

", - "operationId": "suspend", - "security": [ - { - "bearerAuth": [] - } - ], - "parameters": [ - { - "in": "query", - "name": "publish", - "schema": { - "type": "boolean" - } - } - ], - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "schema": { - "$ref": "#/components/schemas/CredentialRevokeRequest" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/CredentialRevokeRequest" - } - } - } + }, + "401": { + "$ref": "#/components/schemas/UnauthorizedError" + }, + "500": { + "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" }, - "responses": { - "200": { - "description": "The request was successful", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SuspensionResult" - } - } - } - }, - "400": { - "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Invalid Request" - } - } - } - }, - "401": { - "$ref": "#/components/schemas/UnauthorizedError" - }, - "500": { - "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Internal Error" - } - } - } - } + "example": { + "error": "Internal Error" } + } + } + } + } + } + }, + "/credential/revoke": { + "post": { + "tags": [ + "Credential" + ], + "summary": "Revoke a credential.", + "description": "This endpoint verifies the credential. As input it takes the entire credential itself or just the JWT string.", + "operationId": "revoke", + "security": [ + { + "bearerAuth": [] + } + ], + "parameters": [ + { + "in": "query", + "name": "publish", + "required": true, + "schema": { + "type": "boolean", + "default": true + } + } + ], + "requestBody": { + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "$ref": "#/components/schemas/CredentialRevokeRequest" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/CredentialRevokeRequest" + } } + } }, - "/credential/reinstate": { - "post": { - "tags": [ - "Credential" - ], - "summary": "Reinstate a credential", - "description": "

This endpoint reinstates the credential. As input it takes the entire credential itself

", - "operationId": "reinstate", - "security": [ - { - "bearerAuth": [] - } - ], - "parameters": [ - { - "in": "query", - "name": "publish", - "schema": { - "type": "boolean" - } - } - ], - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "schema": { - "$ref": "#/components/schemas/CredentialRevokeRequest" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/CredentialRevokeRequest" - } - } - } + "responses": { + "200": { + "description": "The request was successful.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RevocationResult" + } + } + } + }, + "400": { + "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" }, - "responses": { - "200": { - "description": "The request was successful", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/UnSuspensionResult" - } - } - } - }, - "400": { - "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Invalid Request" - } - } - } - }, - "401": { - "$ref": "#/components/schemas/UnauthorizedError" - }, - "500": { - "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Internal Error" - } - } - } - } + "example": { + "error": "Invalid Request" } + } } - }, - "/presentation/verify": { - "post": { - "tags": [ - "Presentation" - ], - "summary": "Verify a credential presentation", - "description": "

This endpoint verifies the credential presentation. As input it takes the entire presentation itself

", - "operationId": "presentation", - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "schema": { - "$ref": "#/components/schemas/PresentationRequest" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/PresentationRequest" - } - } - } + }, + "401": { + "$ref": "#/components/schemas/UnauthorizedError" + }, + "500": { + "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" }, - "responses": { - "200": { - "description": "The request was successful", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/IVerifyResult" - } - } - } - }, - "400": { - "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Invalid Request" - } - } - } - }, - "401": { - "$ref": "#/components/schemas/UnauthorizedError" - }, - "500": { - "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Internal Error" - } - } - } - } + "example": { + "error": "Internal Error" } + } + } + } + } + } + }, + "/credential/suspend": { + "post": { + "tags": [ + "Credential" + ], + "summary": "Suspend a credential.", + "description": "This endpoint suspends the credential. As input it takes the entire credential itself.", + "operationId": "suspend", + "security": [ + { + "bearerAuth": [] + } + ], + "parameters": [ + { + "in": "query", + "name": "publish", + "schema": { + "type": "boolean" } + } + ], + "requestBody": { + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "$ref": "#/components/schemas/CredentialRevokeRequest" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/CredentialRevokeRequest" + } + } + } }, - "/account": { - "post": { - "tags": [ - "Account" - ], - "summary": "Create a client", - "description": "

This endpoint verifies the JWT token and creates a customer if they don't exist

", - "security": [ - { - "bearerAuth": [] - } - ], - "responses": { - "200": { - "description": "The request was successful", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Customer" - } - } - } - }, - "400": { - "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Invalid Request" - } - } - } - }, - "401": { - "$ref": "#/components/schemas/UnauthorizedError" - }, - "500": { - "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Internal Error" - } - } - } - } - } - }, - "get": { - "tags": [ - "Account" - ], - "summary": "Fetch a client", - "description": "

This endpoint verifies the JWT token and creates a customer if they don't exist

", - "security": [ - { - "bearerAuth": [] - } - ], - "responses": { - "200": { - "description": "The request was successful", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Customer" - } - } - } - }, - "400": { - "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Invalid Request" - } - } - } - }, - "401": { - "$ref": "#/components/schemas/UnauthorizedError" - }, - "500": { - "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Internal Error" - } - } - } - } + "responses": { + "200": { + "description": "The request was successful.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SuspensionResult" } + } } - }, - "/resource/create/{did}": { - "post": { - "tags": [ - "Resource" - ], - "summary": "Create a Resource", - "parameters": [ - { - "in": "path", - "name": "did", - "required": true, - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "schema": { - "$ref": "#/components/schemas/CreateResourceRequest" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreateResourceRequest" - } - } - } + }, + "400": { + "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" }, - "responses": { - "200": { - "description": "The resource is created successfully" - }, - "400": { - "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Invalid Request" - } - } - } - }, - "401": { - "$ref": "#/components/schemas/UnauthorizedError" - }, - "500": { - "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Internal Error" - } - } - } - } + "example": { + "error": "Invalid Request" } + } } - }, - "/credential-status/create": { - "post": { - "tags": [ - "Credential Status" - ], - "summary": "Create statuslist 2021", - "parameters": [ - { - "in": "query", - "name": "statusPurpose", - "required": true, - "schema": { - "type": "string", - "enum": [ - "revocation", - "suspension" - ] - } - }, - { - "in": "query", - "name": "encrypted", - "required": true, - "schema": { - "type": "boolean", - "default": false - } - } - ], - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "schema": { - "$ref": "#/components/schemas/CredentialStatusCreateRequest" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/CredentialStatusCreateRequest" - } - } - } + }, + "401": { + "$ref": "#/components/schemas/UnauthorizedError" + }, + "500": { + "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" }, - "responses": { - "200": { - "description": "StatusList is created successfully", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CredentialStatusResult" - } - } - } - }, - "400": { - "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Invalid Request" - } - } - } - }, - "401": { - "$ref": "#/components/schemas/UnauthorizedError" - }, - "500": { - "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Internal Error" - } - } - } - } + "example": { + "error": "Internal Error" } + } + } + } + } + } + }, + "/credential/reinstate": { + "post": { + "tags": [ + "Credential" + ], + "summary": "Reinstate a credential.", + "description": "This endpoint reinstates the credential. As input it takes the entire credential itself.", + "operationId": "reinstate", + "security": [ + { + "bearerAuth": [] + } + ], + "parameters": [ + { + "in": "query", + "name": "publish", + "schema": { + "type": "boolean" + } + } + ], + "requestBody": { + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "$ref": "#/components/schemas/CredentialRevokeRequest" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/CredentialRevokeRequest" + } } + } }, - "/credential-status/update": { - "post": { - "tags": [ - "Credential Status" - ], - "summary": "Publish statuslist 2021", - "parameters": [ - { - "in": "query", - "name": "statusAction", - "required": true, - "schema": { - "type": "string", - "enum": [ - "revoke", - "suspend", - "reinstate" - ] - } - }, - { - "in": "query", - "name": "publish", - "required": true, - "schema": { - "type": "boolean", - "default": true - } - } - ], - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "schema": { - "$ref": "#/components/schemas/CredentialStatusUpdateRequest" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/CredentialStatusUpdateRequest" - } - } - } - }, - "responses": { - "200": { - "description": "StatusList is published successfully", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CredentialStatusResult" - } - } - } - }, - "400": { - "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Invalid Request" - } - } - } - }, - "401": { - "$ref": "#/components/schemas/UnauthorizedError" - }, - "500": { - "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Internal Error" - } - } - } - } + "responses": { + "200": { + "description": "The request was successful.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UnSuspensionResult" } + } } - }, - "/credential-status/publish": { - "post": { - "tags": [ - "Credential Status" - ], - "summary": "Publish statuslist 2021", - "parameters": [ - { - "in": "query", - "name": "statusPurpose", - "required": true, - "schema": { - "type": "string", - "enum": [ - "revocation", - "suspension" - ] - } - }, - { - "in": "query", - "name": "encrypted", - "required": true, - "schema": { - "type": "boolean", - "default": false - } - } - ], - "requestBody": { - "content": { - "application/x-www-form-urlencoded": { - "schema": { - "$ref": "#/components/schemas/CredentialStatusPublishRequest" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/CredentialStatusPublishRequest" - } - } - } + }, + "400": { + "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" }, - "responses": { - "200": { - "description": "StatusList is published successfully", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CredentialStatusResult" - } - } - } - }, - "400": { - "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Invalid Request" - } - } - } - }, - "401": { - "$ref": "#/components/schemas/UnauthorizedError" - }, - "500": { - "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Internal Error" - } - } - } - } + "example": { + "error": "Invalid Request" } + } } - }, - "/credential-status/search": { - "get": { - "tags": [ - "Credential Status" - ], - "summary": "Fetch statusList's published by a DID", - "parameters": [ - { - "in": "query", - "name": "did", - "required": true, - "schema": { - "type": "string" - } - }, - { - "in": "query", - "name": "statusPurpose", - "schema": { - "type": "string", - "enum": [ - "revocation", - "suspension" - ] - } - }, - { - "in": "query", - "name": "statusListName", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "StatusList is fetched successfully", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "type": "object", - "properties": { - "statusListName": { - "type": "string" - }, - "statusListVersion": { - "type": "string" - }, - "statusListId": { - "type": "string" - }, - "statusListNextVersion": { - "type": "string" - } - } - } - } - } - } - }, - "400": { - "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Invalid Request" - } - } - } - }, - "401": { - "$ref": "#/components/schemas/UnauthorizedError" - }, - "500": { - "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/InvalidRequest" - }, - "example": { - "error": "Internal Error" - } - } - } - } + }, + "401": { + "$ref": "#/components/schemas/UnauthorizedError" + }, + "500": { + "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" + }, + "example": { + "error": "Internal Error" } + } } + } } + } }, - "components": { - "securitySchemes": { - "bearerAuth": { - "type": "http", - "scheme": "bearer", - "bearerFormat": "JWT" + "/presentation/verify": { + "post": { + "tags": [ + "Presentation" + ], + "summary": "Verify a credential presentation.", + "description": "This endpoint verifies the credential presentation. As input it takes the entire presentation itself.", + "operationId": "presentation", + "security": [ + { + "bearerAuth": [] + } + ], + "requestBody": { + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "$ref": "#/components/schemas/PresentationRequest" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/PresentationRequest" + } } + } }, - "schemas": { - "DidResult": { - "type": "object", - "properties": { - "did": { - "type": "string" - }, - "controllerKeyId": { - "type": "string" - }, - "keys": { - "type": "array", - "items": { - "type": "object" - } - }, - "services": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Service" - } - } + "responses": { + "200": { + "description": "The request was successful.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IVerifyResult" } - }, - "KeyResult": { - "type": "object", - "properties": { - "kid": { - "type": "string" - }, - "type": { - "type": "string", - "enum": [ - "Ed25519", - "Secp256k1" - ] - }, - "publicKeyHex": { - "type": "string" - } + } + } + }, + "400": { + "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" + }, + "example": { + "error": "Invalid Request" } - }, - "DidDocument": { - "description": "This input field contains a complete DID document", - "type": "object", - "properties": { - "context": { - "type": "array", - "items": { - "type": "string" - } - }, - "id": { - "type": "string", - "example": "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0" - }, - "controller": { - "type": "array", - "items": { - "type": "string" - }, - "example": [ - "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0" - ] - }, - "authentication": { - "type": "array", - "items": { - "type": "string" - }, - "example": [ - "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0#key-0" - ] - }, - "assertionMethod": { - "type": "array", - "items": { - "type": "string" - } - }, - "capabilityInvocation": { - "type": "array", - "items": { - "type": "string" - } - }, - "capabilityDelegation": { - "type": "array", - "items": { - "type": "string" - } - }, - "keyAgreement": { - "type": "array", - "items": { - "type": "string" - } - }, - "verificationMethod": { - "type": "array", - "items": { - "$ref": "#/components/schemas/VerificationMethod" - } - }, - "service": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Service" - } - } + } + } + }, + "401": { + "$ref": "#/components/schemas/UnauthorizedError" + }, + "500": { + "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" }, "example": { - "id": "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0", - "controller": [ - "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0" - ], - "verificationMethod": [ - { - "id": "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0#key-1", - "type": "Ed25519VerificationKey2018", - "controller": "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0", - "publicKeyBase58": "BTJiso1S4iSiReP6wGksSneGfiKHxz9SYcm2KknpqBJt" - } - ], - "authentication": [ - "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0#key-1" - ] + "error": "Internal Error" } - }, - "VerificationMethod": { - "type": "object", - "properties": { - "id": { - "type": "string", - "example": "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0#key-0" - }, - "type": { - "type": "string", - "example": "Ed25519VerificationKey2018" - }, - "controller": { - "type": "string", - "example": "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0" - }, - "publicKeyBase58": { - "type": "string", - "example": "so1S4iSiReP6wGksSneGfiKHxz9SYcm2KknpqBJt" - }, - "publicKeyMultibase": { - "type": "string", - "example": "BTJiso1S4iSiReP6wGksSneGfiKHxz9SYcm2KknpqBJt" - }, - "publicKeyJwk": { - "type": "array", - "items": { - "type": "string" - } - } + } + } + } + } + } + }, + "/account": { + "post": { + "tags": [ + "Account" + ], + "summary": "Create a client.", + "description": "This endpoint verifies the JWT token and creates a customer if they don't exist.", + "security": [ + { + "bearerAuth": [] + } + ], + "responses": { + "200": { + "description": "The request was successful.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Customer" + } + } + } + }, + "400": { + "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" }, "example": { - "controller": "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0", - "id": "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0#key-1", - "publicKeyBase58": "BTJiso1S4iSiReP6wGksSneGfiKHxz9SYcm2KknpqBJt", - "type": "Ed25519VerificationKey2018" + "error": "Invalid Request" } - }, - "Service": { - "type": "object", - "properties": { - "id": { - "type": "string", - "example": "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0#rand" - }, - "type": { - "type": "string", - "example": "rand" - }, - "serviceEndpoint": { - "type": "array", - "items": { - "type": "string" - }, - "example": [ - "https://rand.in" - ] - } + } + } + }, + "401": { + "$ref": "#/components/schemas/UnauthorizedError" + }, + "500": { + "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" + }, + "example": { + "error": "Internal Error" } - }, - "CredentialRequest": { - "description": "Input fields for the create operation.", - "type": "object", - "additionalProperties": false, - "properties": { - "issuerDid": { - "description": "This input field is the Issuer's DID", - "type": "string" - }, - "subjectDid": { - "description": "This input field is the holder's DID", - "type": "string" - }, - "attributes": { - "description": "Json input of the attributes", - "type": "object" - }, - "@context": { - "description": "Additional contexts to be included in the credential", - "type": "array", - "items": { - "type": "string" - } - }, - "type": { - "description": "Additional type property to be included in the credential", - "type": "array", - "items": { - "type": "string" - } - }, - "expirationDate": { - "description": "Optional expiration date according to the specification", - "type": "string" - }, - "format": { - "description": "Select one of the supported credential formats, jwt by default", - "type": "string", - "enum": [ - "jwt", - "lds" - ] - }, - "credentialStatus": { - "description": "Optional field to support revocation or suspension, which takes statusListName and statusListPurpose as inputs.", - "type": "object", - "required": [ - "statusPurpose", - "statusListName" - ], - "properties": { - "statusPurpose": { - "type": "string", - "enum": [ - "revocation", - "suspension" - ] - }, - "statusListName": { - "type": "string" - }, - "statusListIndex": { - "type": "number" - }, - "statusListVersipon": { - "type": "string" - }, - "statusListRangeStart": { - "type": "number" - }, - "statusListRangeEnd": { - "type": "number" - }, - "indexNotIn": { - "type": "number" - } - }, - "example": { - "statusPurpose": "revocation", - "statusListName": "employee-credentials" - } - } + } + } + } + } + }, + "get": { + "tags": [ + "Account" + ], + "summary": "Fetch a client.", + "description": "This endpoint verifies the JWT token and returns the customer if it exists.", + "security": [ + { + "bearerAuth": [] + } + ], + "responses": { + "200": { + "description": "The request was successful.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Customer" + } + } + } + }, + "400": { + "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" }, - "required": [ - "issuerDid", - "subjectDid", - "attributes" - ], "example": { - "issuerDid": "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0", - "subjectDid": "did:key:z6MkhaXgBZDvotDkL5257faiztiGiC2QtKLGpbnnEGta2doK", - "attributes": { - "gender": "male", - "name": "Bob" - }, - "@context": [ - "https://schema.org" - ], - "type": [ - "Person" - ], - "format": "jwt", - "credentialStatus": { - "statusPurpose": "revocation", - "statusListName": "employee-credentials", - "statusListIndex": 10 - } + "error": "Invalid Request" } - }, - "Credential": { - "description": "Input fields for the update operation.", - "type": "object", - "additionalProperties": false, - "properties": { - "@context": { - "type": "array", - "items": { - "type": "string" - } - }, - "type": { - "type": "array", - "items": { - "type": "string" - } - }, - "expirationDate": { - "type": "string" - }, - "issuer": { - "type": "object", - "properties": { - "id": { - "type": "string" - } - } - }, - "credentialSubject": { - "type": "object", - "properties": { - "id": { - "type": "string" - } - } - }, - "credentialStatus": { - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "statusListIndex": { - "type": "string" - }, - "statusPurpose": { - "type": "string", - "enum": [ - "revocation", - "suspension" - ] - }, - "type": { - "type": "string", - "enum": [ - "StatusList2021Entry" - ] - } - } - }, - "issuanceDate": { - "type": "string" - }, - "proof": { - "type": "object", - "properties": { - "type": { - "type": "string" - }, - "jwt": { - "type": "string" - } - } - } + } + } + }, + "401": { + "$ref": "#/components/schemas/UnauthorizedError" + }, + "500": { + "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" }, "example": { - "@context": [ - "https://www.w3.org/2018/credentials/v1", - "https://schema.org", - "https://veramo.io/contexts/profile/v1" - ], - "credentialSubject": { - "gender": "male", - "id": "did:key:z6MkhaXgBZDvotDkL5257faiztiGiC2QtKLGpbnnEGta2doK", - "name": "Bob" - }, - "credentialStatus": { - "id": "https://resolver.cheqd.net/1.0/identifiers/did:cheqd:testnet:7c2b990c-3d05-4ebf-91af-f4f4d0091d2e?resourceName=cheqd-suspension-1&resourceType=StatusList2021Suspension#20", - "statusListIndex": "20", - "statusPurpose": "suspension", - "type": "StatusList2021Entry" - }, - "issuanceDate": "2023-06-08T13:49:28.000Z", - "issuer": { - "id": "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0" - }, - "proof": { - "jwt": "eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJkaWQ6Y2hlcWQ6dGVzdG5ldDo3YmY4MWEyMC02MzNjLTRjYzctYmM0YS01YTQ1ODAxMDA1ZTAiLCJuYmYiOjE2ODYyMzIxNjgsInN1YiI6ImRpZDprZXk6ejZNa2hhWGdCWkR2b3REa0w1MjU3ZmFpenRpR2lDMlF0S0xHcGJubkVHdGEyZG9LIiwidmMiOnsiQGNvbnRleHQiOlsiaHR0cHM6Ly93d3cudzMub3JnLzIwMTgvY3JlZGVudGlhbHMvdjEiLCJodHRwczovL3NjaGVtYS5vcmciLCJodHRwczovL3ZlcmFtby5pby9jb250ZXh0cy9wcm9maWxlL3YxIl0sImNyZWRlbnRpYWxTdWJqZWN0Ijp7ImdlbmRlciI6Im1hbGUiLCJuYW1lIjoiQm9iIn0sInR5cGUiOlsiVmVyaWZpYWJsZUNyZWRlbnRpYWwiLCJQZXJzb24iXX19.wMfdR6RtyAZA4eoWya5Aw97wwER2Cm5Guk780Xw8H9fA3sfudIJeLRLboqixpTchqSbYeA7KbuCTAnLgXTD_Cg", - "type": "JwtProof2020" - }, - "type": [ - "VerifiableCredential", - "Person" - ] + "error": "Internal Error" } - }, - "Customer": { - "type": "object", - "properties": { - "customerId": { - "type": "string" - }, - "address": { - "type": "string" - } + } + } + } + } + } + }, + "/key/create": { + "post": { + "tags": [ + "Key" + ], + "summary": "Create a key pair.", + "security": [ + { + "bearerAuth": [] + } + ], + "responses": { + "200": { + "description": "The request was successful.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/KeyResult" + } + } + } + }, + "400": { + "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" + }, + "example": { + "error": "Invalid Request" + } + } + } + }, + "401": { + "$ref": "#/components/schemas/UnauthorizedError" + }, + "500": { + "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" + }, + "example": { + "error": "Internal Error" } + } + } + } + } + } + }, + "/key/{kid}": { + "get": { + "tags": [ + "Key" + ], + "summary": "Fetch a key pair.", + "security": [ + { + "bearerAuth": [] + } + ], + "parameters": [ + { + "name": "kid", + "in": "path", + "schema": { + "type": "string" }, - "InvalidRequest": { - "type": "object", - "properties": { - "error": { - "type": "string" - } + "required": true + } + ], + "responses": { + "200": { + "description": "The request was successful.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/KeyResult" } - }, - "UnauthorizedError": { - "description": "Access token is missing or invalid", - "type": "object", - "properties": { - "error": { - "type": "string" - } + } + } + }, + "400": { + "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" }, "example": { - "error": "Unauthorized Error" + "error": "Invalid Request" } - }, - "IVerifyResult": { - "type": "object", - "properties": { - "verified": { - "type": "boolean" - }, - "issuer": { - "type": "string" - }, - "signer": { - "type": "object" - }, - "jwt": { - "type": "string" - }, - "verifiableCredential": { - "type": "object" - } + } + } + }, + "401": { + "$ref": "#/components/schemas/UnauthorizedError" + }, + "500": { + "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" }, "example": { - "verified": true, - "policies": {}, - "issuer": "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0", - "signer": { - "controller": "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0", - "id": "did:cheqd:testnet:7bf81a20-633c-4cc7-bc4a-5a45801005e0#key-1", - "publicKeyBase58": "BTJiso1S4iSiReP6wGksSneGfiKHxz9SYcm2KknpqBJt", - "type": "Ed25519VerificationKey2018" - } + "error": "Internal Error" } - }, - "CreateResourceRequest": { - "description": "Input fields for the resource creation", + } + } + } + } + } + }, + "/did/create": { + "post": { + "tags": [ + "DID" + ], + "summary": "Create a DID.", + "description": "This endpoint creates a DID by taking DID document or a verification method as an input.", + "security": [ + { + "bearerAuth": [] + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { "type": "object", - "additionalProperties": false, "required": [ - "name", - "type", - "data", - "encoding" + "options" ], "properties": { - "data": { - "description": "Provide encoded string for the resource data", - "type": "string" - }, - "encoding": { - "description": "The encoding format of the resource data", + "options": { + "type": "object", + "properties": { + "network": { "type": "string", "enum": [ - "base64url", - "base64", - "hex" + "testnet", + "mainnet" ] - }, - "name": { - "description": "Resource name", - "type": "string" - }, - "type": { - "description": "Resource type", - "type": "string" - }, - "alsoKnownAs": { - "type": "array", - "items": { - "type": "object", - "properties": { - "uri": { - "type": "string" - }, - "description": { - "type": "string" - } - } + }, + "methodSpecificIdAlgo": { + "type": "string", + "enum": [ + "uuid", + "base58btc" + ] + } + } + }, + "secret": { + "type": "object", + "properties": { + "verificationMethod": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "Ed25519VerificationKey2018", + "Ed25519VerificationKey2020", + "JsonWebKey2020S" + ] + }, + "id": { + "type": "string", + "example": "key-1" + } } - }, - "version": { - "type": "string" + } } + }, + "didDocument": { + "$ref": "#/components/schemas/DidDocument" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "The request was successful.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DidResult" + } + } + } + }, + "400": { + "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" }, "example": { - "data": "SGVsbG8gV29ybGQ=", - "name": "ResourceName", - "type": "TextDocument" + "error": "Invalid Request" } - }, - "RevocationResult": { - "properties": { - "revoked": { - "type": "boolean" - } + } + } + }, + "401": { + "$ref": "#/components/schemas/UnauthorizedError" + }, + "500": { + "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" + }, + "example": { + "error": "Internal Error" } + } + } + } + } + } + }, + "/did/update": { + "post": { + "tags": [ + "DID" + ], + "summary": "Update a DID.", + "description": "This endpoint updates a DID by taking DID document or the particular fields needed to be updated.", + "security": [ + { + "bearerAuth": [] + } + ], + "requestBody": { + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "$ref": "#/components/schemas/DidUpdateRequest" + } }, - "SuspensionResult": { - "properties": { - "suspended": { - "type": "boolean" - }, - "statusList": { - "type": "string" - } + "application/json": { + "schema": { + "$ref": "#/components/schemas/DidUpdateRequest" + } + } + } + }, + "responses": { + "200": { + "description": "The request was successful.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DidResult" } - }, - "UnSuspensionResult": { - "properties": { - "unsuspended": { - "type": "boolean" - }, - "statusList": { - "type": "string" - } + } + } + }, + "400": { + "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" + }, + "example": { + "error": "Invalid Request" } - }, - "DIDCreateRequest": { - "type": "object", - "properties": { - "network": { - "type": "string", - "enum": [ - "testnet", - "mainnet" - ] - }, - "methodSpecificIdAlgo": { - "type": "string", - "enum": [ - "uuid", - "base58btc" - ] - }, - "verificationMethodType": { - "type": "string", - "enum": [ - "Ed25519VerificationKey2018", - "JsonWebKey2020", - "Ed25519VerificationKey2020" - ] - }, - "serviceEndpoint": { - "type": "string" - }, - "assertionMethod": { - "description": "An assertion method is required to issue JSONLD credentials", - "type": "boolean", - "default": true - }, - "didDocument": { - "$ref": "#/components/schemas/DidDocument" - } + } + } + }, + "401": { + "$ref": "#/components/schemas/UnauthorizedError" + }, + "500": { + "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" + }, + "example": { + "error": "Internal Error" } + } + } + } + } + } + }, + "/did/deactivate/{did}": { + "post": { + "tags": [ + "DID" + ], + "summary": "Deactivate a DID.", + "description": "This endpoint deactivates a DID by taking DID document or a verification method as an input.", + "security": [ + { + "bearerAuth": [] + } + ], + "parameters": [ + { + "in": "path", + "name": "did", + "schema": { + "type": "string" }, - "DIDUpdateRequest": { - "type": "object", - "properties": { - "did": { - "type": "string" - }, - "service": { - "type": "array", - "description": "This input field assigns the provided service array to the didDocument", - "items": { - "$ref": "#/components/schemas/Service" - } - }, - "verificationMethod": { - "type": "array", - "description": "This input field assigns the provided verificationMethod array to the didDocument", - "items": { - "$ref": "#/components/schemas/VerificationMethod" - } - }, - "authentication": { - "description": "This input field assigns the provided authentication array to the didDocument", - "type": "array", - "items": { - "type": "string" - } - }, - "didDocument": { - "$ref": "#/components/schemas/DidDocument" - } + "required": true + } + ], + "responses": { + "200": { + "description": "The request was successful.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DidResult" + } + } + } + }, + "400": { + "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" + }, + "example": { + "error": "Invalid Request" + } + } + } + }, + "401": { + "$ref": "#/components/schemas/UnauthorizedError" + }, + "500": { + "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" + }, + "example": { + "error": "Internal Error" } + } + } + } + } + } + }, + "/resource/create/{did}": { + "post": { + "tags": [ + "Resource" + ], + "summary": "Create a Resource.", + "parameters": [ + { + "in": "path", + "name": "did", + "schema": { + "type": "string" }, - "CredentialVerifyRequest": { - "type": "object", - "properties": { - "credential": { - "description": "This input field takes the credential object or the JWT string", - "allOf": [ - { - "type": "object" - }, - { - "type": "string" - } - ] - } + "required": true + } + ], + "requestBody": { + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "$ref": "#/components/schemas/CreateResourceRequest" + } + }, + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateResourceRequest" + } + } + } + }, + "responses": { + "200": { + "description": "The request was successful." + }, + "400": { + "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" + }, + "example": { + "error": "Invalid Request" + } + } + } + }, + "401": { + "$ref": "#/components/schemas/UnauthorizedError" + }, + "500": { + "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" + }, + "example": { + "error": "Internal Error" + } + } + } + } + } + } + }, + "/did/list": { + "get": { + "tags": [ + "DID" + ], + "summary": "Fetch DIDs from wallet.", + "description": "This endpoint returns the list of DIDs controlled by the account.", + "security": [ + { + "bearerAuth": [] + } + ], + "responses": { + "200": { + "description": "The request was successful.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + }, + "400": { + "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" + }, + "example": { + "error": "Invalid Request" + } + } + } + }, + "401": { + "$ref": "#/components/schemas/UnauthorizedError" + }, + "500": { + "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" + }, + "example": { + "error": "Internal Error" } + } + } + } + } + } + }, + "/did/{did}": { + "get": { + "tags": [ + "DID" + ], + "summary": "Resolve a DID.", + "description": "This endpoint resolved a DID.", + "parameters": [ + { + "in": "path", + "name": "did", + "schema": { + "type": "string" }, - "CredentialRevokeRequest": { - "type": "object", - "properties": { - "credential": { - "description": "This input field takes the credential object or the JWT string", - "oneOf": [ - { - "type": "object" - }, - { - "type": "string" - } - ] - } + "required": true + } + ], + "responses": { + "200": { + "description": "The request was successful.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DidDocument" + } + } + } + }, + "400": { + "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" + }, + "example": { + "error": "Invalid Request" + } + } + } + }, + "401": { + "$ref": "#/components/schemas/UnauthorizedError" + }, + "500": { + "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" + }, + "example": { + "error": "Internal Error" } + } + } + } + } + } + }, + "/credential-status/create": { + "post": { + "tags": [ + "Credential Status" + ], + "summary": "Create status list 2021.", + "parameters": [ + { + "in": "query", + "name": "statusPurpose", + "required": true, + "schema": { + "type": "string", + "enum": [ + "revocation", + "suspension" + ] + } + }, + { + "in": "query", + "name": "encrypted", + "required": true, + "schema": { + "type": "boolean", + "default": false + } + } + ], + "requestBody": { + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "$ref": "#/components/schemas/CredentialStatusCreateRequest" + } }, - "CredentialStatusCreateRequest": { - "allOf": [ - { - "type": "object", - "required": [ - "did", - "statusListName" - ], - "properties": { - "did": { - "description": "The DID of the statuslist publisher", - "type": "string" - }, - "statusListName": { - "description": "The name of the statusList to be created", - "type": "string" - }, - "length": { - "description": "The length of the statusList to be created, The default and minimum length is 140000 which is 16kb", - "type": "number" - }, - "encoding": { - "description": "The encoding format of the statusList to be published", - "type": "string", - "default": "base64url", - "enum": [ - "base64url", - "base64", - "hex" - ] - }, - "statusListVersion": { - "description": "This input field is OPTIONAL, If present assigns the version to be assigned to the statusList", - "type": "string" - }, - "alsoKnownAs": { - "description": "The input field is OPTIONAL. If present, the value MUST be a set where each item in the set is a uri", - "type": "array", - "items": { - "type": "object", - "properties": { - "uri": { - "type": "string" - }, - "description": { - "type": "string" - } - } - } - } - } - } - ], + "application/json": { + "schema": { + "$ref": "#/components/schemas/CredentialStatusCreateRequest" + } + } + } + }, + "responses": { + "200": { + "description": "The request was successful.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CredentialStatusResult" + } + } + } + }, + "400": { + "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" + }, + "example": { + "error": "Invalid Request" + } + } + } + }, + "401": { + "$ref": "#/components/schemas/UnauthorizedError" + }, + "500": { + "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" + }, "example": { - "did": "did:cheqd:testnet:7c2b990c-3d05-4ebf-91af-f4f4d0091d2e", - "statusListName": "cheqd-employee-credentials" + "error": "Internal Error" } + } + } + } + } + } + }, + "/credential-status/publish": { + "post": { + "tags": [ + "Credential Status" + ], + "summary": "Publish status list 2021.", + "parameters": [ + { + "in": "query", + "name": "statusPurpose", + "required": true, + "schema": { + "type": "string", + "enum": [ + "revocation", + "suspension" + ] + } + }, + { + "in": "query", + "name": "encrypted", + "required": true, + "schema": { + "type": "boolean", + "default": false + } + } + ], + "requestBody": { + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "$ref": "#/components/schemas/CredentialStatusPublishRequest" + } }, - "CredentialStatusUpdateRequest": { - "type": "object", - "required": [ - "did", - "statusListName", - "indices" - ], - "properties": { - "did": { - "description": "The DID of the statuslist publisher", + "application/json": { + "schema": { + "$ref": "#/components/schemas/CredentialStatusPublishRequest" + } + } + } + }, + "responses": { + "200": { + "description": "The request was successful.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CredentialStatusPublishRequest" + } + } + } + }, + "400": { + "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" + }, + "example": { + "error": "Invalid Request" + } + } + } + }, + "401": { + "$ref": "#/components/schemas/UnauthorizedError" + }, + "500": { + "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" + }, + "example": { + "error": "Internal Error" + } + } + } + } + } + } + }, + "/credential-status/search": { + "get": { + "tags": [ + "Credential Status" + ], + "summary": "Fetch statusList's published by a DID.", + "parameters": [ + { + "in": "query", + "name": "did", + "required": true, + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "statusPurpose", + "schema": { + "type": "string", + "enum": [ + "revocation", + "suspension" + ] + } + }, + { + "in": "query", + "name": "statusListName", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "The request was successful.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "object", + "properties": { + "statusListName": { "type": "string" - }, - "statusListName": { - "description": "The name of the statusList to be created", + }, + "statusListVersion": { "type": "string" - }, - "indices": { - "description": "Provide the list of indices to be updated", - "type": "array", - "items": { - "type": "number" - } - }, - "statusListVersion": { - "description": "This input field is OPTIONAL, If present uses the provided statusListVersion for the update operation", + }, + "statusListId": { + "type": "string" + }, + "statusListNextVersion": { "type": "string" + } } + } } - }, - "CredentialStatusPublishRequest": { - "allOf": [ - { - "type": "object", - "required": [ - "did", - "encodedList", - "statusListName", - "encoding" - ], - "properties": { - "did": { - "description": "The DID of the statuslist publisher", - "type": "string" - }, - "statusListName": { - "description": "The name of the statusList to be published", - "type": "string" - }, - "encodedList": { - "description": "Provide encoded string for the resource data", - "type": "string" - }, - "encoding": { - "description": "The encoding format of the statusList provided", - "type": "string", - "enum": [ - "base64url", - "base64", - "hex" - ] - }, - "statusListVersion": { - "description": "This input field is OPTIONAL, If present assigns the version to be assigned to the statusList", - "type": "string" - }, - "alsoKnownAs": { - "description": "The input field is OPTIONAL. If present, the value MUST be a set where each item in the set is a uri", - "type": "array", - "items": { - "type": "object", - "properties": { - "uri": { - "type": "string" - }, - "description": { - "type": "string" - } - } - } - } - } - } - ], + } + } + }, + "400": { + "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" + }, "example": { - "did": "did:cheqd:testnet:7c2b990c-3d05-4ebf-91af-f4f4d0091d2e", - "name": "cheqd-employee-credentials", - "version": "2023", - "data": "H4sIAAAAAAAAA-3BAQ0AAADCoPdPbQ8HFAAAAAAAAAAAAAAAAAAAAADwaDhDr_xcRAAA", - "encoding": "base64url" + "error": "Invalid Request" } - }, - "PresentationRequest": { - "type": "object", - "required": [ - "presentation" - ], - "properties": { - "presentation": { - "description": "This input field takes the presentation object or the JWT string", - "allOf": [ - { - "type": "string" - }, - { - "type": "object" - } - ] - } + } + } + }, + "401": { + "$ref": "#/components/schemas/UnauthorizedError" + }, + "500": { + "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" + }, + "example": { + "error": "Internal Error" } + } + } + } + } + } + }, + "/credential-status/update": { + "post": { + "tags": [ + "Credential Status" + ], + "summary": "Update status list 2021.", + "parameters": [ + { + "in": "query", + "name": "statusPurpose", + "required": true, + "schema": { + "type": "string", + "enum": [ + "revocation", + "suspension" + ] + } + }, + { + "in": "query", + "name": "encrypted", + "required": true, + "schema": { + "type": "boolean", + "default": false + } + } + ], + "requestBody": { + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "$ref": "#/components/schemas/CredentialStatusPublishRequest" + } }, - "CredentialStatusResult": { - "type": "object", - "properties": { - "success": { - "type": "object", - "properties": { - "created": { - "type": "boolean" - }, - "resourceNetadata": { - "type": "object" - }, - "statusList2021": { - "type": "object", - "properties": { - "StatusList2021": { - "type": "object", - "properties": { - "encodedList": { - "type": "string" - }, - "type": { - "type": "string" - }, - "validFrom": { - "type": "string" - } - } - } - } - }, - "metadata": { - "type": "string", - "properties": { - "encoding": { - "type": "string" - }, - "encrypted": { - "type": "boolean" - } - } - } - } - } + "application/json": { + "schema": { + "$ref": "#/components/schemas/CredentialStatusPublishRequest" + } + } + } + }, + "responses": { + "200": { + "description": "The request was successful.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CredentialStatusResult" + } + } + } + }, + "400": { + "description": "A problem with the input fields has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" }, "example": { - "created": true, - "resource": { - "StatusList2021": { - "encodedList": "H4sIAAAAAAAAA-3BAQ0AAADCoPdPbQ8HFAAAAAAAAAAAAAAAAAAAAADwaDhDr_xcRAAA", - "type": "StatusList2021Revocation", - "validFrom": "2023-06-26T11:45:19.349Z" - }, - "metadata": { - "encoding": "base64url", - "encrypted": false - } - }, - "resourceMetadata": { - "checksum": "909e22e371a41afbb96c330a97752cf7c8856088f1f937f87decbef06cbe9ca2", - "created": "2023-06-26T11:45:20Z", - "mediaType": "application/json", - "nextVersionId": null, - "previousVersionId": null, - "resourceCollectionId": "7c2b990c-3d05-4ebf-91af-f4f4d0091d2e", - "resourceId": "5945233a-a4b5-422b-b893-eaed5cedd2dc", - "resourceName": "cheqd-revocation-1", - "resourceType": "StatusList2021Revocation", - "resourceURI": "did:cheqd:testnet:7c2b990c-3d05-4ebf-91af-f4f4d0091d2e/resources/5945233a-a4b5-422b-b893-eaed5cedd2dc", - "resourceVersion": "2023-06-26T11:45:19.349Z" - } + "error": "Invalid Request" + } + } + } + }, + "401": { + "$ref": "#/components/schemas/UnauthorizedError" + }, + "500": { + "description": "An internal error has occurred. Additional state information plus metadata may be available in the response body.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/InvalidRequest" + }, + "example": { + "error": "Internal Error" } + } } + } } + } } + } } \ No newline at end of file