Create Credential
Related workflow: Working with Beams and credentials
POST
Create a new W3C verifiable credential for a user's submitted input.
Behavior
- After storing the input, the handler checks five times at 100 ms intervals for a credential created from it, then responds.
inputis not validated against the beam input type's schema by this handler.
Related: Get Credential · Get Credential Status
apiKeyheader
apikey<token>application/json- body
inputTypeId*stringThe id of the beam input type
userId*stringThe id of the user the credential should be issued to
input*objectThe data used to generate the credential, this should match the schema in the beam input type.
Beam input recorded. credentialId is the credential produced from it, or null if none existed when the handler stopped waiting.
application/json- response
inputId*stringThe id of the beam input that was created
credentialId*string|nullThe id of the created Credential if it is immediately available. Note that this depends on the beam processor used to generate the credential.
curl -X POST 'https://api.cerebrum.com/v1/credential' \ -H 'apikey: CEREBRUM_API_KEY' \ -H 'Content-Type: application/json' \ -d '{ "inputTypeId": "f5f08fd9-435d-49ce-85d7-ccc748dddce0", "userId": "ee5da20d-e610-4039-8fc6-00885a49cfdb", "input": { "id": "did:example:1234", "name": "John Doe", "birthdate": "1990-01-01", "idDocument": { "type": "Passport", "number": "X12345678", "country": "US", "expiryDate": "2030-12-31" }, "selfie": { "type": "ImageObject", "contentUrl": "https://www.cerebrum.com/images/user_id/selfie.jpg", "encodingFormat": "image/jpeg" }, "facialVerification": { "type": "FacialVerificationResult", "status": "verified", "confidence": 99 } }}'Example Response
{ "inputId": "string", "credentialId": "string"}