Credential Schema APIs

Get credential schema by tags

get
Authorizations
Query parameters
tagsstringOptionalExample: tag1,tag2
Responses
201
Credential Schemas
application/json
get
GET /api/v1/credential-schema HTTP/1.1
Host: sunbirdrc.dev
Token: YOUR_API_KEY
Accept: */*
[
  {
    "schema": {
      "type": "text",
      "id": "did:cred-schema:MDP8AsFhHzhwUvGNuYkX7T/06e126d1-fa44-4882-a243-1e326fbe21db;version=1.1",
      "version": "text",
      "name": "text",
      "author": "text",
      "authored": "text",
      "schema": "{\"$schema\":\"https://json-schema.org/draft/2020-12/schema\",\"description\":\"Email\",\"type\":\"object\",\"properties\":{\"emailAddress\":{\"type\":\"string\",\"format\":\"email\"}},\"required\":[\"emailAddress\"],\"additionalProperties\":false}",
      "proof": {}
    },
    "tags": [
      "text"
    ],
    "status": "DRAFT",
    "createdAt": "text",
    "updatedAt": "text",
    "createdBy": "text",
    "updatedBy": "text"
  }
]

Create credential schema

post
Authorizations
Body
tagsstring[]Optional
statusstring · enumOptionalPossible values:
Responses
201
Credential Schema successfully created!
application/json
post
POST /api/v1/credential-schema HTTP/1.1
Host: sunbirdrc.dev
Token: YOUR_API_KEY
Content-Type: appliation/json
Accept: */*
Content-Length: 479

{
  "schema": {
    "type": "text",
    "id": "did:cred-schema:MDP8AsFhHzhwUvGNuYkX7T/06e126d1-fa44-4882-a243-1e326fbe21db;version=1.1",
    "version": "text",
    "name": "text",
    "author": "text",
    "authored": "text",
    "schema": "{\"$schema\":\"https://json-schema.org/draft/2020-12/schema\",\"description\":\"Email\",\"type\":\"object\",\"properties\":{\"emailAddress\":{\"type\":\"string\",\"format\":\"email\"}},\"required\":[\"emailAddress\"],\"additionalProperties\":false}"
  },
  "tags": [
    "text"
  ],
  "status": "DRAFT"
}
{
  "schema": {
    "type": "text",
    "id": "did:cred-schema:MDP8AsFhHzhwUvGNuYkX7T/06e126d1-fa44-4882-a243-1e326fbe21db;version=1.1",
    "version": "text",
    "name": "text",
    "author": "text",
    "authored": "text",
    "schema": "{\"$schema\":\"https://json-schema.org/draft/2020-12/schema\",\"description\":\"Email\",\"type\":\"object\",\"properties\":{\"emailAddress\":{\"type\":\"string\",\"format\":\"email\"}},\"required\":[\"emailAddress\"],\"additionalProperties\":false}",
    "proof": {}
  },
  "tags": [
    "text"
  ],
  "status": "DRAFT",
  "createdAt": "text",
  "updatedAt": "text",
  "createdBy": "text",
  "updatedBy": "text"
}

Get credential schema by id

get
Authorizations
Path parameters
idstringRequired
Responses
200
Response
application/json
get
GET /api/v1/credential-schema/{id} HTTP/1.1
Host: sunbirdrc.dev
Token: YOUR_API_KEY
Accept: */*
{
  "schema": {
    "type": "text",
    "id": "did:cred-schema:MDP8AsFhHzhwUvGNuYkX7T/06e126d1-fa44-4882-a243-1e326fbe21db;version=1.1",
    "version": "text",
    "name": "text",
    "author": "text",
    "authored": "text",
    "schema": "{\"$schema\":\"https://json-schema.org/draft/2020-12/schema\",\"description\":\"Email\",\"type\":\"object\",\"properties\":{\"emailAddress\":{\"type\":\"string\",\"format\":\"email\"}},\"required\":[\"emailAddress\"],\"additionalProperties\":false}",
    "proof": {}
  },
  "tags": [
    "text"
  ],
  "status": "DRAFT",
  "createdAt": "text",
  "updatedAt": "text",
  "createdBy": "text",
  "updatedBy": "text"
}

Update credential schema by id

put

If the schema is updated, a new semver will be generated and the old one will be deprecated. If only metadata (like tags/status) is updated, the semver will not be generated

Authorizations
Path parameters
idstringRequired
Body
tagsstring[]Optional
statusstring · enumOptionalPossible values:
Responses
200
Credential Schema successfully updated!
application/json
Responseall of
put
PUT /api/v1/credential-schema/{id} HTTP/1.1
Host: sunbirdrc.dev
Token: YOUR_API_KEY
Content-Type: appliation/json
Accept: */*
Content-Length: 479

