> ## Documentation Index
> Fetch the complete documentation index at: https://docs.equalsmoney.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Update personas

> Update a persona's details or change their role.

Update a persona's details or change their role.

## Update a persona

<Note>
  **PATCH** `/v2/personas/{personaId}`
</Note>

### Request

Use this request to update or add details about a given persona, such as their last name or their phone number. The `accountId` is required and any other fields are optional, depending on what you want to update.

<Info>
  If updating your own persona, you can't change the `status` to `deactivated`.
</Info>

<CodeGroup>
  ```bash Sample request theme={null}
  curl -i -X PATCH \
    'https://api.equalsmoney.com/v2/personas/f52537d5-d7ad-4d74-aa4a-84f28c818124?accountId=F12345' \
    -H 'Authorization: ApiKey YOUR_API_KEY_HERE' \
    -H 'Content-Type: application/json' \
    -d '{
      "emailAddress": "john.doe@example.com",
      "employeeNumber": "948947464",
      "workNumber": "(807) 940-7411 x8855",
      "jobTitle": "Human Division Manager",
      "status": "active",
      "transactionalEmailPreference": true,
      "cardTransactionPushNotificationPreference": false
    }'
  ```

  ```bash Request structure theme={null}
  curl -i -X PATCH \
    'https://api.equalsmoney.com/v2/personas/{personaId}?accountId={accountId}' \
    -H 'Authorization: ApiKey YOUR_API_KEY_HERE' \
    -H 'Content-Type: application/json' \
    -d '{
      "emailAddress": "string",
      "employeeNumber": "string",
      "workNumber": "string",
      "jobTitle": "string",
      "status": "string",
      "transactionalEmailPreference": "true",
      "cardTransactionPushNotificationPreference": boolean
    }'
  ```
</CodeGroup>

#### Path parameters

<ParamField body="personaId" type="string" required>
  The ID of the persona that you want to update.

  Allowable values: An existing `personaId` (≤ 36 characters)
</ParamField>

#### Query parameters

<ParamField body="accountId" type="string" required>
  The ID of the account that you want to work with.

  Allowable values: An existing `accountId` (≤ 36 characters)
</ParamField>

#### Request body schema

<ParamField body="emailAddress" type="string">
  The persona's email address.

  Allowable values: ≤ 256 characters
</ParamField>

<ParamField body="employeeNumber" type="string">
  The persona's employee number.

  Allowable values: ≤ 256 characters
</ParamField>

<ParamField body="workNumber" type="string">
  The persona's work phone number.

  Allowable values: ≤ 50 characters
</ParamField>

<ParamField body="jobTitle" type="string">
  The persona's job title.

  Allowable values: ≤ 256 characters
</ParamField>

<ParamField body="status" type="string">
  The persona's status.

  Allowable values: `active`, `deactivated`
</ParamField>

<ParamField body="transactionalEmailPreference" type="boolean or null">
  Whether or not the persona has opted to receive emails.

  Allowable values: `true`, `false`
</ParamField>

<ParamField body="cardTransactionPushNotificationPreference" type="boolean">
  Whether or not the persona has opted to receive push notifications for all card transactions.

  Allowable values: `true`, `false`
</ParamField>

### Response

If your request is successful, you'll receive a `200` response containing the updated details for this persona.

<CodeGroup>
  ```json Sample response theme={null}
  {
    "id": "96df2fd7-b2fa-4f0c-ba69-502246776f99",
    "emailAddress": "john.doe@example.com",
    "employeeNumber": "948947464",
    "workNumber": "(807) 940-7411 x8855",
    "jobTitle": "Human Division Manager",
    "createdByPersonaId": "1b5c012d-8d3f-404b-8767-22af0004d383",
    "status": "active",
    "transactionalEmailPreference": true,
    "cardTransactionPushNotificationPreference": false,
    "inviteSentDate": "2018-12-01T14:54:30.000Z",
    "createdAt": "2018-12-01T14:54:30.000Z",
    "updatedAt": "2021-07-13T19:30:45.000Z"
  }
  ```

  ```json Response structure theme={null}
  {
    "id": "string",
    "emailAddress": "string",
    "employeeNumber": "string",
    "workNumber": "string",
    "jobTitle": "string",
    "createdByPersonaId": "string",
    "status": "string",
    "transactionalEmailPreference": boolean,
    "cardTransactionPushNotificationPreference": boolean,
    "inviteSentDate": "string",
    "createdAt": "string",
    "updatedAt": "string"
  }
  ```
