---
title: "Publish a DID"
method: PUT
path: "/dids/{id}"
tags: ["DID"]
---

# Publish a DID

`PUT /dids/{id}`

Register or Update a DID in the DHT

## Path parameters

- `id` string, required

## Request body

- object
  - `sig` string, required — A base64URL-encoded signature of the BEP44 payload
  - `seq` integer, required — A sequence number for the request, recommended to be a unix timestamp in seconds
  - `v` string, required — A base64URL-encoded bencoded DNS packet containing the DID Document
  - `retention_solution` string — A retention solution calculated according to the spec-defined retention solution algorithm

## Response `202`

The server has accepted the request as valid and will publish it to the DHT

- object
  - `expiry` number

## Other responses

- `400` — Invalid request
- `401` — Invalid signature or retention solution
- `409` — DID already exists with a higher sequence number. May still be accepted if the Gateway supports historical resolution.
- `503` — Retention sets have been temporarily disabled.

## Changes

- **2026-07-17** `fff9410e2681` — 1 breaking, 1 warning, 3 info
  - the response's body type changed from `string` to `object` for status `202`
  - removed the request property `retention_proof`
  - added the new optional request property `retention_solution`
  - added the non-success response with the status `503`
  - …1 more
- **2024-01-04** `eef6722c1692` — 1 info
  - endpoint added
- **2023-11-20** `4b01176296d1` — 1 breaking
  - api path removed without deprecation

[Change history](https://skmtc.dev/decentralized-identity/apis/did-dht-gateway-api/changes/dids/:id/put.md)

---

[API](https://skmtc.dev/decentralized-identity/apis/did-dht-gateway-api.md) · [All operations](https://skmtc.dev/decentralized-identity/apis/did-dht-gateway-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/decentralized-identity/did-dht-gateway-api/revisions/fff9410e2681/schema)
