Disco Docs
DiscoDashboardGithubDiscordIRLCampaigns
  • Welcome
    • ⚪Welcome to Disco
      • 🎒Data Backpacks
      • 🧱About DIDs and VCs
      • ♻️Lifecycle of Credentials
    • ⚡️ Quickstart Guide
  • Getting Started
    • 🖌️Customize Credential Branding
    • 🔑Generate an API Key
    • 📊Dashboard
    • ⛓️Onchain Data
    • 📁 Select a Credential Schema
    • 🚀Build & Issue Credentials
    • 📖Credential Data Model
    • ⚙️Disco APIs
      • Programmatically Issue a Credential
      • Retrieve a Credential
      • Verify a Credential
      • Personas
    • ⚙️Disco SDK: Selective Disclosure
      • Implementation
  • Learn more
    • 👋Data Backpacks for Holders
      • ♻️The 3-Sided Marketplace of Verifiable Data
      • 🎒Create a Data Backpack
      • 📧Send a Credential to Another Person
      • ⚙️Linked Accounts
        • X (Twitter) Account
        • Lens, ENS or .box Domains and Data Backpacks (coming soon)
    • 📑DIDs and VCs Explained
    • 🔓Wallets
    • ❓FAQs
    • 📒Glossary
      • Detailed Glossary
  • Demos
    • 💅Chipped Nails by Kiki.World x Gossip Protocol
    • 💧Programmatic Issuance: Campaigns
Powered by GitBook
On this page
  1. Welcome

⚡️ Quickstart Guide

PreviousLifecycle of CredentialsNextCustomize Credential Branding

Last updated 1 year ago

Takes 5 minutes!

Prerequisites

You will need an API Key and any library or app capable of making http requests (Postman, Fetch, Axios, Httpie, etc)

Get started with Disco in only three steps:

  1. Get an API key

  2. Select a credential schema

  3. Build and issue credential(s)

Introduction

The Disco API enables developers to issue Verifiable Credentials to addresses and to fetch and validate credentials about those addresses. These credentials use standard data models (schemas), contain event metadata or attestations, and can be later fetched and relied upon to bootstrap onboarding, manage access control, and understand community insights.

Prerequisites

You will need to create an API key, steps to create one:

  1. Create a test account in our dashboard

  2. Go to the Admin section and click on API Keys

  3. Create an API Key

Select a Credential Schema

The directions below use the Membership Credential schema.

How to use the API to Build and Issue or Fetch credentials

This method constructs a Membership Credential Schema, signed by Disco-controlled keys.

Issue Credentials

Generate and issue credentials to an ETH address or Decentralized Identifier (DID).

Usage example

