Docs

Field Selection

Field selection lets you return only the fields your code needs.

The Universal API uses one query parameter for field selection: fields. You pass a comma-separated list of response fields, and MindCloud trims the returned object or list items to those fields.

The control

ControlWhat it does
fieldsSelects which fields are included in the response data.

fields is a query parameter on the Universal API request. It is not an action argument, and it does not go inside the JSON body.

Field selection applies to object rows inside the response data array.

Requesting fields

For a GET action, add fields next to the other query parameters:

curl --request GET \
  --url "https://embedded.mindcloud.co/v1/universal/slack/latest/actions/list-users" \
  --header "Authorization: Bearer $MINDCLOUD_API_KEY" \
  --get \
  --data-urlencode "connectionId=$CONNECTION_ID" \
  --data-urlencode "fields=id,name,profile.email"

For a POST, PUT, or PATCH action, connectionId still goes in the body, but fields stays in the URL:

curl --request POST \
  --url "https://embedded.mindcloud.co/v1/universal/slack/latest/actions/send-message?fields=id,text,channelId" \
  --header "Authorization: Bearer $MINDCLOUD_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{
    "connectionId": "$CONNECTION_ID",
    "channelId": "C0123456789",
    "text": "Hello from MindCloud"
  }'

Nested fields

Use dot notation for nested objects:

id,name,profile.email

If a response item looks like this:

{
  "id": "U123",
  "name": "Ava",
  "profile": {
    "email": "[email protected]",
    "phone": "+1 555 0100"
  },
  "timezone": "America/New_York"
}

Then fields=id,name,profile.email returns:

{
  "id": "U123",
  "name": "Ava",
  "profile": {
    "email": "[email protected]"
  }
}

Lists and single rows

For list responses, field selection is applied to each item in data.

{
  "success": true,
  "data": [
    {
      "id": "U123",
      "name": "Ava"
    },
    {
      "id": "U456",
      "name": "Ben"
    }
  ]
}

For actions that return one mapped row, field selection is applied to the single item inside the data array.

Field names

MindCloud selects from fields that exist in the mapped response. If you request a field that is not present, it is omitted from the returned data.

When id exists in the response, MindCloud keeps it in the selected output even if you did not ask for it. That makes selected list items easier to identify.

How it works

Field selection happens after the action response is mapped into the Universal API response shape. It does not change which provider endpoint is called, and it does not replace filtering, pagination, or sorting.

Use fields to reduce response size and keep your application code focused on the fields it actually reads.