Create a Credential

POST

/api/v1/credentials

Creates a new Credential for an existing Profile

The below Request body example has a data key that shows all the possible values available.

In practice, this data key should contain only the data corresponding to the kind of the Credential you want to create. If not present, the Credential will not be created.

To know what keys are relevant for you, please refer to the Response 200 section below where you can select the kind of the Credential you want, and see what data keys are necessary.

Request

curl --location 'https://nanotrust.io/api/v1/api/v1/credentials' \
    --header 'Content-Type: application/json' \
    --header 'Accept: application/json' \
    --header 'Authorization: Bearer YOUR_TOKEN' \
    --data '{
    "credential": {
        "issuer_profile_id": "urn:uuid:2e5cd426-0458-2aad-4639-1a7a7984ec00",
        "kind": "event",
        "owner_name": "amet pariatur ut",
        "owner_email": "in Ut irure",
        "document": "nulla"
    },
    "data": {
        "start_time": "1952-04-01",
        "name": "sunt irure consequat elit esse",
        "date": "1984-01-03",
        "company": "do non",
        "invoice_number": "eiusmod enim pariatur adipisicing mollit",
        "total_payment_due": "est Ut deserunt dolor",
        "company_id": "nisi sint sed a",
        "iban": "in occaecat ut veniam",
        "role": "magna fugiat",
        "contract": "vol",
        "gross_salary": "consect",
        "net_salary": "magna commodo in",
        "start_date": "2000-06-06",
        "end_date": "1969-01-16",
        "location_street_address": "elit",
        "location_address_code": "fugiat deserunt",
        "location_address_locality": "Lorem in officia",
        "measured_name": "reprehenderit quis laboris",
        "observation_date": "1954-08-30",
        "measured_value": "in consectetur est cupidatat ea",
        "identifier": "sint ut",
        "status": "officia eiusmod commo"
    }
    }'

Query Params

{
    "credential": {
        "issuer_profile_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
        "kind": "diploma",
        "owner_name": "string",
        "owner_email": "string",
        "document": "string"
    },
    "data": {
        "start_time": "2023-03-13",
        "name": "string",
        "date": "2023-03-13",
        "company": "string",
        "invoice_number": "string",
        "total_payment_due": "string",
        "company_id": "string",
        "iban": "string",
        "role": "string",
        "contract": "string",
        "gross_salary": "string",
        "net_salary": "string",
        "start_date": "2023-03-13",
        "end_date": "2023-03-13",
        "location_street_address": "string",
        "location_address_code": "string",
        "location_address_locality": "string",
        "measured_name": "string",
        "observation_date": "2023-03-13",
        "measured_value": "string",
        "identifier": "string",
        "status": "string"
    }
}

Responses

200

Credential successfully created

{
    "id": null,
    "issuer_profile_id": null,
    "status": "pending",
    "kind": "diploma",
    "owner_name": "Mose Denesik JD",
    "owner_email": "susana@morissette.co",
    "data": {
        "start_time": "2021-07-01",
        "name": "Associate Degree in Computer Science"
    },
    "created_at": null,
    "updated_at": null,
    "review_token": null,
    "owner_profile_id": null,
    "wallet_status": "unsync",
    "owner_birth_date": "2020-07-05",
    "owner_birth_place": "Donnieville",
    "email_template_id": null,
    "mailjet_id": null,
    "mailjet_status": 0,
    "is_implicit_consent": false
}

401

Invalid token No access token was provided, please provide one in an Authorization header.

422

Invalid Credential parameters provided