# writeDocument(didContext, didID, authentications, serviceID, serviceType, serviceEndpoint)

<table data-header-hidden><thead><tr><th width="146.5"></th><th></th></tr></thead><tbody><tr><td>Feature</td><td>Returns a did document that can be used as an argument for <code>updateDocument()</code></td></tr><tr><td>Parameters</td><td><code>string</code> did context,<br><code>string</code> didID,                                               // did string <br><code>(AsymKeyAuth | SocialLoginAuth)[]</code> authentications, <br><code>string</code> service id,                                      // did string <br><code>string</code> serviceEndpoint,</td></tr><tr><td>Return Value</td><td><code>object</code> did document, Use return value to <code>updateDocument()</code></td></tr></tbody></table>

```jsx
...
const authentication = mitum.authdid.writeAsymkeyAuth(id, authType, controller, publicKey);

const context = "https://www.w3.org/ns/did/v1";
const didID = did;
const type = "mitumDappType";
const endpoint = "http://localhost:3000";

const document = mitum.authdid.writeDocument(context, didID, [authentication], did, type, endpoint);
console.log(document);

//output
{
  _hint: 'mitum-did-document-v0.0.1',
  '@context': 'https://www.w3.org/ns/did/v1',
  id: 'did:mitum:0x4526f3D0EdC63D9EaeCD94D56551e0f061CFCa47fca',
  authentication: [
    {
      _hint: 'mitum-did-asymmetric-key-authentication-v0.0.1',
      id: 'did:mitum:0x4526f3D0EdC63D9EaeCD94D56551e0f061CFCa47fca#auth_key5',
      authType: 'EcdsaSecp256k1VerificationKey2019',
      controller: 'did:mitum:0x4526f3D0EdC63D9EaeCD94D56551e0f061CFCa47fca',
      publicKey: '0359335c48c7b06d05cfba06c4d37aa0369069d5d5c036a6c7a098199e0650d3c8fpu'
    }
  ],
  verificationMethod: [],
  service: {
    id: 'did:mitum:0x4526f3D0EdC63D9EaeCD94D56551e0f061CFCa47fca',
    type: 'mitumDappType',
    service_end_point: 'http://localhost:3000'
  }
}
```