curl --location 'https://api.disco.xyz/v1/credential' \
--header 'Content-Type: application/json' \
--header 'Accept: */*' \
--header 'Authorization: Bearer <your Disco API key>' \
--data '{
    "issuer": "did:3:123abcexample",
    "schemaUrl": "https://raw.githubusercontent.com/discoxyz/disco-schemas/main/json/MembershipCredential/1-0-0.json",
    "recipientDID": "did:3:456defexample",
    "subjectData": {
        "memberId": "123XYZ",
        "membershipDescription": "Demo membership to showcase Disco API",
        "membershipLevel": "Permanent",
        "membershipType": "Developer",
        "organization": "Disco.xyz"
    },
    "expirationDate": ""
}'
var myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Accept", "*/*");
myHeaders.append("Authorization", "Bearer <your Disco API key>");

var raw = JSON.stringify({
  "issuer": "did:3:123abcexample",
  "schemaUrl": "https://raw.githubusercontent.com/discoxyz/disco-schemas/main/json/MembershipCredential/1-0-0.json",
  "recipientDID": "did:3:456defexample",
  "subjectData": {
    "memberId": "123XYZ",
    "membershipDescription": "Demo membership to showcase Disco API",
    "membershipLevel": "Permanent",
    "membershipType": "Developer",
    "organization": "Disco.xyz"
  },
  "expirationDate": ""
});

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: raw,
  redirect: 'follow'
};

fetch("https://api.disco.xyz/v1/credential", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));

Successful Response

Response
{
    "vc": {
        "@context": [
            "https://www.w3.org/2018/credentials/v1"
        ],
        "type": [
            "VerifiableCredential",
            "MembershipCredential"
        ],
        "issuer": {
            "id": "did:3:123abcexample"
        },
        "issuanceDate": "2023-10-10T12:53:15.718Z",
        "id": "https://api.disco.xyz/credential/5c7cca5e-56ab-4e08-87f6-817e9f89f507",
        "credentialSubject": {
            "id": "did:3:456defexample",
            "memberId": "123XYZ",
            "membershipDescription": "Demo membership to showcase Disco API",
            "membershipLevel": "Permanent",
            "membershipType": "Developer",
            "organization": "Disco.xyz"
        },
        "credentialSchema": {
            "id": "https://raw.githubusercontent.com/discoxyz/disco-schemas/main/json/MembershipCredential/1-0-0.json",
            "type": "JsonSchemaValidator2018"
        },
        "proof": {
            "verificationMethod": "did:3:kjzl6cwe1jw14a7u9sx3thx9gg9uh7u5tqjkzcnr5pi5zzkap7kiztgsfhzayzt#controller",
            "created": "2023-10-10T12:53:15.745Z",
            "proofPurpose": "assertionMethod",
            "type": "EthereumEip712Signature2021",
            "proofValue": "0x487aa8ad7c90aa34a108b52cd7e23c5ef6cf9cfbdc01d7741d70d6b8f79763dc65df429e558af4c2d7a54c7f4040cf874ecffa95f17d87d8dc07823b23324bfe1b",
            "eip712Domain": {
                "domain": {
                    "chainId": 1,
                    "name": "Disco Verifiable Credential",
                    "version": "1"
                },
                "messageSchema": {
                    "EIP712Domain": [
                        {
                            "name": "name",
                            "type": "string"
                        },
                        {
                            "name": "version",
                            "type": "string"
                        },
                        {
                            "name": "chainId",
                            "type": "uint256"
                        }
                    ],
                    "Proof": [
                        {
                            "name": "created",
                            "type": "string"
                        },
                        {
                            "name": "proofPurpose",
                            "type": "string"
                        },
                        {
                            "name": "type",
                            "type": "string"
                        },
                        {
                            "name": "verificationMethod",
                            "type": "string"
                        }
                    ],
                    "Issuer": [
                        {
                            "name": "id",
                            "type": "string"
                        }
                    ],
                    "CredentialSubject": [
                        {
                            "name": "id",
                            "type": "string"
                        },
                        {
                            "name": "organization",
                            "type": "string"
                        }
                    ],
                    "VerifiableCredential": [
                        {
                            "name": "@context",
                            "type": "string[]"
                        },
                        {
                            "name": "credentialSubject",
                            "type": "CredentialSubject"
                        },
                        {
                            "name": "id",
                            "type": "string"
                        },
                        {
                            "name": "issuanceDate",
                            "type": "string"
                        },
                        {
                            "name": "issuer",
                            "type": "Issuer"
                        },
                        {
                            "name": "proof",
                            "type": "Proof"
                        },
                        {
                            "name": "type",
                            "type": "string[]"
                        }
                    ]
                },
                "primaryType": "VerifiableCredential"
            }
        }
    },
    "isPublic": false,
    "issuer": "did:3:123abcexample",
    "recipient": "did:3:456defexample",
    "subject": "did:3:456defexample",
    "schema": "https://raw.githubusercontent.com/discoxyz/disco-schemas/main/json/MembershipCredential/1-0-0.json",
    "isDeleted": false,
    "genId": "a4282add-ed1f-429d-a80d-abdd675b2eef",
    "updatedAt": "2023-10-10T12:53:15.748Z",
    "history": [],
    "_id": "6525493bb8ffec6244182e03"
}

Fetch Credentials

Fetch a public credential based on its ID

Usage example

# Looking up id=https://api.disco.xyz/credential/22d9187b-8a33-4e17-b05f-c8192107ab28
curl --location 'https://api.disco.xyz/v1/credential/https%3A%2F%2Fapi.disco.xyz%2Fcredential%2F22d9187b-8a33-4e17-b05f-c8192107ab28' \
--header 'Authorization: Bearer <your Disco API key>'
var myHeaders = new Headers();
myHeaders.append("Authorization", "Bearer <your Disco API key>");

var requestOptions = {
  method: 'GET',
  headers: myHeaders,
  redirect: 'follow'
};

fetch("https://api.disco.xyz/v1/credential/https%3A%2F%2Fapi.disco.xyz%2Fcredential%2F3f929a36-8e1c-46c1-9981-120b43241c13", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));

Successful response

Response
{
    "_id": "65099e2e52bf698c21aeeb91",
    "vc": {
        "@context": [
            "https://www.w3.org/2018/credentials/v1"
        ],
        "type": [
            "VerifiableCredential",
            "MembershipCredential"
        ],
        "issuer": {
            "id": "did:3:kjzl6cwe1jw14a7u9sx3thx9gg9uh7u5tqjkzcnr5pi5zzkap7kiztgsfhzayzt"
        },
        "issuanceDate": "2023-09-19T13:12:14.801Z",
        "id": "https://api.disco.xyz/credential/22d9187b-8a33-4e17-b05f-c8192107ab28",
        "credentialSubject": {
            "id": "did:ethr:0x08936438bfb8e9b269f978d5327ad684f47f8c05",
            "organization": "House of Leroy"
        },
        "expirationDate": "2024-08-29T00:00:00.000Z",
        "credentialSchema": {
            "id": "https://raw.githubusercontent.com/discoxyz/disco-schemas/main/json/MembershipCredential/1-0-0.json",
            "type": "JsonSchemaValidator2018"
        },
        "proof": {
            "verificationMethod": "did:3:kjzl6cwe1jw14a7u9sx3thx9gg9uh7u5tqjkzcnr5pi5zzkap7kiztgsfhzayzt#controller",
            "created": "2023-09-19T13:12:14.827Z",
            "proofPurpose": "assertionMethod",
            "type": "EthereumEip712Signature2021",
            "proofValue": "0x3aa89255fe63d7ca70c43b0603aa3d004978bc0815b35ae5dcbf84a3df4867f133b6f0d717916cf84b8f6b3dcbf6a7643f18fa00557c0ddb5f5571cc8f678d291c",
            "eip712Domain": {
                "domain": {
                    "chainId": 1,
                    "name": "Disco Verifiable Credential",
                    "version": "1"
                },
                "messageSchema": {
                    "EIP712Domain": [
                        {
                            "name": "name",
                            "type": "string"
                        },
                        {
                            "name": "version",
                            "type": "string"
                        },
                        {
                            "name": "chainId",
                            "type": "uint256"
                        }
                    ],
                    "Proof": [
                        {
                            "name": "created",
                            "type": "string"
                        },
                        {
                            "name": "proofPurpose",
                            "type": "string"
                        },
                        {
                            "name": "type",
                            "type": "string"
                        },
                        {
                            "name": "verificationMethod",
                            "type": "string"
                        }
                    ],
                    "Issuer": [
                        {
                            "name": "id",
                            "type": "string"
                        }
                    ],
                    "CredentialSubject": [
                        {
                            "name": "id",
                            "type": "string"
                        },
                        {
                            "name": "organization",
                            "type": "string"
                        }
                    ],
                    "VerifiableCredential": [
                        {
                            "name": "@context",
                            "type": "string[]"
                        },
                        {
                            "name": "credentialSubject",
                            "type": "CredentialSubject"
                        },
                        {
                            "name": "id",
                            "type": "string"
                        },
                        {
                            "name": "issuanceDate",
                            "type": "string"
                        },
                        {
                            "name": "issuer",
                            "type": "Issuer"
                        },
                        {
                            "name": "proof",
                            "type": "Proof"
                        },
                        {
                            "name": "type",
                            "type": "string[]"
                        }
                    ]
                },
                "primaryType": "VerifiableCredential"
            }
        }
    },
    "isPublic": true,
    "issuer": "did:3:kjzl6cwe1jw14a7u9sx3thx9gg9uh7u5tqjkzcnr5pi5zzkap7kiztgsfhzayzt",
    "recipient": "did:ethr:0x08936438bfb8e9B269F978D5327Ad684f47F8C05",
    "subject": "did:ethr:0x08936438bfb8e9B269F978D5327Ad684f47F8C05",
    "schema": "https://raw.githubusercontent.com/discoxyz/disco-schemas/main/json/MembershipCredential/1-0-0.json",
    "isDeleted": false,
    "genId": "9af80795-09f5-48a7-abd7-d713a8cd2447",
    "updatedAt": "2023-09-20T18:34:29.629Z",
    "history": [
        "{\"field\":\"isPublic\",\"oldValue\":false,\"newValue\":true,\"updatedAt\":\"2023-09-20T18:34:29.629Z\"}"
    ]
}

Community and Support

Video and more details are found in section.

Schemas define the structure and contents of a credential – enabling them to be consistent, verifiable, and interoperable. More details in . View Disco's public of schemas.

Always use Schemas raw files, .

Join our ! You can also contact us at ask@disco.xyz.

https://dashboard.disco.xyz/login
Generate an API Key
Schemas 101
Github repository
example
Discord
Create API Key

Returns a single credential using its `vc.id`

get

Returns a single credential using its verifiable credential ID (vc.id) - assuming the Api Key holder is either the holder, issuer or the Credential is public.

Authorizations
Path parameters
idstringRequired

Unique ID of Credential

Example: "did:3:123abcexample#someuuid"
Responses
200
A Verifiable Credential document
application/json
401
Unauthorized
application/json
403
Forbidden
application/json
404
Endpoint Not found
application/json
get
GET /v1/credential/{id} HTTP/1.1
Host: 
Authorization: YOUR_API_KEY
Accept: */*
{
  "_id": "text",
  "vc": "See https://www.w3.org/TR/vc-data-model/#example-a-simple-example-of-a-verifiable-credential",
  "jwt": "eyJhbGciOiJIUzI1N........",
  "isPublic": "true",
  "issuer": "",
  "recipient": "text",
  "subject": "text",
  "schema": "https://raw.githubusercontent.com/discoxyz/disco-schemas/main/json/MembershipCredential/1-0-0.json",
  "genId": "text",
  "updatedAt": "text",
  "isDeleted": true,
  "history": []
}
  • Prerequisites
  • Get started with Disco in only three steps:
  • Introduction
  • Prerequisites
  • Select a Credential Schema
  • How to use the API to Build and Issue or Fetch credentials
  • Issue Credentials
  • POSTProgrammatically issue one verifiable credential
  • Fetch Credentials
  • GETReturns a single credential using its `vc.id`
  • Community and Support

