---
title: Grant Field Permissions
slug: grant-field-permissions
docTags: 
createdAt: 2026-10-12T16:38:28.335Z
---

{
  "id": "ELiUL9Q65p-6xqgJvw0Xa",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "https://api.nue.io/cpq/field-permissions",
    "servers": [
      {
        "url": "https://api.nue.io/cpq/field-permissions",
        "description": "Nue Production API Endpoint"
      },
      {
        "url": "https://api.sandbox.nue.io/cpq/field-permissions",
        "description": "Nue Sandbox API Endpoint"
      }
    ],
    "name": "Grant Field Permissions",
    "description": "<p>Grant one or more permission sets read and edit access to one or more custom fields. Granting access a permission set already has is not an error — it is reported as unchanged. A field created for a line attribute is copied onto several objects, and each copy carries its own field-level security, so making one attribute usable normally means granting access on every object the field was created on. Not every field can carry field-level security: required, master-detail, autonumber and formula fields are visible to anyone who can see the object. Such a field is reported in errors and the remaining fields are still granted, so check success and results rather than assuming the whole request applied.</p>",
    "contentType": "application/json",
    "request": {
      "pathParameters": [],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json",
            "*/*"
          ],
          "default": "application/json"
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [
        {
          "kind": "required",
          "name": "body",
          "type": "object",
          "example": "",
          "description": "",
          "customType": "GrantFieldPermissionsRequest",
          "schema": [
            {
              "name": "permissionSetIds",
              "kind": "optional",
              "type": "array",
              "description": "<p>Salesforce ids of the permission sets to grant access through. Supply this or permissionSetNames; ids are unambiguous and are the safer choice once the caller has them.</p>",
              "example": "",
              "itemType": "string",
              "customType": "string[]",
              "itemExample": "",
              "itemDefault": ""
            },
            {
              "name": "permissionSetNames",
              "kind": "optional",
              "type": "array",
              "description": "<p>Permission set names or labels, resolved the same tolerant way the lookup resolves them. A name that matches more than one permission set is rejected rather than guessed at, so the wrong team is never granted access.</p>",
              "example": "",
              "itemType": "string",
              "customType": "string[]",
              "itemExample": "",
              "itemDefault": ""
            },
            {
              "name": "fields",
              "kind": "required",
              "type": "array",
              "description": "The fields to grant access to",
              "modelRef": "#/components/schemas/FieldPermissionTarget",
              "customType": "FieldPermissionTarget[]",
              "schema": [
                {
                  "name": "objectApiName",
                  "kind": "required",
                  "type": "string",
                  "description": "<p>The object the field belongs to, e.g. QuoteLineItem</p>",
                  "example": ""
                },
                {
                  "name": "fieldApiName",
                  "kind": "required",
                  "type": "string",
                  "description": "<p>The Salesforce api name of the field, including any namespace prefix and the __c suffix, e.g. Ruby__PO_Number__c</p>",
                  "example": ""
                }
              ]
            },
            {
              "name": "readable",
              "kind": "optional",
              "type": "boolean",
              "description": "<p>Whether the field should be readable. Defaults to true; a field that is not readable is invisible regardless of any other setting.</p>",
              "example": "",
              "default": true
            },
            {
              "name": "editable",
              "kind": "optional",
              "type": "boolean",
              "description": "<p>Whether the field should be editable. Defaults to true. Salesforce rejects edit access without read access, so editable true requires readable true.</p>",
              "example": "",
              "default": true
            }
          ],
          "modelRef": "#/components/schemas/GrantFieldPermissionsRequest",
          "isExpanded": true
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": [
        {
          "id": "apiKeyAuth",
          "name": "nue-api-key",
          "kind": "optional",
          "type": "apiKey",
          "in": "header"
        }
      ],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "<p>The request was carried out; check success and results for what was actually granted</p>",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "example": "",
            "description": "",
            "customType": "GrantFieldPermissionsResponse",
            "schema": [
              {
                "name": "success",
                "kind": "optional",
                "type": "boolean",
                "description": "<p>True only when everything asked for was granted, with nothing rejected or dropped. Check this rather than the HTTP status.</p>",
                "example": ""
              },
              {
                "name": "granted",
                "kind": "optional",
                "type": "integer<int32>",
                "description": "<p>How many permission set and field pairs now have the requested access, including ones that already had it</p>",
                "example": "",
                "format": "int32"
              },
              {
                "name": "failed",
                "kind": "optional",
                "type": "integer<int32>",
                "description": "How many pairs Salesforce refused",
                "example": "",
                "format": "int32"
              },
              {
                "name": "results",
                "kind": "optional",
                "type": "array",
                "description": "<p>The outcome for every pair, so a partial grant can be acted on</p>",
                "modelRef": "#/components/schemas/FieldPermissionResult",
                "customType": "FieldPermissionResult[]",
                "schema": [
                  {
                    "name": "permissionSetId",
                    "kind": "optional",
                    "type": "string",
                    "description": "The permission set the access was granted through",
                    "example": ""
                  },
                  {
                    "name": "permissionSetName",
                    "kind": "optional",
                    "type": "string",
                    "description": "The developer name of that permission set",
                    "example": ""
                  },
                  {
                    "name": "objectApiName",
                    "kind": "optional",
                    "type": "string",
                    "description": "The object the field belongs to",
                    "example": ""
                  },
                  {
                    "name": "fieldApiName",
                    "kind": "optional",
                    "type": "string",
                    "description": "The field access was granted on",
                    "example": ""
                  },
                  {
                    "name": "readable",
                    "kind": "optional",
                    "type": "boolean",
                    "description": "Whether the field ended up readable",
                    "example": ""
                  },
                  {
                    "name": "editable",
                    "kind": "optional",
                    "type": "boolean",
                    "description": "Whether the field ended up editable",
                    "example": ""
                  },
                  {
                    "name": "created",
                    "kind": "optional",
                    "type": "boolean",
                    "description": "Whether a new permission was created",
                    "example": ""
                  },
                  {
                    "name": "updated",
                    "kind": "optional",
                    "type": "boolean",
                    "description": "Whether an existing permission was changed to match what was asked for",
                    "example": ""
                  },
                  {
                    "name": "unchanged",
                    "kind": "optional",
                    "type": "boolean",
                    "description": "<p>Whether the permission set already had exactly this access, in which case nothing was done</p>",
                    "example": ""
                  },
                  {
                    "name": "error",
                    "kind": "optional",
                    "type": "string",
                    "description": "<p>Why this one pair failed, when it did. The other pairs in the same request are unaffected.</p>",
                    "example": ""
                  }
                ]
              },
              {
                "name": "errors",
                "kind": "optional",
                "type": "array",
                "description": "<p>Why part or all of the request could not be carried out, such as a field that cannot carry field-level security or a name matching more than one permission set</p>",
                "example": "",
                "itemType": "string",
                "customType": "string[]",
                "itemExample": "",
                "itemDefault": ""
              },
              {
                "name": "warnings",
                "kind": "optional",
                "type": "array",
                "description": "<p>Notes that did not stop the grant, such as a field that was granted read access because it is not updateable</p>",
                "example": "",
                "itemType": "string",
                "customType": "string[]",
                "itemExample": "",
                "itemDefault": ""
              },
              {
                "name": "syncedToNue",
                "kind": "optional",
                "type": "boolean",
                "description": "<p>True when the custom fields were synced to Nue after the grant. A field created without access is left unsynced by createCustomField; granting access is what brings it into Nue</p>",
                "example": ""
              }
            ],
            "modelRef": "#/components/schemas/GrantFieldPermissionsResponse",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "400",
        "description": "<p>No permission set was supplied, a name matched more than one permission set, or the request was otherwise incomplete</p>",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "404",
        "description": "Not Found",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "501",
        "description": "<p>The tenant is not Salesforce-integrated</p>",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "WyutMiEmdn_ZclNShb_2L",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url https://api.nue.io/cpq/field-permissions \\\n     --header 'accept: application/json' \\\n     --header 'content-type: application/json' \\\n     --data '{\n     \"fields\": [\n     {\n     \"objectApiName\": \"\",\n     \"fieldApiName\": \"\"\n     }\n     ],\n     \"readable\": true,\n     \"editable\": true\n     }'"
        },
        {
          "id": "7VC-oDi6FIF3QRxfx40Wu",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\nmyHeaders.append(\"content-type\", \"application/json\");\n\nvar raw = JSON.stringify({\n   \"fields\": [\n      {\n         \"objectApiName\": \"\",\n         \"fieldApiName\": \"\"\n      }\n   ],\n   \"readable\": true,\n   \"editable\": true\n});\n\nvar requestOptions = {\n   method: 'POST',\n   headers: myHeaders,\n   body: raw,\n   redirect: 'follow'\n};\n\nfetch(\"https://api.nue.io/cpq/field-permissions\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "S01pgZxdAiB7lEjwOSDzo",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://api.nue.io/cpq/field-permissions\")\n\nhttps = Net::HTTP.new(url.host, url.port)\nhttps.use_ssl = true\n\nrequest = Net::HTTP::Post.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\nrequest.body = JSON.dump({\n   \"fields\": [\n      {\n         \"objectApiName\": \"\",\n         \"fieldApiName\": \"\"\n      }\n   ],\n   \"readable\": true,\n   \"editable\": true\n})\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "RsSeQo6TRAQPotk-kPcUH",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://api.nue.io/cpq/field-permissions\"\n\npayload = json.dumps({\n   \"fields\": [\n      {\n         \"objectApiName\": \"\",\n         \"fieldApiName\": \"\"\n      }\n   ],\n   \"readable\": True,\n   \"editable\": True\n})\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json'\n}\n\nresponse = requests.request(\"POST\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "WyutMiEmdn_ZclNShb_2L"
    },
    "results": {
      "languages": [
        {
          "id": "hW5pZE0WNVqIc1f8Oe5rH",
          "language": "200",
          "code": "// The request was carried out; check success and results for what was actually granted\n{\n  \"success\": false,\n  \"granted\": \"\",\n  \"failed\": \"\",\n  \"results\": [\n    {\n      \"permissionSetId\": \"\",\n      \"permissionSetName\": \"\",\n      \"objectApiName\": \"\",\n      \"fieldApiName\": \"\",\n      \"readable\": false,\n      \"editable\": false,\n      \"created\": false,\n      \"updated\": false,\n      \"unchanged\": false,\n      \"error\": \"\"\n    }\n  ],\n  \"errors\": [\n    \"\"\n  ],\n  \"warnings\": [\n    \"\"\n  ],\n  \"syncedToNue\": false\n}"
        },
        {
          "id": "TMdGJ2PrMIVUOFt2rx13n",
          "language": "400",
          "code": "// No permission set was supplied, a name matched more than one permission set, or the request was otherwise incomplete\n"
        },
        {
          "id": "kINz7qwO7XD4-sPSjhuPF",
          "language": "404",
          "code": "// Not Found\n"
        },
        {
          "id": "icOpXZb9IpfxDcnI07Ur-",
          "language": "501",
          "code": "// The tenant is not Salesforce-integrated\n"
        }
      ],
      "selectedLanguageId": "hW5pZE0WNVqIc1f8Oe5rH"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}