> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.odr.io/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.odr.io/_mcp/server.

# /user/permissions

POST https://user/permissions
Content-Type: multipart/form-data

POST - update a user's permission settings to allow the desired permission for a dataset. The token owner must have admin permissions on the dataset or be a super-admin to set the permissions for the desired user.

Example input (used in this request URL):

```
FORM DATA
    user_email: {user_email},
    dataset_uuid: {dataset_uuid},
    permission: {"admin"|"edit_all"|"view_all"|"view_only"}

```

Available - all API versions

Reference: https://docs.odr.io/odr-search-api-v-4/user-permissions

## Request

### Body (multipart/form-data)

This endpoint expects a multipart form.

- `user_email` (string, required)
- `dataset_uuid` (string, required)
- `permission` (string, required)

## Response

### 200

OK

- `user` (object, required)
  - `first_name` (string, required)
  - `last_name` (string, required)
  - `email` (string, required)
- `datasets` (list of object, required)
  - `internal_id` (integer, required)
  - `external_id` (string, required)
  - `record_name` (integer, required)
  - `template_uuid` (string, required)
  - `database_uuid` (string, required)
  - `search_slug` (string, required)
  - `_record_metadata` (object, required)
    - `_create_date` (string, required)
    - `_create_auth` (string, required)
    - `_create_uuid` (string, required)
    - `_public_date` (string, required)
  - `fields` (list of object, required)
    - `field_name` (string, required)
    - `field_uuid` (string, required)
    - `template_field_uuid` (string, required)
    - `updated_at` (string, required)
    - `id` (integer, required)
    - `value` (string, required)
  - `records` (list of object, required)
    - `database_name` (string, required)
    - `internal_id` (integer, required)
    - `external_id` (string, required)
    - `record_name` (integer, required)
    - `template_uuid` (string, required)
    - `database_uuid` (string, required)
    - `_record_metadata` (object, required)
      - `_create_date` (string, required)
      - `_create_auth` (string, required)
      - `_public_date` (string, required)
    - `fields` (list of any, required)
    - `records` (list of any, required)

## Examples

**Request**

```json
{
  "user_email": "string",
  "dataset_uuid": "string",
  "permission": "string"
}
```

**Response**

```json
{
  "user": {
    "first_name": "Nancy",
    "last_name": "Drew",
    "email": "nancy.drew@detectivemysteries.com"
  },
  "datasets": [
    {
      "internal_id": 77918287,
      "external_id": "",
      "record_name": 82073418,
      "template_uuid": "2ea627b",
      "database_uuid": "dfe1e8e",
      "search_slug": "dfe1e8e",
      "_record_metadata": {
        "_create_date": "2019-03-18 13:35:41",
        "_create_auth": "Nancy Drew",
        "_create_uuid": "nancy.drew@detectivemysteries.com",
        "_public_date": "2019-03-18 13:35:41"
      },
      "fields": [
        {
          "field_name": "Dataset Name",
          "field_uuid": "fd84c87",
          "template_field_uuid": "08088a9",
          "updated_at": "2019-03-18 13:35:41",
          "id": 74255456,
          "value": "A New Dataset"
        },
        {
          "field_name": "Dataset Description",
          "field_uuid": "9c5f6ce",
          "template_field_uuid": "435844b",
          "updated_at": "2019-03-18 13:35:41",
          "id": 58441482,
          "value": ""
        },
        {
          "field_name": "Dataset Location",
          "field_uuid": "3267b64",
          "template_field_uuid": "a4b7180",
          "updated_at": "2019-03-18 13:35:41",
          "id": 65528411,
          "value": "http://zeta.odr.io/dfe1e8e"
        },
        {
          "field_name": "Funding Sources",
          "field_uuid": "d6b8e35",
          "template_field_uuid": "3efc620",
          "updated_at": "2019-03-18 13:35:41",
          "id": 98283384,
          "value": "string"
        },
        {
          "field_name": "Missions/Projects",
          "field_uuid": "67df081",
          "template_field_uuid": "3653d7f",
          "updated_at": "2019-03-18 13:35:41",
          "id": 81006554,
          "value": "string"
        },
        {
          "field_name": "NASA Astrobiology Program Research Theme",
          "field_uuid": "ce3fe7e",
          "template_field_uuid": "979523a",
          "updated_at": "2019-03-18 13:35:41",
          "id": 94110462,
          "value": "string"
        },
        {
          "field_name": "Astrobiology Field Location",
          "field_uuid": "69143af",
          "template_field_uuid": "2c5f861",
          "updated_at": "2019-03-18 13:35:41",
          "id": 85680783,
          "value": "string"
        },
        {
          "field_name": "Astrobiology Disciplines",
          "field_uuid": "352c982",
          "template_field_uuid": "cfc0199",
          "updated_at": "2019-03-18 13:35:41",
          "id": 70666706,
          "value": "string"
        },
        {
          "field_name": "Astrobiology Keywords",
          "field_uuid": "531465b",
          "template_field_uuid": "72d4cf2",
          "updated_at": "2019-03-18 13:35:41",
          "id": 60294135,
          "value": "string"
        }
      ],
      "records": [
        {
          "database_name": "Lead Investigators",
          "internal_id": 81248087,
          "external_id": "",
          "record_name": 56252380,
          "template_uuid": "2ee61a4",
          "database_uuid": "1c4d11b",
          "_record_metadata": {
            "_create_date": "2019-03-18 13:35:41",
            "_create_auth": "Nancy Drew",
            "_public_date": "2019-03-18 13:35:41"
          },
          "fields": [],
          "records": []
        },
        {
          "database_name": "string",
          "internal_id": 76464664,
          "external_id": "",
          "record_name": 51683100,
          "template_uuid": "ebd7760",
          "database_uuid": "4677a07",
          "_record_metadata": {
            "_create_date": "2019-03-18 13:35:41",
            "_create_auth": "Nancy Drew",
            "_public_date": "2019-03-18 13:35:41"
          },
          "fields": [],
          "records": []
        }
      ]
    }
  ]
}
```

