Favicon

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

Create segment role

Required Permission: base.organization.segmentRole.create

Create segment role

POST
/v1/organizations/:organizationId/segment-roles/
Copy to clipboard

Create segment role

Required Permission: base.organization.segmentRole.create

Create segment role

Request

Add parameter in 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
≤ 256 characters
actions array [string] required
{
    "name": "string",
    "actions": [
        "string"
    ]
}

Responses

200 Response application/json
status boolean required
data object required
id string required
Match pattern: ^[a-fA-F0-9]{24}$
name string required
≤ 256 characters
slug string required
≤ 256 characters
actions array [string] required
{
    "status": true,
    "data": {
        "id": "string",
        "name": "string",
        "slug": "string",
        "actions": [
            "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
4004
message string optional
Invalid Token
{
    "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"
    }
}