---
title: "Update a User"
method: POST
path: "/users/{user_id}"
tags: ["Users"]
---

# Update a User

`POST /users/{user_id}`

## Request

- Base URL: `https://api.mediamath.com/api/v3.0`
- URL: `https://api.mediamath.com/api/v3.0/users/{user_id}`
- Auth: OAuth 2
  - Authorization code: `https://auth.mediamath.com/authorize`
  - Token URL: `https://auth.mediamath.com/oauth/token` scopes: `offline_access`, `manage:services`
- TypeScript: <https://skmtc.dev/mediamath/apis/campaigns-api/docs/users/:user_id/post.ts> (a function with typed inputs; its response is checked against the schema)

Update a user by ID

## Path parameters

- `user_id` integer, required

## Request body

- UserUpdate
  - `title` string
  - `active` boolean
  - `language` string
  - `zone_name` string
  - `version` integer
  - `first_name` string, required
  - `last_name` string, required
  - `phone` string
  - `roles` integer[], required: Possible values: - 2: "admin", - 3: "manager", - 4: "reporter", - 5: "internal", - 6: "agency" , - 7: "edit_data_definition", - 8: "view_data_definition", - 9: "edit_segments", - 10: "view_segments", - 11: "edit_campaigns", - 13: "edit_margins_and_performance", - 14: "view_organizations", - 15: "view_dmp_reports", - 16: "manage_contracts", - 17: "view_contracts". Some values can't be used with each other, for example 3 and 4. For more information use "/roles" request.
  - `password` string: new password for user

## Response `200`

User updated response

- UserResponse
  - `data` object
    - `title` string
    - `active` boolean
    - `language` string
    - `zone_name` string
    - `id` integer
    - `entity_type` string
    - `username` string
    - `version` integer
    - `first_name` string
    - `last_name` string
    - `link_ldap` boolean
    - `link_saml` boolean
    - `phone` string
    - `mobile` string
    - `fax` string
    - `type` string
    - `role` string
    - `scope` string
    - `view_organizations` boolean
    - `edit_campaigns` boolean
    - `edit_margins_and_performance` boolean
    - `creator_id` integer
    - `created_on` string, date-time
    - `updated_on` string, date-time
    - `last_login_on` string, nullable
    - `access_internal_fees` boolean
    - `view_segments` boolean
    - `edit_segments` boolean
    - `view_data_definition` boolean
    - `edit_data_definition` boolean
    - `view_dmp_reports` boolean
    - `email` string
    - `roles` integer[]: Possible values: - 2: "admin", - 3: "manager", - 4: "reporter", - 5: "internal", - 6: "agency" , - 7: "edit_data_definition", - 8: "view_data_definition", - 9: "edit_segments", - 10: "view_segments", - 11: "edit_campaigns", - 13: "edit_margins_and_performance", - 14: "view_organizations", - 15: "view_dmp_reports", - 16: "manage_contracts", - 17: "view_contracts". Some values can't be used with each other, for example 3 and 4. For more information use "/roles" request.
    - `permissions` UserPermissions, nullable: available only when extended
      - `organizations` UserPermission[]
        - `id` integer
        - `create` boolean
        - `read` boolean
        - `update` boolean
        - `delete` boolean
      - `agencies` UserPermission[]
        - `id` integer
        - `create` boolean
        - `read` boolean
        - `update` boolean
        - `delete` boolean
      - `advertisers` UserPermission[]
        - `id` integer
        - `create` boolean
        - `read` boolean
        - `update` boolean
        - `delete` boolean
  - `meta` object
    - `status` string

## Other responses

- `400`: Error response
- `401`: Error response
- `403`: Error response
- `404`: Error response
- `409`: Error response

---

[API](https://skmtc.dev/mediamath/apis/campaigns-api.md) - [All operations](https://skmtc.dev/mediamath/apis/campaigns-api/llms.txt) - [OpenAPI document](https://skmtc.dev/mediamath/apis/campaigns-api/revisions/408743891def?raw)
