Semaphor

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 typeRequired fieldDescription
ALL_TENANTS(none)Applies to every tenant
TENANTtenantIdApplies to one tenant
TENANT_USERtenantUserIdApplies to one tenant user
ORG_USERorgUserIdApplies to one organization user

You cannot assign the same definition to the same actor twice.

POST
/api/management/v1/projects/{projectId}/unified-security/assignments

Path Parameters

projectId*string

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": {}
  }
}