Roles

Roles are a part of the Visibility groups’ feature that allow the Admin user to categorize other users and dictate what items they will be allowed access to see.

Get all roles

Copy link
Copy to clipboard
GET

/v1/roles

Query parameters

start

integer

Pagination start

Default

0

limit

integer

Items shown per page

Response
200

Get all roles

Expand all
Copy code
    • true
    • [ ... ]
      • { ... }

      Get one role

      Copy link
      Copy to clipboard
      GET

      /v1/roles/{id}

      Path parameters

      id

      integer

      required

      ID of the role

      Response
      200

      Get one role

      Expand all
      Copy code
        • true
        • { ... }
          • { ... }

          List role assignments

          Copy link
          Copy to clipboard
          GET

          /v1/roles/{id}/assignments

          List assignments for a role

          Path parameters

          id

          integer

          required

          ID of the role

          Query parameters

          start

          integer

          Pagination start

          Default

          0

          limit

          integer

          Items shown per page

          Response
          200

          List assignments for a role

          Expand all
          Copy code
            • true
            • [ ... ]
              • { ... }

              List role sub-roles

              Copy link
              Copy to clipboard
              GET

              /v1/roles/{id}/roles

              Path parameters

              id

              integer

              required

              ID of the role

              Query parameters

              start

              integer

              Pagination start

              Default

              0

              limit

              integer

              Items shown per page

              Response
              200

              List role sub-roles

              Expand all
              Copy code
                • true
                • [ ... ]
                  • { ... }

                  List role settings

                  Copy link
                  Copy to clipboard
                  GET

                  /v1/roles/{id}/settings

                  Path parameters

                  id

                  integer

                  required

                  ID of the role

                  Response
                  200

                  List role settings

                  Expand all
                  Copy code
                    • true
                    • { ... }

                    Add a role

                    Copy link
                    Copy to clipboard
                    POST

                    /v1/roles

                    Body parameters

                    application/x-www-form-urlencoded

                    parent_role_id

                    integer

                    The ID of the parent Role

                    name

                    string

                    The name of the Role

                    Response
                    200

                    Add a role

                    Expand all
                    Copy code
                      • true
                      • { ... }

                      Add role assignment

                      Copy link
                      Copy to clipboard
                      POST

                      /v1/roles/{id}/assignments

                      Add assignment for a role

                      Path parameters

                      id

                      integer

                      required

                      ID of the role

                      Body parameters

                      application/x-www-form-urlencoded

                      user_id

                      integer

                      required

                      ID of the user

                      Response
                      200

                      Add assignment for a role

                      Expand all
                      Copy code
                        • true
                        • { ... }

                        Add or update role setting

                        Copy link
                        Copy to clipboard
                        POST

                        /v1/roles/{id}/settings

                        Path parameters

                        id

                        integer

                        required

                        ID of the role

                        Body parameters

                        application/x-www-form-urlencoded

                        setting_key

                        string

                        required

                        Values

                        deal_default_visibility

                        lead_default_visibility

                        org_default_visibility

                        person_default_visibility

                        product_default_visibility

                        value

                        required

                        Possible values for default_visibility settings: 1, 3, 5 or 7

                        Values

                        1

                        3

                        5

                        7

                        Response
                        200

                        List role settings

                        Expand all
                        Copy code
                          • true
                          • { ... }

                          Update role details

                          Copy link
                          Copy to clipboard
                          PUT

                          /v1/roles/{id}

                          Path parameters

                          id

                          integer

                          required

                          ID of the role

                          Body parameters

                          application/x-www-form-urlencoded

                          parent_role_id

                          integer

                          The ID of the parent Role

                          name

                          string

                          The name of the Role

                          Response
                          200

                          Update role details

                          Expand all
                          Copy code
                            • true
                            • { ... }

                            Delete a role

                            Copy link
                            Copy to clipboard
                            DELETE

                            /v1/roles/{id}

                            Path parameters

                            id

                            integer

                            required

                            ID of the role

                            Response
                            200

                            Delete a role

                            Expand all
                            Copy code
                              • true
                              • { ... }

                              Delete a role assignment

                              Copy link
                              Copy to clipboard
                              DELETE

                              /v1/roles/{id}/assignments

                              Delete assignment from a role

                              Path parameters

                              id

                              integer

                              required

                              ID of the role

                              Body parameters

                              application/x-www-form-urlencoded

                              user_id

                              integer

                              required

                              ID of the user

                              Response
                              200

                              Delete assignment from a role

                              Expand all
                              Copy code
                                • true
                                • { ... }

                                Subscribe to Pipedrive’s Developer Newsletter