**SDK Code**

```python /user/permissions_example
import requests

url = "https://https/user/permissions"

payload = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"user_email\"\r\n\r\nstring\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"dataset_uuid\"\r\n\r\nstring\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"permission\"\r\n\r\nstring\r\n-----011000010111000001101001--\r\n"
headers = {"Content-Type": "multipart/form-data; boundary=---011000010111000001101001"}

response = requests.post(url, data=payload, headers=headers)

print(response.json())
```

```javascript /user/permissions_example
const url = 'https://https/user/permissions';
const form = new FormData();
form.append('user_email', 'string');
form.append('dataset_uuid', 'string');
form.append('permission', 'string');

const options = {method: 'POST'};

options.body = form;

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go /user/permissions_example
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://https/user/permissions"

	payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"user_email\"\r\n\r\nstring\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"dataset_uuid\"\r\n\r\nstring\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"permission\"\r\n\r\nstring\r\n-----011000010111000001101001--\r\n")

	req, _ := http.NewRequest("POST", url, payload)

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby /user/permissions_example
require 'uri'
require 'net/http'

url = URI("https://https/user/permissions")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"user_email\"\r\n\r\nstring\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"dataset_uuid\"\r\n\r\nstring\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"permission\"\r\n\r\nstring\r\n-----011000010111000001101001--\r\n"

response = http.request(request)
puts response.read_body
```

```java /user/permissions_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://https/user/permissions")
  .body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"user_email\"\r\n\r\nstring\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"dataset_uuid\"\r\n\r\nstring\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"permission\"\r\n\r\nstring\r\n-----011000010111000001101001--\r\n")
  .asString();
```

```php /user/permissions_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://https/user/permissions', [
  'multipart' => [
    [
        'name' => 'user_email',
        'contents' => 'string'
    ],
    [
        'name' => 'dataset_uuid',
        'contents' => 'string'
    ],
    [
        'name' => 'permission',
        'contents' => 'string'
    ]
  ]
]);

echo $response->getBody();
```

```csharp /user/permissions_example
using RestSharp;

var client = new RestClient("https://https/user/permissions");
var request = new RestRequest(Method.POST);
request.AddParameter("undefined", "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"user_email\"\r\n\r\nstring\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"dataset_uuid\"\r\n\r\nstring\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"permission\"\r\n\r\nstring\r\n-----011000010111000001101001--\r\n", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift /user/permissions_example
import Foundation
let parameters = [
  [
    "name": "user_email",
    "value": "string"
  ],
  [
    "name": "dataset_uuid",
    "value": "string"
  ],
  [
    "name": "permission",
    "value": "string"
  ]
]

let boundary = "---011000010111000001101001"

var body = ""
var error: NSError? = nil
for param in parameters {
  let paramName = param["name"]!
  body += "--\(boundary)\r\n"
  body += "Content-Disposition:form-data; name=\"\(paramName)\""
  if let filename = param["fileName"] {
    let contentType = param["content-type"]!
    let fileContent = String(contentsOfFile: filename, encoding: String.Encoding.utf8)
    if (error != nil) {
      print(error as Any)
    }
    body += "; filename=\"\(filename)\"\r\n"
    body += "Content-Type: \(contentType)\r\n\r\n"
    body += fileContent
  } else if let paramValue = param["value"] {
    body += "\r\n\r\n\(paramValue)"
  }
}

let request = NSMutableURLRequest(url: NSURL(string: "https://https/user/permissions")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```