Skip to content

// HTTP method

PUT

Create or replace the state of the target resource with the representation supplied by the client.

UnsafeIdempotent

Idempotency

Idempotent: repeating the same replacement request should leave the resource in the same intended state.

Common use cases

  • Replace a complete resource representation.
  • Create a resource at a client-known URI.
  • Set a deterministic configuration document.

Common mistakes

  • Treating omitted fields as unchanged without documenting partial semantics.
  • Creating a different resource on each retry.
  • Using PUT for an action that is not a resource replacement.

Request

PUT /profiles/usr_123 HTTP/1.1
Content-Type: application/json

{ "displayName": "Ada", "timezone": "UTC" }

Response

HTTP/1.1 200 OK
Content-Type: application/json

{ "id": "usr_123", "displayName": "Ada", "timezone": "UTC" }

// GET STARTED

Design and test a PUT operation.

Define the contract in API Designer, then execute it with Cloud Runner or Browser Runner.

Start for free