</CodeGroup>

For more detailed information about this request and its response, [see the API reference](/api-reference/people/update-a-persona).

## Update a persona's role

<Note>
  **PATCH** `/v2/personas/{personaId}/role`
</Note>

### Request

Use this request to update a persona's role on a specified account. [Learn more about the different role types](/pages/people/about-role-types).

<CodeGroup>
  ```bash Sample request theme={null}
  curl -i -X PATCH \
    'https://api.equalsmoney.com/v2/personas/ecb5d811-166e-4a84-a593-ded4ef06a106/role?accountId=F12345' \
    -H 'Authorization: ApiKey YOUR_API_KEY_HERE' \
    -H 'Content-Type: application/json' \
    -d '{
      "roleName": "Accountant"
    }'
  ```

  ```bash Request structure theme={null}
  curl -i -X PATCH \
    'https://api.equalsmoney.com/v2/personas/{personaId}/role?accountId={accountId}' \
    -H 'Authorization: ApiKey YOUR_API_KEY_HERE' \
    -H 'Content-Type: application/json' \
    -d '{
      "roleName": "string"
    }'
  ```
</CodeGroup>

#### Path parameters

<ParamField body="personaId" type="string" required>
  The ID of the persona that you want to update the role for.

  Allowable values: An existing `personaId` (≤ 36 characters)
</ParamField>

#### Query parameters

<ParamField body="accountId" type="string" required>
  The ID of the account that you want to work with.

  Allowable values: An existing `accountId` (≤ 36 characters)
</ParamField>

#### Request body schema

<ParamField body="roleName" type="string">
  The name of the new role that you want to assign to the persona.

  Allowable values: `Owner`, `Admin`, `Payer`, `Viewer`, `Accountant`, `User`
</ParamField>

### Response

If your request is successful, you'll receive a `200` response containing the name of this persona's new role.

<CodeGroup>
  ```json Sample response theme={null}
  {
    "name": "Accountant"
  }
  ```

  ```json Response structure theme={null}
  {
    "name": "string"
  }
  ```
</CodeGroup>

For more detailed information about this request and its response, [see the API reference](/api-reference/people/update-a-personas-role).

## List roles

### Request

Use this request to get a list of all roles that are currently supported.

<CodeGroup>
  ```bash Sample request theme={null}
  curl -i -X GET \
    'https://api.equalsmoney.com/v2/roles' \
    -H 'Authorization: ApiKey YOUR_API_KEY_HERE'
  ```

  ```bash Request structure theme={null}
  curl -i -X GET \
    'https://api.equalsmoney.com/v2/roles' \
    -H 'Authorization: ApiKey YOUR_API_KEY_HERE'
  ```
</CodeGroup>

#### Query parameters

<ParamField body="limit" type="integer">
  The maximum amount of results to return. By default, this is set to `100`.

  Allowable values: `[ 1 .. 1000 ]`
</ParamField>

<ParamField body="offset" type="integer">
  The amount of results to skip. By default, this is set to `0`.

  Allowable values: A valid integer
</ParamField>

### Response

If your request is successful, you'll receive a `200` response containing a list of roles.

<CodeGroup>
  ```json Sample response theme={null}
  {
    "limit": 100,
    "offset": 200,
    "count": 1,
    "rows": [
      {
        "accountId": "F12345",
        "id": "fbc32687-acbf-4a8b-b60e-b93bb75878ca",
        "name": "Owner",
        "type": "core"
      }
    ]
  }
  ```

  ```json Response structure theme={null}
  {
    "limit": integer,
    "offset": integer,
    "count": integer,
    "rows": [
      {
        "accountId": "string",
        "id": "string",
        "name": "string",
        "type": "string"
      }
    ]
  }
  ```
</CodeGroup>

For more detailed information about this request and its response, [see the API reference](/api-reference/people/list-roles).
