Relations

Create Relation

Creates the relation. The chains are rebuilt in the background, and the parent is mirrored onto the IB records of the child's profile that have no parent yet; `operationId` identifies that work (see `GET /relation-operations/{operationId}`).

POST
/relations

Authorization

appToken write
AuthorizationBearer <token>

App access token issued by POST /tokens (client credentials). Full-access Apps hold the read and write scopes, read-only Apps hold read only. Send it as Authorization: Bearer <token>.

In: header

Scope: write

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/relations" \  -H "Content-Type: application/json" \  -d '{}'
{  "relationId": "string",  "childUserId": "string",  "parentUserId": "string",  "childUser": {    "userId": "string",    "profileId": "string",    "profile": {      "profileId": "string",      "firstName": "string",      "lastName": "string",      "middleName": "string",      "countryNumericCode": "string",      "enabled": true,      "contacts": [        {          "contactId": "string",          "key": "email",          "value": "string",          "createTime": "2019-08-24T14:15:22Z",          "updateTime": "2019-08-24T14:15:22Z",          "uuid": "string"        }      ],      "createTime": "2019-08-24T14:15:22Z",      "updateTime": "2019-08-24T14:15:22Z",      "uuid": "string"    },    "groupId": "string",    "group": {      "groupId": "string",      "name": "string",      "formula": "string",      "levels": [        {          "levelId": "string",          "groupId": "string",          "level": 0,          "formulaValue": "string",          "createTime": "2019-08-24T14:15:22Z",          "updateTime": "2019-08-24T14:15:22Z",          "uuid": "string"        }      ],      "tiers": [        {          "tierId": "string",          "groupId": "string",          "name": "string",          "ratio": "string",          "users": 0,          "volume": "string",          "createTime": "2019-08-24T14:15:22Z",          "updateTime": "2019-08-24T14:15:22Z",          "uuid": "string"        }      ],      "dealLevelCommission": false,      "selfRebate": false,      "selfRebateRatio": "100",      "registration": "auto",      "restrictionId": "string",      "createTime": "2019-08-24T14:15:22Z",      "updateTime": "2019-08-24T14:15:22Z",      "uuid": "string",      "verification": true,      "approvalPolicy": {        "mode": "nobody",        "countries": [          "string"        ]      }    },    "enabled": true,    "master": true,    "masterMaxLevel": 0,    "masterRatio": "string",    "ratio": "string",    "selfRebate": true,    "selfRebateRatio": "string",    "protection": true,    "tag": "string",    "createTime": "2019-08-24T14:15:22Z",    "updateTime": "2019-08-24T14:15:22Z",    "uuid": "string"  },  "parentUser": {    "userId": "string",    "profileId": "string",    "profile": {      "profileId": "string",      "firstName": "string",      "lastName": "string",      "middleName": "string",      "countryNumericCode": "string",      "enabled": true,      "contacts": [        {          "contactId": "string",          "key": "email",          "value": "string",          "createTime": "2019-08-24T14:15:22Z",          "updateTime": "2019-08-24T14:15:22Z",          "uuid": "string"        }      ],      "createTime": "2019-08-24T14:15:22Z",      "updateTime": "2019-08-24T14:15:22Z",      "uuid": "string"    },    "groupId": "string",    "group": {      "groupId": "string",      "name": "string",      "formula": "string",      "levels": [        {          "levelId": "string",          "groupId": "string",          "level": 0,          "formulaValue": "string",          "createTime": "2019-08-24T14:15:22Z",          "updateTime": "2019-08-24T14:15:22Z",          "uuid": "string"        }      ],      "tiers": [        {          "tierId": "string",          "groupId": "string",          "name": "string",          "ratio": "string",          "users": 0,          "volume": "string",          "createTime": "2019-08-24T14:15:22Z",          "updateTime": "2019-08-24T14:15:22Z",          "uuid": "string"        }      ],      "dealLevelCommission": false,      "selfRebate": false,      "selfRebateRatio": "100",      "registration": "auto",      "restrictionId": "string",      "createTime": "2019-08-24T14:15:22Z",      "updateTime": "2019-08-24T14:15:22Z",      "uuid": "string",      "verification": true,      "approvalPolicy": {        "mode": "nobody",        "countries": [          "string"        ]      }    },    "enabled": true,    "master": true,    "masterMaxLevel": 0,    "masterRatio": "string",    "ratio": "string",    "selfRebate": true,    "selfRebateRatio": "string",    "protection": true,    "tag": "string",    "createTime": "2019-08-24T14:15:22Z",    "updateTime": "2019-08-24T14:15:22Z",    "uuid": "string"  },  "createTime": "2019-08-24T14:15:22Z",  "updateTime": "2019-08-24T14:15:22Z",  "uuid": "string",  "operationId": "3051932a-fdd2-48fa-b330-7e7d41535969"}
{  "message": "string",  "code": "string",  "errors": {    "property1": [      "string"    ],    "property2": [      "string"    ]  },  "details": [    {      "field": "string",      "issue": "string"    }  ]}
{  "message": "string",  "code": "string",  "errors": {    "property1": [      "string"    ],    "property2": [      "string"    ]  },  "details": [    {      "field": "string",      "issue": "string"    }  ]}
{  "error": {    "message": "This App is read-only and cannot perform this operation.",    "code": "insufficient_scope"  }}
{  "message": "string",  "code": "string",  "errors": {    "property1": [      "string"    ],    "property2": [      "string"    ]  },  "details": [    {      "field": "string",      "issue": "string"    }  ]}
{  "message": "string",  "code": "string",  "errors": {    "property1": [      "string"    ],    "property2": [      "string"    ]  },  "details": [    {      "field": "string",      "issue": "string"    }  ]}