Create an assignment
Binds a definition to an actor and optionally provides parameter values for that actor.
The scopeType determines which actor field is required:
| Scope type | Required field | Description |
|---|---|---|
ALL_TENANTS | (none) | Applies to every tenant |
TENANT | tenantId | Applies to one tenant |
TENANT_USER | tenantUserId | Applies to one tenant user |
ORG_USER | orgUserId | Applies to one organization user |
You cannot assign the same definition to the same actor twice.
Path Parameters
Your Semaphor project ID.
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
application/json
curl -X post "https://semaphor.cloud/api/management/v1/projects/string/unified-security/assignments" \ -H "Content-Type: application/json" \ -d '{ "definitionId": "usd_123", "scopeType": "TENANT", "tenantId": "tenant_123", "params": { "region": "us" } }'{
"ok": true,
"data": {
"assignment": {
"id": "string",
"definitionId": "string",
"scopeType": "ALL_TENANTS",
"orgUserId": "string",
"tenantId": "string",
"tenantUserId": "string",
"params": {
"property1": "string",
"property2": "string"
},
"createdAt": "2019-08-24T14:15:22Z",
"updatedAt": "2019-08-24T14:15:22Z"
}
}
}{
"ok": false,
"error": {
"code": "INVALID_REQUEST",
"message": "string",
"details": {}
}
}{
"ok": false,
"error": {
"code": "INVALID_REQUEST",
"message": "string",
"details": {}
}
}{
"ok": false,
"error": {
"code": "INVALID_REQUEST",
"message": "string",
"details": {}
}
}{
"ok": false,
"error": {
"code": "INVALID_REQUEST",
"message": "string",
"details": {}
}
}{
"ok": false,
"error": {
"code": "INVALID_REQUEST",
"message": "string",
"details": {}
}
}{
"ok": false,
"error": {
"code": "INVALID_REQUEST",
"message": "string",
"details": {}
}
}