Is there an API endpoint for changing a user’s rol...
# pactflow
a
Is there an API endpoint for changing a user’s role or adding another role?
I tried playing around with
pf:admin-users
but I’m not sure what to include in the body. And when I did a POST request and provided only an email I got the following error when using a read/write API token. I’m an admin and able to modify a user’s role on the UI:
Copy code
Forbidden. Either you are using a read only token for a request that requires a write token (the most likely cause), or you do not have the required permissions.
a
I wasn’t aware of this webpage, thanks a lot!
👍 1
So, I tried using this endpoint but get the following error:
'Forbidden. Either you are using a read only token for a request that requires a write token (the most likely cause), or you do not have the required permissions.\n'
However, I have the Admin role and can change user roles on the UI. I made sure I was using the read/write API token too. Are there additional permissions that I need?
Here are the permissions for Admin role:
Copy code
{
  "updatedAt": "2022-04-06T18:15:41+00:00",
  "createdAt": "2022-04-06T18:15:41+00:00",
  "uuid": "cf75d7c2-416b-11ea-af5e-53c3b1a4efd8",
  "name": "Administrator",
  "description": "For users who manage contract, user and platform related configuration",
  "systemDefined": true,
  "permissions": [{
      "uuid": "2aa9edce-5c67-11eb-af40-6bafa2df5097",
      "scope": "authentication_settings:manage",
      "label": "Manage authentication settings",
      "description": "Can manage all authentication settings.",
      "group": "Authentication Settings"
    }, {
      "uuid": "18f6182b-2e26-4682-892a-229c3afe670e",
      "scope": "contract_data:bulk_delete:*",
      "label": "Can bulk delete all contract data",
      "description": "Can delete more than one contract, verification, version, tag or application at a time.",
      "group": "Contract Data"
    }, {
      "uuid": "f2f22f5b-8d7c-4f0e-a47b-e1a5e9fd41d8",
      "scope": "contract_data:manage:*",
      "label": "Manage all contract data",
      "description": "Can create, edit and delete contract data (applications, application versions, tags, pacts and verifications) for all applications.",
      "group": "Contract Data"
    }, {
      "uuid": "24937077-17de-4804-beb7-db565dc5d62e",
      "scope": "deployment_and_release:record:*",
      "label": "Record deployments and releases",
      "description": "Can record that an application was deployed or released.",
      "group": "Deployment And Release"
    }, {
      "uuid": "e49341a4-2f63-4ae4-ad23-6b401a1675b8",
      "scope": "environment:manage:*",
      "label": "Manage deployment environments",
      "description": "Can manage all environments (create/update/delete environments).",
      "group": "Environment"
    }, {
      "uuid": "b41cc9ca-4a5b-4d6d-9b85-28612df7fd6c",
      "scope": "role:manage:*",
      "label": "Manage roles",
      "description": "Can create, edit or delete roles, and change the permissions associated with a role.",
      "group": "Role"
    }, {
      "uuid": "ca80708a-9628-470b-a6e0-fe161eca2474",
      "scope": "secret:manage:*",
      "label": "Manage secrets",
      "description": "Can create, edit or delete sensitive values. For example, the credentials used with webhooks.",
      "group": "Secret"
    }, {
      "uuid": "4a349656-f3d2-11ea-823f-dfe808d29dba",
      "scope": "system_account:manage:*",
      "label": "Manage system accounts",
      "description": "Can manage all system accounts (creating them, enabling/disabling them, deleting them, viewing and regenerating the access tokens).",
      "group": "System Account"
    }, {
      "uuid": "0ef094bc-92ad-11eb-9713-f3cca25f2fa3",
      "scope": "system_preference:manage:*",
      "label": "Manage system preferences",
      "description": "Can edit the system preferences.",
      "group": "System Preference"
    }, {
      "uuid": "cd394d92-a3c8-4e01-aed5-a1ee6ac2b9d5",
      "scope": "team:manage:*",
      "label": "Manage teams",
      "description": "Can manage all teams (create/delete teams, add users and application to a team).",
      "group": "Team"
    }, {
      "uuid": "167b39ff-d871-4a0c-9ee1-ea35f1579354",
      "scope": "token:manage:own",
      "label": "Manage own API tokens",
      "description": "Can copy and regenerate own read and write API tokens.",
      "group": "Token"
    }, {
      "uuid": "ac170c2c-e541-4681-a27e-7e5834d79bba",
      "scope": "user:manage:*",
      "label": "Manage users",
      "description": "Can manage all users (enable/disable users, delete users, make them administrators).",
      "group": "User"
    }, {
      "uuid": "84b670a6-a2aa-4680-8ce5-c948c8ea4ec2",
      "scope": "webhook:manage:*",
      "label": "Manage webhooks",
      "description": "Can create, edit or delete all webhooks.",
      "group": "Webhook"
    }],
m
When you make the call, there should be a request ID attached (https://smartbear.portal.swaggerhub.com/pactflow/default/support#request-ids)
Could you please share that?