For the complete documentation index, see llms.txt. This page is also available as Markdown.

Grants

Create grant

post

Creates a grant for the target data structure.

Requires the 'Manage grants' permission on the target structure.

ID of the user receiving the grant (user_id) is required but start_date, end_date, source_user_name and detail are optional. The grant is created with the provided dates (if any). If start_date is omitted, the grant is effective immediately.

The detail field is a free‑form JSON object for additional metadata.

Path parameters
data_structure_idstringRequired

Data Structure external ID

Body
Responses
201

Grant created

application/json
post/api/data_structures/{data_structure_id}/grants
POST /api/data_structures/{data_structure_id}/grants HTTP/1.1
Content-Type: application/json
Accept: */*
Content-Length: 76

{
  "grant": {
    "source_user_name": "foo",
    "start_date": "2026-05-01",
    "user_id": 123
  }
}
{
  "data": {
    "data_structure": {
      "external_id": "ds_ext",
      "id": 456
    },
    "detail": {},
    "id": 123,
    "start_date": "2026-05-01",
    "user_id": 789
  }
}

Search grants for current user

post

Searches grants owned by the current user, not all visible grants.

Supports pagination, scrolling (scroll + scroll_id), and filtering (filters). page defaults to 0 and size defaults to 20. Sorting is by relevance unless specified via sort parameter.

The response includes a x-total-count header.

Soft‑deleted grants are excluded by default.

Requires 'View grants' permission.

Body
pageintegerOptionalDefault: 0
querystring · nullableOptional
scrollstring · nullableOptional
scroll_idstring · nullableOptional
sizeintegerOptionalDefault: 20
sortstring · nullableOptional
Other propertiesanyOptional
Responses
200

Grant search response

application/json
scroll_idstring · nullableOptional
post/api/grants/search/mine
POST /api/grants/search/mine HTTP/1.1
Content-Type: application/json
Accept: */*
Content-Length: 66

{
  "filters": {
    "status": [
      "active"
    ]
  },
  "page": 0,
  "query": "foo",
  "size": 20
}
{
  "data": [
    {
      "data_structure": {
        "id": 1
      },
      "id": 77,
      "user_id": 123
    }
  ],
  "filters": {
    "status": [
      {
        "count": 1,
        "key": "active"
      }
    ]
  },
  "scroll_id": null
}

Get available grant filters

post

Returns the available grant filter values for the caller.

Requires 'View grants' permission.

The returned values are permission-aware and based on the payload sent in the request body. Soft‑deleted grants are excluded.

Body
pageintegerOptionalDefault: 0
querystring · nullableOptional
scrollstring · nullableOptional
scroll_idstring · nullableOptional
sizeintegerOptionalDefault: 20
sortstring · nullableOptional
Other propertiesanyOptional
Responses
200

Available filters

application/json
post/api/grant_filters/search
POST /api/grant_filters/search HTTP/1.1
Content-Type: application/json
Accept: */*
Content-Length: 66

{
  "filters": {
    "status": [
      "active"
    ]
  },
  "page": 0,
  "query": "foo",
  "size": 20
}
{
  "data": {
    "status": [
      {
        "count": 10,
        "key": "active"
      }
    ],
    "user_id": [
      {
        "count": 8,
        "key": 123
      }
    ]
  }
}

Get grant by ID

get

Retrieves a grant by ID and includes only the actions the current user is allowed to perform.

Requires the 'View grants' permission.

Path parameters
idintegerRequired

Grant ID

Responses
200

Grant retrieved

application/json
get/api/grants/{id}
GET /api/grants/{id} HTTP/1.1
Accept: */*
{
  "_actions": {},
  "data": {
    "data_structure": {
      "external_id": "ds_ext",
      "id": 456
    },
    "id": 77,
    "pending_removal": false,
    "user_id": 789
  }
}

Update grant

put

Updates a grant. Two update modes are supported:

  1. Action‑based updates (using the action field):

  • mark_pending_removal – marks the grant for future removal (requires 'Remove grant' permission).

  • unmark_pending_removal – clears the pending removal flag (requires 'Remove grant' permission).

  • set_removed – immediately ends the grant (requires 'Manage grants' permission). The grant’s end_date is set to the current time and pending_removal is cleared.

  1. Attribute update (using the grant object):

  • Updates any of: user_id, start_date, end_date, source_user_name, detail.

  • Requires 'Manage grants' permission.

The request must include either action or grant, but not both.

Path parameters
idintegerRequired

Grant ID

Body
actionstring · enumOptional

Action to perform (optional, when action instead of grant update)

Possible values:
Responses
200

Grant updated