Programmatically issue one verifiable credential

post

Generate and return a signed Credential. This will also write the Credential the recipient's data backpack in Disco's Verifiable Data Registry. The JSON body should contain required Credential values for the schema type used. Available schemas and their specifications can be found at https://github.com/discoxyz/disco-schemas.

Authorizations
Body
schemaUrlstringOptional

The URL of the verifiable crednetial schema. Available schemas can be found at https://github.com/discoxyz/disco-schemas

Example: https://raw.githubusercontent.com/discoxyz/disco-schemas/main/json/MembershipCredential/1-0-0.json
recipientDIDstringOptional

The DID address of the credential's claimant

Example: did:3:Example987xyz
subjectDataobject · subjectDataOptional

The fields and values for the credential (based on its schema)

Example: { "memberId": "Goldstar Member", "membershipDescription": "Demo membership to showcase Disco API", "membershipLevel": "Permanent", "membershipType": "Developer", "organization": "Disco.xyz" }
expirationDatestringOptional

The date for the credential to expire for the claimant. Leave empty if there's no expiration.

suitestringOptional

Optional - supported values are "JWT" and "712".

issuerstringOptional

The DID address of the credential's issuer.

Example: did:web:api.disco.xyz/v1/disco
skipSignbooleanOptional

To sign or not to sign - hint you should sign! Either leave out or assign false.

