For Developers

Create Rule

POST https://ed.link/api/v2/teams/:team_id/integrations/:integration_id/rules

Creates a new integration rule and schedules a materialization.

Permissions

Requires either the rules.create or rules.update system permission.

Parameters

ParameterTypeRequiredDescription
:team_idUUIDYesThe ID of the team.
:integration_idUUIDYesThe ID of the integration.

Request Body

PropertyTypeRequiredDescription
nameStringNoName of the rule.
targetStringYesTarget entity type: people, classes, schools, or enrollments.
stateStringNodraft, suggested, or active. Defaults to draft.
typeStringNosharing or licensing.
conditionsArrayNoEach condition needs target, property, operator, and values.

Sample Request

const response = await axios.post(
    `https://ed.link/api/v2/teams/${team_id}/integrations/${integration_id}/rules`,
    {
        name: 'People Sharing Rule',
        target: 'people',
        state: 'draft',
        conditions: []
    },
    {
        headers: {
            authorization: `Bearer ${user_session_token}`,
            'content-type': 'application/json'
        }
    }
);

Sample Response

{
    "$data": {
        "id": "7ca194a2-1982-4f91-8841-59128aa10234",
        "name": "People Sharing Rule",
        "state": "draft",
        "target": "people"
    }
}