application/json
put/api/grants/{id}
PUT /api/grants/{id} HTTP/1.1
Content-Type: application/json
Accept: */*
Content-Length: 95

{
  "grant": {
    "end_date": "2027-05-01T00:00:00Z",
    "start_date": "2026-05-01T00:00:00Z",
    "user_id": 123
  }
}
{
  "data": {
    "data_structure": {
      "id": 456
    },
    "id": 123,
    "pending_removal": false,
    "user_id": 789
  }
}

Delete grant

delete

Performs a soft‑delete on the grant identified by the given ID (sets deleted_at to the current timestamp) .

Requires the 'Manage grants' permission.

Path parameters
idintegerRequired

Grant ID

Responses
204

Grant deleted

No content

delete/api/grants/{id}
DELETE /api/grants/{id} HTTP/1.1
Accept: */*

No content

Update grant

patch

Updates a grant. Two update modes are supported:

  1. Action‑based updates (using the action field):

  • mark_pending_removal – marks the grant for future removal (requires 'Remove grant' permission).

  • unmark_pending_removal – clears the pending removal flag (requires 'Remove grant' permission).

  • set_removed – immediately ends the grant (requires 'Manage grants' permission). The grant’s end_date is set to the current time and pending_removal is cleared.

  1. Attribute update (using the grant object):

  • Updates any of: user_id, start_date, end_date, source_user_name, detail.

  • Requires 'Manage grants' permission.

The request must include either action or grant, but not both.

Path parameters
idintegerRequired

Grant ID

Body
actionstring · enumOptional

Action to perform (optional, when action instead of grant update)

Possible values:
Responses
200

Grant updated

application/json
patch/api/grants/{id}
PATCH /api/grants/{id} HTTP/1.1
Content-Type: application/json
Accept: */*
Content-Length: 95

{
  "grant": {
    "end_date": "2027-05-01T00:00:00Z",
    "start_date": "2026-05-01T00:00:00Z",
    "user_id": 123
  }
}
{
  "data": {
    "data_structure": {
      "id": 456
    },
    "id": 123,
    "pending_removal": false,
    "user_id": 789
  }
}

Reindex all grants

get

Schedules a full reindex of grants and returns 202 when the job is enqueued.

Requires administrative privileges (administrator or service account).

Responses
202

Reindexing accepted

No content

get/api/grants/search/reindex_all
GET /api/grants/search/reindex_all HTTP/1.1
Accept: */*

No content

Get available grant filters for current user

post

Returns available filter values for grants assigned to the current user, based on the provided search criteria.

Requires 'View grants' permission.

The result is permission-aware and based on the payload sent in the request body. Soft‑deleted grants are excluded.

Body
pageintegerOptionalDefault: 0
querystring · nullableOptional
scrollstring · nullableOptional
scroll_idstring · nullableOptional
sizeintegerOptionalDefault: 20
sortstring · nullableOptional
Other propertiesanyOptional
Responses
200

Available filters

application/json
post/api/grant_filters/search/mine
POST /api/grant_filters/search/mine HTTP/1.1
Content-Type: application/json
Accept: */*
Content-Length: 66

{
  "filters": {
    "status": [
      "active"
    ]
  },
  "page": 0,
  "query": "foo",
  "size": 20
}
{
  "data": {
    "status": [
      {
        "count": 10,
        "key": "active"
      }
    ],
    "user_id": [
      {
        "count": 8,
        "key": 123
      }
    ]
  }
}

List all active grants

get

Lists active grants visible to the current user. The list does not include soft-deleted grants.

Requires the 'View grants' permission.

Responses
200

List of grants

application/json
get/api/grants
GET /api/grants HTTP/1.1
Accept: */*
{
  "data": [
    {
      "data_structure": {
        "external_id": "ds_ext",
        "id": 456
      },
      "id": 77,
      "pending_removal": false,
      "user_id": 789
    }
  ]
}

Bulk create, update and delete grants

put

Accepts a bulk grants payload and processes each operation independently.

Supported operations: add, updateand remove.

Operations are processed independently. A failure in one item does not affect others. The endpoint always returns HTTP 200 even if some items fail. Reports per-item failures in the errors array instead of rejecting the whole request. The response includes:

  • ids – all processed grant IDs (created, updated, removed).

  • created_ids, updated_ids, removed_ids – separate lists for each operation.

  • errors – an array of objects describing each failed operation, including the op, the affected id (if applicable), and a message. Requires Manage grants permission.

Request parameters: Each item in the grants array must include:

  • op – one of 'add', 'update', 'remove'.

  • For add: user_id (required), data_structure_external_id (required), optional start_date, end_date, source_user_name, detail.

  • For update: id (required) and any fields to modify (start_date, end_date, source_user_name, detail).

  • For remove: id (required).

Body
Responses
200

Grants processed

application/json
created_idsinteger[]Required

IDs of grants created by 'add' operations

idsinteger[]Required

IDs of all successfully processed grants (created, updated and removed combined)

removed_idsinteger[]Required

IDs of grants deleted by 'remove' operations

updated_idsinteger[]Required

IDs of grants modified by 'update' operations