{
  "schema": {
    "type": "text",
    "id": "did:cred-schema:MDP8AsFhHzhwUvGNuYkX7T/06e126d1-fa44-4882-a243-1e326fbe21db;version=1.1",
    "version": "text",
    "name": "text",
    "author": "text",
    "authored": "text",
    "schema": "{\"$schema\":\"https://json-schema.org/draft/2020-12/schema\",\"description\":\"Email\",\"type\":\"object\",\"properties\":{\"emailAddress\":{\"type\":\"string\",\"format\":\"email\"}},\"required\":[\"emailAddress\"],\"additionalProperties\":false}"
  },
  "tags": [
    "text"
  ],
  "status": "DRAFT"
}
{
  "schema": {
    "type": "text",
    "id": "did:cred-schema:MDP8AsFhHzhwUvGNuYkX7T/06e126d1-fa44-4882-a243-1e326fbe21db;version=1.1",
    "version": "text",
    "name": "text",
    "author": "text",
    "authored": "text",
    "schema": "{\"$schema\":\"https://json-schema.org/draft/2020-12/schema\",\"description\":\"Email\",\"type\":\"object\",\"properties\":{\"emailAddress\":{\"type\":\"string\",\"format\":\"email\"}},\"required\":[\"emailAddress\"],\"additionalProperties\":false}",
    "proof": {}
  },
  "tags": [
    "text"
  ],
  "status": "DRAFT",
  "createdAt": "text",
  "updatedAt": "text",
  "createdBy": "text",
  "updatedBy": "text",
  "deprecatedId": "text"
}

Get rendering templates by schema id

get
Authorizations
Query parameters
schemaIdstringRequired
Responses
200
Response
application/json
Responseall of
get
GET /api/v1/template HTTP/1.1
Host: sunbirdrc.dev
Token: YOUR_API_KEY
Accept: */*
{
  "template": "text",
  "schemaId": "did:cred-schema:MDP8AsFhHzhwUvGNuYkX7T/06e126d1-fa44-4882-a243-1e326fbe21db;version=1.1",
  "templateId": "did:cred-template:MDP8AsFhHzhwUvGNuYkX7T/06e126d1-fa44-4882-a243-1e326fbe21dc;version=1.1",
  "createdAt": "text",
  "updatedAt": "text",
  "createdBy": "text",
  "updatedBy": "text"
}

Create redenring templates

post
Authorizations
Body
templatestringOptional

It should be valid string in handlebar format

schemaIdstringOptionalExample: did:cred-schema:MDP8AsFhHzhwUvGNuYkX7T/06e126d1-fa44-4882-a243-1e326fbe21db;version=1.1
Responses
201
Rendering template successfully created!
application/json
Responseall of
post
POST /api/v1/template HTTP/1.1
Host: sunbirdrc.dev
Token: YOUR_API_KEY
Content-Type: appliation/json
Accept: */*
Content-Length: 120

{
  "template": "text",
  "schemaId": "did:cred-schema:MDP8AsFhHzhwUvGNuYkX7T/06e126d1-fa44-4882-a243-1e326fbe21db;version=1.1"
}
{
  "template": "text",
  "schemaId": "did:cred-schema:MDP8AsFhHzhwUvGNuYkX7T/06e126d1-fa44-4882-a243-1e326fbe21db;version=1.1",
  "templateId": "did:cred-template:MDP8AsFhHzhwUvGNuYkX7T/06e126d1-fa44-4882-a243-1e326fbe21dc;version=1.1",
  "createdAt": "text",
  "updatedAt": "text",
  "createdBy": "text",
  "updatedBy": "text"
}

Get rendering templates by id

get
Authorizations
Path parameters
idstringRequired
Responses
200
Response
application/json
Responseall of
get
GET /api/v1/template/{id} HTTP/1.1
Host: sunbirdrc.dev
Token: YOUR_API_KEY
Accept: */*
{
  "template": "text",
  "schemaId": "did:cred-schema:MDP8AsFhHzhwUvGNuYkX7T/06e126d1-fa44-4882-a243-1e326fbe21db;version=1.1",
  "templateId": "did:cred-template:MDP8AsFhHzhwUvGNuYkX7T/06e126d1-fa44-4882-a243-1e326fbe21dc;version=1.1",
  "createdAt": "text",
  "updatedAt": "text",
  "createdBy": "text",
  "updatedBy": "text"
}

Update rendering templates by id

put

Create a new version of template

Authorizations
Path parameters
idstringRequired
Body
templatestringOptional

It should be valid string in handlebar format

schemaIdstringOptionalExample: did:cred-schema:MDP8AsFhHzhwUvGNuYkX7T/06e126d1-fa44-4882-a243-1e326fbe21db;version=1.1
Responses
200
Rendering template successfully updated!
application/json
Responseall of
put
PUT /api/v1/template/{id} HTTP/1.1
Host: sunbirdrc.dev
Token: YOUR_API_KEY
Content-Type: appliation/json
Accept: */*
Content-Length: 120

{
  "template": "text",
  "schemaId": "did:cred-schema:MDP8AsFhHzhwUvGNuYkX7T/06e126d1-fa44-4882-a243-1e326fbe21db;version=1.1"
}
{
  "template": "text",
  "schemaId": "did:cred-schema:MDP8AsFhHzhwUvGNuYkX7T/06e126d1-fa44-4882-a243-1e326fbe21db;version=1.1",
  "templateId": "did:cred-template:MDP8AsFhHzhwUvGNuYkX7T/06e126d1-fa44-4882-a243-1e326fbe21dc;version=1.1",
  "createdAt": "text",
  "updatedAt": "text",
  "createdBy": "text",
  "updatedBy": "text"
}

Delete rendering templates by id

delete
Authorizations
Path parameters
idstringRequired
Responses
200
Credential Schema successfully deleted!
delete
DELETE /api/v1/template/{id} HTTP/1.1
Host: sunbirdrc.dev
Token: YOUR_API_KEY
Accept: */*

No content

Last updated