---
title: "POST /dids/import"
method: POST
path: "/dids/import"
tags: ["Dids"]
---

# POST /dids/import

`POST /dids/import`

Import a did (with optional did document).

If no did document is provided, the did will be resolved to fetch the did document.

## Headers

- `x-tenant-id` string

## Request body

- DidImportOptions
  - `did` string, required
  - `didDocument` DidDocumentJson — Represents a DID document.
    - `publicKey` VerificationMethod[]
      - `id` string, required
      - `type` string, required
      - `controller` string, required
      - `publicKeyBase58` string
      - `publicKeyBase64` string
      - `publicKeyJwk` JsonWebKey — Encapsulates a JSON web key type that includes only the public properties that can be used in DID documents. The private properties are intentionally omitted to discourage the use (and accidental disclosure) of private keys in DID documents.
        - `alg` string
        - `crv` string
        - `e` string
        - `ext` boolean
        - `key_ops` string[]
        - `kid` string
        - `kty` string, required
        - `n` string
        - `use` string
        - `x` string
        - `y` string
      - `publicKeyHex` string
      - `publicKeyMultibase` string
      - `blockchainAccountId` string
      - `ethereumAddress` string
      - `conditionOr` VerificationMethod[]
      - `conditionAnd` VerificationMethod[]
      - `threshold` number, double
      - `conditionThreshold` VerificationMethod[]
      - `conditionWeightedThreshold` ConditionWeightedThreshold[]
        - `condition` VerificationMethod, required — recursive
        - `weight` number, double, required
      - `conditionDelegated` string
      - `relationshipParent` string[]
      - `relationshipChild` string[]
      - `relationshipSibling` string[]
    - `service` Service[]
      - `id` string, required
      - `type` string, required
      - `serviceEndpoint` union, required
        - union — Represents an endpoint of a Service entry in a DID document.
          - string
          - RecordStringAny — Construct a type with a set of properties K of type T
        - ServiceEndpoint[]
          - union — Represents an endpoint of a Service entry in a DID document.
            - string
            - RecordStringAny — Construct a type with a set of properties K of type T
    - `verificationMethod` VerificationMethod[]
      - `id` string, required
      - `type` string, required
      - `controller` string, required
      - `publicKeyBase58` string
      - `publicKeyBase64` string
      - `publicKeyJwk` JsonWebKey — Encapsulates a JSON web key type that includes only the public properties that can be used in DID documents. The private properties are intentionally omitted to discourage the use (and accidental disclosure) of private keys in DID documents.
        - `alg` string
        - `crv` string
        - `e` string
        - `ext` boolean
        - `key_ops` string[]
        - `kid` string
        - `kty` string, required
        - `n` string
        - `use` string
        - `x` string
        - `y` string
      - `publicKeyHex` string
      - `publicKeyMultibase` string
      - `blockchainAccountId` string
      - `ethereumAddress` string
      - `conditionOr` VerificationMethod[]
      - `conditionAnd` VerificationMethod[]
      - `threshold` number, double
      - `conditionThreshold` VerificationMethod[]
      - `conditionWeightedThreshold` ConditionWeightedThreshold[]
        - `condition` VerificationMethod, required — recursive
        - `weight` number, double, required
      - `conditionDelegated` string
      - `relationshipParent` string[]
      - `relationshipChild` string[]
      - `relationshipSibling` string[]
    - `controller` union
      - string
      - string[]
    - `alsoKnownAs` string[]
    - `id` string, required
    - `@context` union
      - string
      - string[]
      - 'https://www.w3.org/ns/did/v1'
    - `authentication` union[]
      - union
        - string
        - VerificationMethod — Represents the properties of a Verification Method listed in a DID document. This data type includes public key representations that are no longer present in the spec but are still used by several DID methods / resolvers and kept for backward compatibility.
          - `id` string, required
          - `type` string, required
          - `controller` string, required
          - `publicKeyBase58` string
          - `publicKeyBase64` string
          - `publicKeyJwk` JsonWebKey — Encapsulates a JSON web key type that includes only the public properties that can be used in DID documents. The private properties are intentionally omitted to discourage the use (and accidental disclosure) of private keys in DID documents.
            - `alg` string
            - `crv` string
            - `e` string
            - `ext` boolean
            - `key_ops` string[]
            - `kid` string
            - `kty` string, required
            - `n` string
            - `use` string
            - `x` string
            - `y` string
          - `publicKeyHex` string
          - `publicKeyMultibase` string
          - `blockchainAccountId` string
          - `ethereumAddress` string
          - `conditionOr` VerificationMethod[]
          - `conditionAnd` VerificationMethod[]
          - `threshold` number, double
          - `conditionThreshold` VerificationMethod[]
          - `conditionWeightedThreshold` ConditionWeightedThreshold[]
            - `condition` VerificationMethod, required — recursive
            - `weight` number, double, required
          - `conditionDelegated` string
          - `relationshipParent` string[]
          - `relationshipChild` string[]
          - `relationshipSibling` string[]
    - `assertionMethod` union[]
      - union
        - string
        - VerificationMethod — Represents the properties of a Verification Method listed in a DID document. This data type includes public key representations that are no longer present in the spec but are still used by several DID methods / resolvers and kept for backward compatibility.
          - `id` string, required
          - `type` string, required
          - `controller` string, required
          - `publicKeyBase58` string
          - `publicKeyBase64` string
          - `publicKeyJwk` JsonWebKey — Encapsulates a JSON web key type that includes only the public properties that can be used in DID documents. The private properties are intentionally omitted to discourage the use (and accidental disclosure) of private keys in DID documents.
            - `alg` string
            - `crv` string
            - `e` string
            - `ext` boolean
            - `key_ops` string[]
            - `kid` string
            - `kty` string, required
            - `n` string
            - `use` string
            - `x` string
            - `y` string
          - `publicKeyHex` string
          - `publicKeyMultibase` string
          - `blockchainAccountId` string
          - `ethereumAddress` string
          - `conditionOr` VerificationMethod[]
          - `conditionAnd` VerificationMethod[]
          - `threshold` number, double
          - `conditionThreshold` VerificationMethod[]
          - `conditionWeightedThreshold` ConditionWeightedThreshold[]
            - `condition` VerificationMethod, required — recursive
            - `weight` number, double, required
          - `conditionDelegated` string
          - `relationshipParent` string[]
          - `relationshipChild` string[]
          - `relationshipSibling` string[]
    - `keyAgreement` union[]
      - union
        - string
        - VerificationMethod — Represents the properties of a Verification Method listed in a DID document. This data type includes public key representations that are no longer present in the spec but are still used by several DID methods / resolvers and kept for backward compatibility.
          - `id` string, required
          - `type` string, required
          - `controller` string, required
          - `publicKeyBase58` string
          - `publicKeyBase64` string
          - `publicKeyJwk` JsonWebKey — Encapsulates a JSON web key type that includes only the public properties that can be used in DID documents. The private properties are intentionally omitted to discourage the use (and accidental disclosure) of private keys in DID documents.
            - `alg` string
            - `crv` string
            - `e` string
            - `ext` boolean
            - `key_ops` string[]
            - `kid` string
            - `kty` string, required
            - `n` string
            - `use` string
            - `x` string
            - `y` string
          - `publicKeyHex` string
          - `publicKeyMultibase` string
          - `blockchainAccountId` string
          - `ethereumAddress` string
          - `conditionOr` VerificationMethod[]
          - `conditionAnd` VerificationMethod[]
          - `threshold` number, double
          - `conditionThreshold` VerificationMethod[]
          - `conditionWeightedThreshold` ConditionWeightedThreshold[]
            - `condition` VerificationMethod, required — recursive
            - `weight` number, double, required
          - `conditionDelegated` string
          - `relationshipParent` string[]
          - `relationshipChild` string[]
          - `relationshipSibling` string[]
    - `capabilityInvocation` union[]
      - union
        - string
        - VerificationMethod — Represents the properties of a Verification Method listed in a DID document. This data type includes public key representations that are no longer present in the spec but are still used by several DID methods / resolvers and kept for backward compatibility.
          - `id` string, required
          - `type` string, required
          - `controller` string, required
          - `publicKeyBase58` string
          - `publicKeyBase64` string
          - `publicKeyJwk` JsonWebKey — Encapsulates a JSON web key type that includes only the public properties that can be used in DID documents. The private properties are intentionally omitted to discourage the use (and accidental disclosure) of private keys in DID documents.
            - `alg` string
            - `crv` string
            - `e` string
            - `ext` boolean
            - `key_ops` string[]
            - `kid` string
            - `kty` string, required
            - `n` string
            - `use` string
            - `x` string
            - `y` string
          - `publicKeyHex` string
          - `publicKeyMultibase` string
          - `blockchainAccountId` string
          - `ethereumAddress` string
          - `conditionOr` VerificationMethod[]
          - `conditionAnd` VerificationMethod[]
          - `threshold` number, double
          - `conditionThreshold` VerificationMethod[]
          - `conditionWeightedThreshold` ConditionWeightedThreshold[]
            - `condition` VerificationMethod, required — recursive
            - `weight` number, double, required
          - `conditionDelegated` string
          - `relationshipParent` string[]
          - `relationshipChild` string[]
          - `relationshipSibling` string[]
    - `capabilityDelegation` union[]
      - union
        - string
        - VerificationMethod — Represents the properties of a Verification Method listed in a DID document. This data type includes public key representations that are no longer present in the spec but are still used by several DID methods / resolvers and kept for backward compatibility.
          - `id` string, required
          - `type` string, required
          - `controller` string, required
          - `publicKeyBase58` string
          - `publicKeyBase64` string
          - `publicKeyJwk` JsonWebKey — Encapsulates a JSON web key type that includes only the public properties that can be used in DID documents. The private properties are intentionally omitted to discourage the use (and accidental disclosure) of private keys in DID documents.
            - `alg` string
            - `crv` string
            - `e` string
            - `ext` boolean
            - `key_ops` string[]
            - `kid` string
            - `kty` string, required
            - `n` string
            - `use` string
            - `x` string
            - `y` string
          - `publicKeyHex` string
          - `publicKeyMultibase` string
          - `blockchainAccountId` string
          - `ethereumAddress` string
          - `conditionOr` VerificationMethod[]
          - `conditionAnd` VerificationMethod[]
          - `threshold` number, double
          - `conditionThreshold` VerificationMethod[]
          - `conditionWeightedThreshold` ConditionWeightedThreshold[]
            - `condition` VerificationMethod, required — recursive
            - `weight` number, double, required
          - `conditionDelegated` string
          - `relationshipParent` string[]
          - `relationshipChild` string[]
          - `relationshipSibling` string[]
  - `privateKeys` PrivateKey[] — Private keys to import as part of the did document
    - `keyType` 'ed25519' | 'bls12381g1g2' | 'bls12381g1' | 'bls12381g2' | 'x25519' | 'p256' | 'p384' | 'p521' | 'k256', required
    - `privateKeyBase58` string, required — Base58 encoded private key
  - `overwrite` boolean — Whether to overwrite the existing did document and private keys

## Response `201`

Did imported successfully

---

[API](https://skmtc.net/openwallet-foundation/apis/credo-rest-api.md) · [All operations](https://skmtc.net/openwallet-foundation/apis/credo-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/openwallet-foundation/credo-rest-api/revisions/33596742b733/schema)
