From 07e9e1e0adbdb2d5b2fac12014ebc6e50c9a0d0c Mon Sep 17 00:00:00 2001 From: Pratyush Singhal Date: Thu, 23 Jul 2026 17:22:44 -0700 Subject: [PATCH 1/2] Document Location headers for created REST resources Specify the shared JSON creation response header and the canonical EPerson URI returned after successful account creation. --- README.md | 1 + epersons.md | 3 +++ 2 files changed, 4 insertions(+) diff --git a/README.md b/README.md index 24b495e2..f4ef68d3 100644 --- a/README.md +++ b/README.md @@ -55,6 +55,7 @@ This type of endpoint interacts with a group (or collection) of resources (objec - `POST` - Creates a new resource (object) and adds it to the group. Any required data (i.e. attributes) for the new object _must be included_ in the request body. An empty request body is not allowed, unless you are creating an empty object with no attributes. - Related or additional information (such as required associations to other objects) may be passed as querystring parameters in the request, _if it is required to create the object._ + - A successful JSON creation returns `201 Created` with a `Location` response header containing the absolute URI of the created resource. ``` # For example, creating a Collection *requires* linking it to a parent Community # In this scenario, we must have a querystring param to specify the parent Community UUID diff --git a/epersons.md b/epersons.md index c2a1dc66..951e6291 100644 --- a/epersons.md +++ b/epersons.md @@ -231,6 +231,9 @@ To create a new EPerson, perform a post with the JSON below to the epersons endp } ``` +A successful response includes a `Location` header with the canonical URI of the created EPerson: +`${dspace.url}/api/eperson/epersons/<:uuid>`. + Status codes: * 201 Created - if the operation succeed * 401 Unauthorized - if you are not authenticated From 3e89c412342c15e2c2830a055a85046352e3afc8 Mon Sep 17 00:00:00 2001 From: Pratyush Singhal Date: Fri, 24 Jul 2026 12:00:48 -0700 Subject: [PATCH 2/2] Document Location headers for EPerson POSTs --- epersons.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/epersons.md b/epersons.md index 951e6291..02bea95f 100644 --- a/epersons.md +++ b/epersons.md @@ -276,6 +276,9 @@ The "eperson.firstname" and "eperson.lastname" metadata are mandatory. The phone The email property can be set, but would need to be identical to the value from the registration. The selfRegistered property can be set, but would need to be true +A successful response includes a `Location` header with the canonical URI of the created EPerson: +`${dspace.url}/api/eperson/epersons/<:uuid>`. + Status codes: * 201 Created - if the operation succeed * 400 Bad Request - if the email address didn't match the token or already exists. If the token doesn't exist or is expired @@ -304,6 +307,9 @@ curl -X POST http://${dspace.url}/api/eperson/epersons/${id-eperson}?token=${tok As you can see, the request has an ***empty body***. +A successful response includes a `Location` header with the canonical URI of the updated EPerson: +`${dspace.url}/api/eperson/epersons/<:uuid>`. + Status codes: * 201 Created - if the operation succeed * 400 Bad Request - if the `uuid` provided doesn't exist, or if some `override` element isn't found inside the linked user item.