Example: false
Responses
200
Success
application/json
401
Unauthorized
application/json
500
Credential not created function captureStackTrace() { [native code] }
application/json
post
POST /v1/credential HTTP/1.1
Host: 
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 499

{
  "schemaUrl": "https://raw.githubusercontent.com/discoxyz/disco-schemas/main/json/MembershipCredential/1-0-0.json",
  "recipientDID": "did:3:Example987xyz",
  "subjectData": "{\n    \"memberId\": \"Goldstar Member\",\n    \"membershipDescription\": \"Demo membership to showcase Disco API\",\n    \"membershipLevel\": \"Permanent\",\n    \"membershipType\": \"Developer\",\n    \"organization\": \"Disco.xyz\"\n  }",
  "expirationDate": "",
  "suite": "",
  "issuer": "did:web:api.disco.xyz/v1/disco",
  "skipSign": "false"
}
{
  "_id": "text",
  "vc": "See https://www.w3.org/TR/vc-data-model/#example-a-simple-example-of-a-verifiable-credential",
  "jwt": "eyJhbGciOiJIUzI1N........",
  "isPublic": "true",
  "issuer": "",
  "recipient": "text",
  "subject": "text",
  "schema": "https://raw.githubusercontent.com/discoxyz/disco-schemas/main/json/MembershipCredential/1-0-0.json",
  "genId": "text",
  "updatedAt": "text",
  "isDeleted": true,
  "history": []
}