put/api/grants_bulk
PUT /api/grants_bulk HTTP/1.1
Content-Type: application/json
Accept: */*
Content-Length: 243

{
  "grants": [
    {
      "data_structure_external_id": "ds_external_1",
      "detail": {},
      "end_date": "2027-01-01",
      "op": "add",
      "source_user_name": "admin",
      "start_date": "2026-01-01",
      "user_id": 123
    },
    {
      "end_date": "2027-06-01",
      "id": 1,
      "op": "update"
    },
    {
      "id": 2,
      "op": "remove"
    }
  ]
}
{
  "created_ids": [
    1
  ],
  "errors": [
    {
      "grant_id": 999,
      "message": "grant_not_found",
      "op": "update"
    }
  ],
  "ids": [
    1,
    2,
    3
  ],
  "removed_ids": [
    3
  ],
  "updated_ids": [
    2
  ]
}

Bulk create, update and delete grants

patch

Accepts a bulk grants payload and processes each operation independently.

Supported operations: add, updateand remove.

Operations are processed independently. A failure in one item does not affect others. The endpoint always returns HTTP 200 even if some items fail. Reports per-item failures in the errors array instead of rejecting the whole request. The response includes:

  • ids – all processed grant IDs (created, updated, removed).

  • created_ids, updated_ids, removed_ids – separate lists for each operation.

  • errors – an array of objects describing each failed operation, including the op, the affected id (if applicable), and a message. Requires Manage grants permission.

Request parameters: Each item in the grants array must include:

  • op – one of 'add', 'update', 'remove'.

  • For add: user_id (required), data_structure_external_id (required), optional start_date, end_date, source_user_name, detail.

  • For update: id (required) and any fields to modify (start_date, end_date, source_user_name, detail).

  • For remove: id (required).

Body
Responses
200

Grants processed

application/json
created_idsinteger[]Required

IDs of grants created by 'add' operations

idsinteger[]Required

IDs of all successfully processed grants (created, updated and removed combined)

removed_idsinteger[]Required

IDs of grants deleted by 'remove' operations

updated_idsinteger[]Required

IDs of grants modified by 'update' operations

patch/api/grants_bulk
PATCH /api/grants_bulk HTTP/1.1
Content-Type: application/json
Accept: */*
Content-Length: 243

{
  "grants": [
    {
      "data_structure_external_id": "ds_external_1",
      "detail": {},
      "end_date": "2027-01-01",
      "op": "add",
      "source_user_name": "admin",
      "start_date": "2026-01-01",
      "user_id": 123
    },
    {
      "end_date": "2027-06-01",
      "id": 1,
      "op": "update"
    },
    {
      "id": 2,
      "op": "remove"
    }
  ]
}
{
  "created_ids": [
    1
  ],
  "errors": [
    {
      "grant_id": 999,
      "message": "grant_not_found",
      "op": "update"
    }
  ],
  "ids": [
    1,
    2,
    3
  ],
  "removed_ids": [
    3
  ],
  "updated_ids": [
    2
  ]
}

Search grants by permissions

post

Searches grants using the supplied criteria while filtering them by the current user's permissions.

Supports pagination, scrolling (scroll + scroll_id), and filtering (filters). page defaults to 0 and size defaults to 20. Sorting is by relevance unless specified via sort parameter.

The response includes a x-total-count header.

Soft‑deleted grants are excluded by default.

Requires 'View grants' permission.

Body
pageintegerOptionalDefault: 0
querystring · nullableOptional
scrollstring · nullableOptional
scroll_idstring · nullableOptional
sizeintegerOptionalDefault: 20
sortstring · nullableOptional
Other propertiesanyOptional
Responses
200

Grant search response

application/json
scroll_idstring · nullableOptional
post/api/grants/search
POST /api/grants/search HTTP/1.1
Content-Type: application/json
Accept: */*
Content-Length: 66

{
  "filters": {
    "status": [
      "active"
    ]
  },
  "page": 0,
  "query": "foo",
  "size": 20
}
{
  "data": [
    {
      "data_structure": {
        "id": 1
      },
      "id": 77,
      "user_id": 123
    }
  ],
  "filters": {
    "status": [
      {
        "count": 1,
        "key": "active"
      }
    ]
  },
  "scroll_id": null
}

Download grants as XLSX

post

Generates an XLSX file containing grant data matching the request filters.

Request parameters:

  • search_by (required) – either 'permissions' (use the caller's permission‑based view) or 'user' (grants where the caller is the grantee).

  • header_labels (required) – a map of original field names to custom column labels in the exported file.

  • Optional: filters (the export ignores pagination and returns all matching records up to 10 000).

Requires the 'View grants' permission. The export includes the matching grant records visible to the caller.

Body
langstring · nullableOptional

Locale used to translate deleted user/group labels. Defaults to the default locale.

Example: es
pageintegerOptional
search_bystring · enumRequiredPossible values:
sizeintegerOptional
Responses
200

XLSX file downloaded

application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
string · binaryOptional
post/api/grants/xlsx/download
POST /api/grants/xlsx/download HTTP/1.1
Content-Type: application/json
Accept: */*
Content-Length: 113

{
  "header_labels": {
    "data_structure_name": "Data Structure Name",
    "user_name": "User Name"
  },
  "search_by": "permissions"
}
binary

Last updated