Skip to content

Credential routes: update, delete

The Credential Verbs update, delete as api.sb routes, with inputs, result, refusals and an example.

Reference for Credential, one group of Credential routes.

Credential.update

Changes the given properties of a Credential. Verb page.

Text
PATCH /{namespace}/credentials/{id}

Path: id. Body, as JSON: the other inputs. Emits Credential.updated.

Inputs

InputTypeRequiredDescription
idstringrequiredThe id of the Credential.
issuerstringThe regulator or registry that grants it.
jurisdictionstringWhere it applies.
standingstringWhether it is in good standing, read fresh on every use.

Returns

OutputTypeRequiredDescription
credentialCredentialrequiredThe Credential.

Refuses when

CheckErrorFixThen call
The key is valid, but its scopes do not allow this operation.forbiddenUse a key whose scopes cover the operation, or ask an owner of the namespace to grant them.None.

Example

Terminal
curl -X PATCH https://api.sb/leaseline.app/credentials/credential_Abb9zatRR1 \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"jurisdiction":"US-DE"}'
JSON
{
  "api": "https://api.sb/leaseline.app",
  "credential": {
    "$id": "https://api.sb/leaseline.app/credentials/credential_Abb9zatRR1",
    "$type": "Credential",
    "issuer": "Example issuer",
    "jurisdiction": "US-DE"
  },
  "action": {
    "$id": "https://api.sb/leaseline.app/actions/act_br07HsG8MG",
    "operation": "Credential.update",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/leaseline.app/actions/act_br07HsG8MG"
  }
}

Credential.delete

Deletes a Credential: a soft delete that keeps its history, undone by Thing.restore. Verb page.

Text
DELETE /{namespace}/credentials/{id}

Path: id. Emits Credential.deleted.

Inputs

InputTypeRequiredDescription
idstringrequiredThe id of the Credential.

Returns

OutputTypeRequiredDescription
credentialCredentialrequiredThe Credential.

Refuses when

CheckErrorFixThen call
The key is valid, but its scopes do not allow this operation.forbiddenUse a key whose scopes cover the operation, or ask an owner of the namespace to grant them.None.

Example

Terminal
curl -X DELETE https://api.sb/leaseline.app/credentials/credential_Abb9zatRR1 \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY"
JSON
{
  "api": "https://api.sb/leaseline.app",
  "credential": {
    "$id": "https://api.sb/leaseline.app/credentials/credential_Abb9zatRR1",
    "$type": "Credential",
    "issuer": "Example issuer",
    "jurisdiction": "US-DE"
  },
  "action": {
    "$id": "https://api.sb/leaseline.app/actions/act_br07HsG8MG",
    "operation": "Credential.delete",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/leaseline.app/actions/act_br07HsG8MG"
  }
}