Relation Operations

List Relation Operations

Every change of the IB tree (relation created or deleted, user deleted, signup) and the background chain work it scheduled, newest first. Finished operations are kept for 3 years. Back office only: App tokens receive `403` with `error.code` = `forbidden`. The list is empty while the IB module's database has no operations tables yet.

GET
/relation-operations

Authorization

backOfficeToken
AuthorizationBearer <token>

Shared static token of the B2Core back office, configured for the IB module (not issued by POST /tokens). Send it as Authorization: Bearer <token>. Back-office-only operations require it; App tokens receive 403 there. On back-office requests the acting-user headers (X-B2Core-User-Id, X-B2Core-User-Type, X-B2Core-User-Email) name the B2Core user who acts, recorded as the initiator of relation operations and reassignments; requests with App tokens ignore them.

In: header

Query Parameters

limit?integer
Range1 <= value <= 100
Default20
offset?integer
Range0 <= value
Default0
filter[type]?string

Comma-separated operation types: relation_create, relation_delete, user_delete, registration

filter[status]?string

pending until the first chain job starts, processing while the jobs run, then completed, or failed when at least one job failed for good. A retry moves a failed operation back to pending.

Value in

  • "pending"
  • "processing"
  • "completed"
  • "failed"
filter[users]?string

Comma-separated user IDs (UUIDs, any letter case; the urn:uuid: and braced forms are accepted too) matched against the subject and the parent

filter[subjectEmail]?string

Case-insensitive part of the subject's email; surrounding spaces are ignored

filter[parentEmail]?string

Case-insensitive part of the parent's email; surrounding spaces are ignored

filter[initiator]?string

Case-insensitive part of the initiator's email or name (App name or system label); surrounding spaces are ignored. Also matched HTML-encoded, the way B2Core stores App names: A&B finds the App A&amp;B.

filter[createdFrom]?string

First day (UTC), inclusive

Formatdate
filter[createdTo]?string

Last day (UTC), inclusive

Formatdate

Response Body

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/relation-operations"
{  "total": 0,  "operations": [    {      "operationId": "3051932a-fdd2-48fa-b330-7e7d41535969",      "type": "relation_create",      "status": "pending",      "subject": {        "userId": "string",        "clientId": "string",        "email": "string",        "name": "string",        "isIb": true,        "deleted": true      },      "parent": {        "userId": "string",        "clientId": "string",        "email": "string",        "name": "string",        "isIb": true,        "deleted": true      },      "relationId": "string",      "progress": {        "total": 0,        "done": 0,        "failed": 0      },      "initiator": {        "type": "admin",        "id": "string",        "email": "string",        "name": "string"      },      "traceId": "string",      "errorMessage": "string",      "startedAt": "2019-08-24T14:15:22Z",      "finishedAt": "2019-08-24T14:15:22Z",      "createTime": "2019-08-24T14:15:22Z",      "updateTime": "2019-08-24T14:15:22Z",      "retries": [        {          "time": "2019-08-24T14:15:22Z",          "initiator": {            "type": "admin",            "id": "string",            "email": "string",            "name": "string"          },          "error": "string",          "failedAt": "2019-08-24T14:15:22Z",          "jobsFailed": 0        }      ]    }  ]}
{  "error": {    "message": "validation failed",    "code": "validation_error",    "details": [      {        "field": "limit",        "issue": "must be an integer between 1 and 100"      }    ]  }}
{  "message": "string",  "code": "string",  "errors": {    "property1": [      "string"    ],    "property2": [      "string"    ]  },  "details": [    {      "field": "string",      "issue": "string"    }  ]}
{  "error": {    "message": "relation operations are available to the back office only",    "code": "forbidden"  }}