> For the complete documentation index, see [llms.txt](https://documentation.efalia.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://documentation.efalia.com/api-reference/efalia-process-api/role.md).

# Role

## Get Roles of an Actor

> Get the list of roles an actor can play.\
> \### Note\
> The label might be null as the list is not always localized.

```json
{"openapi":"3.0.0","info":{"title":"Efalia Process API","version":"6.36.1"},"tags":[{"name":"Role","description":""}],"servers":[{"url":"http://{hostname}/{workeyContext}/api/","variables":{"hostname":{"default":"localhost:8080","description":"Hostname and port of the Workey server"},"workeyContext":{"default":"workey","description":"Name of the running context of Workey"}}}],"security":[{"Basic":[]},{"Bearer":[]},{"ApiKey":[],"ApiKeyImpersonate":[]}],"components":{"securitySchemes":{"Basic":{"type":"http","scheme":"basic","description":"Value: Basic {encode username:password}"},"Bearer":{"type":"http","scheme":"bearer","description":"Value: Bearer {jwt}"},"ApiKey":{"type":"apiKey","name":"X-API-KEY","in":"header","description":"API key defined in Process configuration."}},"responses":{"WorkeyUnauthorized":{"description":"Unauthorized Workey access error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestMessage"}}}},"WorkeyError":{"description":"Unexpected Workey Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestMessage"}}}}},"schemas":{"RestMessage":{"type":"object","properties":{"code":{"type":"integer"},"error":{"type":"boolean"},"message":{"type":"string"},"cause":{"$ref":"#/components/schemas/ErrorCause"}}},"ErrorCause":{"type":"object","properties":{"className":{"type":"string"},"method":{"type":"string"},"line":{"type":"integer"},"stackTrace":{"type":"object"}}}}},"paths":{"/role":{"get":{"summary":"Get Roles of an Actor","description":"Get the list of roles an actor can play.\n### Note\nThe label might be null as the list is not always localized.","operationId":"getActorRoles","deprecated":false,"tags":["Role"],"responses":{"200":{"description":"{[\n  \"name\": \"R1\",\n  \"label\": \"Role 1\",\n  \"id\": 153\n]}"},"401":{"$ref":"#/components/responses/WorkeyUnauthorized"},"555":{"$ref":"#/components/responses/WorkeyError"}}}}}}
```

## Get Role

> Get basic information on a role.

```json
{"openapi":"3.0.0","info":{"title":"Efalia Process API","version":"6.36.1"},"tags":[{"name":"Role","description":""}],"servers":[{"url":"http://{hostname}/{workeyContext}/api/","variables":{"hostname":{"default":"localhost:8080","description":"Hostname and port of the Workey server"},"workeyContext":{"default":"workey","description":"Name of the running context of Workey"}}}],"security":[{"Basic":[]},{"Bearer":[]},{"ApiKey":[],"ApiKeyImpersonate":[]}],"components":{"securitySchemes":{"Basic":{"type":"http","scheme":"basic","description":"Value: Basic {encode username:password}"},"Bearer":{"type":"http","scheme":"bearer","description":"Value: Bearer {jwt}"},"ApiKey":{"type":"apiKey","name":"X-API-KEY","in":"header","description":"API key defined in Process configuration."}},"responses":{"WorkeyUnauthorized":{"description":"Unauthorized Workey access error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestMessage"}}}},"WorkeyError":{"description":"Unexpected Workey Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestMessage"}}}}},"schemas":{"RestMessage":{"type":"object","properties":{"code":{"type":"integer"},"error":{"type":"boolean"},"message":{"type":"string"},"cause":{"$ref":"#/components/schemas/ErrorCause"}}},"ErrorCause":{"type":"object","properties":{"className":{"type":"string"},"method":{"type":"string"},"line":{"type":"integer"},"stackTrace":{"type":"object"}}}}},"paths":{"/role/{roleId}":{"get":{"summary":"Get Role","description":"Get basic information on a role.","operationId":"getRole","deprecated":false,"tags":["Role"],"parameters":[{"name":"roleId","in":"path","required":true,"schema":{"type":"string"},"description":"The ``Id`` of the role"}],"responses":{"200":{"description":"{\n  \"name\": \"R1\",\n  \"label\": \"Role 1\",\n  \"id\": 153\n}"},"401":{"$ref":"#/components/responses/WorkeyUnauthorized"},"555":{"$ref":"#/components/responses/WorkeyError"}}}}}}
```

## Set Role Actors

> Set the list of actors belonging to a specified role.\
> \
> \<a href="./#wky-note-workflow-manager" class="wky-label wky-label-workflow-manager">Workflow Manager\</a>\
> \### Note\
> See \<a href="#Actors\_put\_replaceActors">Update Role Actors\</a> to add actors \
> &#x20;without overwriting the existing list. Only the "name" or "dn" attribute is used when setting actors. \
> &#x20;The "id" attribute is ignored.

```json
{"openapi":"3.0.0","info":{"title":"Efalia Process API","version":"6.36.1"},"tags":[{"name":"Role","description":""}],"servers":[{"url":"http://{hostname}/{workeyContext}/api/","variables":{"hostname":{"default":"localhost:8080","description":"Hostname and port of the Workey server"},"workeyContext":{"default":"workey","description":"Name of the running context of Workey"}}}],"security":[{"Basic":[]},{"Bearer":[]},{"ApiKey":[],"ApiKeyImpersonate":[]}],"components":{"securitySchemes":{"Basic":{"type":"http","scheme":"basic","description":"Value: Basic {encode username:password}"},"Bearer":{"type":"http","scheme":"bearer","description":"Value: Bearer {jwt}"},"ApiKey":{"type":"apiKey","name":"X-API-KEY","in":"header","description":"API key defined in Process configuration."}},"schemas":{"Actor":{"allOf":[{"$ref":"#/components/schemas/WorkeyObject"},{"type":"object","properties":{"type":{"$ref":"#/components/schemas/ActorType"},"language":{"type":"string"},"manager":{"$ref":"#/components/schemas/ActorManager"},"roles":{"type":"array","items":{"$ref":"#/components/schemas/Role"}},"units":{"type":"array","items":{"$ref":"#/components/schemas/Unit"}},"delegations":{"type":"array","items":{"$ref":"#/components/schemas/Delegation"}},"availableDocuments":{"type":"array","items":{"$ref":"#/components/schemas/AvailableDocument"}}}}]},"WorkeyObject":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"name":{"type":"string"},"label":{"type":"string"},"description":{"type":"string"}}},"ActorType":{"type":"string","enum":["AGENT","PERSON","UNIT","CUSTOMER"]},"ActorManager":{"type":"object","properties":{"processes":{"type":"array","items":{"$ref":"#/components/schemas/Process"}},"workflow":{"type":"boolean"},"units":{"type":"array","items":{"$ref":"#/components/schemas/Unit"}}}},"Process":{"allOf":[{"$ref":"#/components/schemas/WorkeyObject"},{"type":"object","properties":{"date":{"type":"string","format":"date-time"},"roles":{"type":"array","items":{"$ref":"#/components/schemas/Role"}},"documentTypes":{"type":"array","items":{"$ref":"#/components/schemas/WorkeyObject"}},"active":{"type":"boolean"},"version":{"type":"integer"}}}]},"Role":{"allOf":[{"$ref":"#/components/schemas/WorkeyObject"},{"type":"object","properties":{"processType":{"$ref":"#/components/schemas/Process"},"agent":{"type":"boolean"}}}]},"Unit":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"type":{"$ref":"#/components/schemas/ActorType"},"dn":{"type":"string"},"cn":{"type":"string"},"childrenUnits":{"type":"array","items":{"$ref":"#/components/schemas/Unit"}}}},"Delegation":{"type":"object","properties":{"role":{"$ref":"#/components/schemas/WorkeyObject"},"documentType":{"$ref":"#/components/schemas/WorkeyObject"},"from":{"$ref":"#/components/schemas/WorkeyObject"},"processType":{"$ref":"#/components/schemas/WorkeyObject"},"delegates":{"type":"array","items":{"$ref":"#/components/schemas/WorkeyObject"}},"status":{"type":"string"},"startTime":{"type":"string","format":"date-time"},"endTime":{"type":"string","format":"date-time"}}},"AvailableDocument":{"type":"object","properties":{"processType":{"$ref":"#/components/schemas/WorkeyObject"},"documentType":{"$ref":"#/components/schemas/WorkeyObject"},"role":{"$ref":"#/components/schemas/WorkeyObject"},"url":{"type":"string"}}},"RestMessage":{"type":"object","properties":{"code":{"type":"integer"},"error":{"type":"boolean"},"message":{"type":"string"},"cause":{"$ref":"#/components/schemas/ErrorCause"}}},"ErrorCause":{"type":"object","properties":{"className":{"type":"string"},"method":{"type":"string"},"line":{"type":"integer"},"stackTrace":{"type":"object"}}}},"responses":{"WorkeyUnauthorized":{"description":"Unauthorized Workey access error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestMessage"}}}},"WorkeyError":{"description":"Unexpected Workey Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestMessage"}}}}}},"paths":{"/role/{roleId}":{"post":{"summary":"Set Role Actors","description":"Set the list of actors belonging to a specified role.\n\n<a href=\"./#wky-note-workflow-manager\" class=\"wky-label wky-label-workflow-manager\">Workflow Manager</a>\n### Note\nSee <a href=\"#Actors_put_replaceActors\">Update Role Actors</a> to add actors \n without overwriting the existing list. Only the \"name\" or \"dn\" attribute is used when setting actors. \n The \"id\" attribute is ignored.","operationId":"setRoleActors","deprecated":false,"tags":["Role"],"parameters":[{"name":"roleId","in":"path","required":true,"schema":{"type":"string"},"description":"The ``Id`` of the role"}],"requestBody":{"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Actor"}}}}},"responses":{"200":{"description":"\"Actors for role #{roleId} updated.\""},"401":{"$ref":"#/components/responses/WorkeyUnauthorized"},"555":{"$ref":"#/components/responses/WorkeyError"}}}}}}
```

## Get Role Actors

> Get the list of all the actors of a specified role.

```json
{"openapi":"3.0.0","info":{"title":"Efalia Process API","version":"6.36.1"},"tags":[{"name":"Role","description":""}],"servers":[{"url":"http://{hostname}/{workeyContext}/api/","variables":{"hostname":{"default":"localhost:8080","description":"Hostname and port of the Workey server"},"workeyContext":{"default":"workey","description":"Name of the running context of Workey"}}}],"security":[{"Basic":[]},{"Bearer":[]},{"ApiKey":[],"ApiKeyImpersonate":[]}],"components":{"securitySchemes":{"Basic":{"type":"http","scheme":"basic","description":"Value: Basic {encode username:password}"},"Bearer":{"type":"http","scheme":"bearer","description":"Value: Bearer {jwt}"},"ApiKey":{"type":"apiKey","name":"X-API-KEY","in":"header","description":"API key defined in Process configuration."}},"responses":{"WorkeyUnauthorized":{"description":"Unauthorized Workey access error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestMessage"}}}},"WorkeyError":{"description":"Unexpected Workey Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestMessage"}}}}},"schemas":{"RestMessage":{"type":"object","properties":{"code":{"type":"integer"},"error":{"type":"boolean"},"message":{"type":"string"},"cause":{"$ref":"#/components/schemas/ErrorCause"}}},"ErrorCause":{"type":"object","properties":{"className":{"type":"string"},"method":{"type":"string"},"line":{"type":"integer"},"stackTrace":{"type":"object"}}}}},"paths":{"/role/{roleId}/actors":{"get":{"summary":"Get Role Actors","description":"Get the list of all the actors of a specified role.","operationId":"getRoleActors","deprecated":false,"tags":["Role"],"parameters":[{"name":"roleId","in":"path","required":true,"schema":{"type":"string"},"description":"The ``Id`` of the role"}],"responses":{"200":{"description":"[{\n  \"dn\": \"mlaframboise\",\n  \"id\": 35,\n  \"cn\": \"Marmion Laframboise\"\n}, {\n  \"dn\": \"apariseau\",\n  \"id\": 39,\n  \"cn\": \"Aleron Pariseau\"\n}, {\n  \"dn\": \"bdeblois\",\n  \"id\": 12715,\n  \"cn\": \"Belda Deblois\"\n}, {\n  \"dn\": \"hferland\",\n  \"id\": 12716,\n  \"cn\": \"Harcourt Ferland\"\n}]"},"401":{"$ref":"#/components/responses/WorkeyUnauthorized"},"555":{"$ref":"#/components/responses/WorkeyError"}}}}}}
```

## Get Role Delegations

> Get delegations for a role. This return the list of actors who delegated this role.

```json
{"openapi":"3.0.0","info":{"title":"Efalia Process API","version":"6.36.1"},"tags":[{"name":"Role","description":""}],"servers":[{"url":"http://{hostname}/{workeyContext}/api/","variables":{"hostname":{"default":"localhost:8080","description":"Hostname and port of the Workey server"},"workeyContext":{"default":"workey","description":"Name of the running context of Workey"}}}],"security":[{"Basic":[]},{"Bearer":[]},{"ApiKey":[],"ApiKeyImpersonate":[]}],"components":{"securitySchemes":{"Basic":{"type":"http","scheme":"basic","description":"Value: Basic {encode username:password}"},"Bearer":{"type":"http","scheme":"bearer","description":"Value: Bearer {jwt}"},"ApiKey":{"type":"apiKey","name":"X-API-KEY","in":"header","description":"API key defined in Process configuration."}},"responses":{"WorkeyUnauthorized":{"description":"Unauthorized Workey access error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestMessage"}}}},"WorkeyError":{"description":"Unexpected Workey Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestMessage"}}}}},"schemas":{"RestMessage":{"type":"object","properties":{"code":{"type":"integer"},"error":{"type":"boolean"},"message":{"type":"string"},"cause":{"$ref":"#/components/schemas/ErrorCause"}}},"ErrorCause":{"type":"object","properties":{"className":{"type":"string"},"method":{"type":"string"},"line":{"type":"integer"},"stackTrace":{"type":"object"}}}}},"paths":{"/role/{roleId}/delegations":{"get":{"summary":"Get Role Delegations","description":"Get delegations for a role. This return the list of actors who delegated this role.","operationId":"getRoleDelegations","deprecated":false,"tags":["Role"],"parameters":[{"name":"roleId","in":"path","required":true,"schema":{"type":"string"},"description":"The ``Id`` of the role"}],"responses":{"200":{"description":"[{\n  \"ldapClass\": \"Person\",\n  \"roles\": [],\n  \"dn\": \"abernier\",\n  \"id\": 4,\n  \"delegations\": [],\n  \"type\": \"Person\",\n  \"availableDocuments\": [{\n    \"processTypeId\": 61,\n    \"processTypeDn\": \"Test_Docx\",\n    \"roleId\": 257,\n    \"documentTypeDn\": \"Test_Docx\",\n    \"roleDn\": \"R1\",\n    \"documentTypeId\": 74\n  }]\n}, {\n  \"ldapClass\": \"Person\",\n  \"roles\": [],\n  \"dn\": \"ariel\",\n  \"id\": 12713,\n  \"delegations\": [],\n  \"type\": \"Person\",\n  \"availableDocuments\": [{\n    \"processTypeId\": 61,\n    \"processTypeDn\": \"Test_Docx\",\n    \"roleId\": 257,\n    \"documentTypeDn\": \"Test_Docx\",\n    \"roleDn\": \"R1\",\n    \"documentTypeId\": 74\n  }]\n}]"},"401":{"$ref":"#/components/responses/WorkeyUnauthorized"},"555":{"$ref":"#/components/responses/WorkeyError"}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://documentation.efalia.com/api-reference/efalia-process-api/role.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
