You are here: Home > API Reference > Platform > Segment Role > Create segment role

Create segment role

Required Permission: base.organization.segmentRole.create

Creates a segment role with the given name and granted actions.

POST
https://api.applivery.io/v1/organizations/{organizationId}/segment-roles

Request

Send your API key in the request header authorization
Example: Authorization: Bearer <token>

organizationId string
required
Match pattern: ^(([a-fA-F0-9]{24})|([a-zA-Z0-9\\-]{3,}))$

Body Params application/json
name string required
Human readable name of the segment role shown in the permissions interface.
≤ 256 characters
description string optional
Free text explaining the purpose of the role and the access it grants.
≤ 256 characters
actions array [string] required
Actions granted by the role. Each entry is a fully qualified action ("namespace.context.resource.operation") or a wildcard covering every action below a prefix: "*", "namespace.*", "namespace.context.*" or "namespace.context.resource.*". Wildcards are stored and returned as given here; the organization and segment actions endpoints always resolve them to the concrete list. billing.* actions are owner-only: only the organization owner may add, remove or delete roles holding them. people.mad.* and owner.* actions are rejected.
{
    "name": "string",
    "description": "string",
    "actions": [
        "string"
    ]
}

Responses

200 Response application/json
status boolean required
data object required
id string required
Identifier of the segment role.
Match pattern: ^[a-fA-F0-9]{24}$
name string required
Human readable name of the segment role shown in the permissions interface.
≤ 256 characters
slug string required
URL friendly identifier derived from the role name and unique within the organization.
≤ 128 characters · ≥ 3 characters · Match pattern: ^[a-z0-9][a-z0-9-]+[a-z0-9]$
description string optional
Free text explaining the purpose of the role and the access it grants.
≤ 256 characters
actions array [string] required
Actions granted by the role. Each entry is a fully qualified action ("namespace.context.resource.operation") or a wildcard covering every action below a prefix: "*", "namespace.*", "namespace.context.*" or "namespace.context.resource.*". Wildcards are stored and returned as given here; the organization and segment actions endpoints always resolve them to the concrete list. billing.* actions are owner-only: only the organization owner may add, remove or delete roles holding them. people.mad.* and owner.* actions are rejected.
createdAt string optional
Timestamp of the moment the segment role was created.
updatedAt string optional
Timestamp of the last modification applied to the segment role.
{
    "status": true,
    "data": {
        "id": "string",
        "name": "string",
        "slug": "string",
        "description": "string",
        "actions": [
            "string"
        ],
        "createdAt": "string",
        "updatedAt": "string"
    }
}
400 Response application/json
status boolean optional
false
error object optional
code number optional
5028
message string optional
Slug reserved
{
    "status": false,
    "error": {
        "code": 5209,
        "message": "Invalid input"
    }
}
401 Response application/json
status boolean optional
false
error object optional
code number optional
4001
message string optional
Unauthorized
{
    "status": false,
    "error": {
        "code": 4002,
        "message": "No auth token"
    }
}
404 Response application/json
status boolean optional
false
error object optional
code number optional
3001
message string optional
Entity not found
{
    "status": false,
    "error": {
        "code": 3001,
        "message": "Entity not found"
    }
}
Was this page helpful?